jw-pkg/make/yapp.mk
Jan Lindemann 3365aa3db6 make: Replace BUILD_XXX make flag variables by FINAL_XXX
The following BUILD_XXX variables are renamed to their respective FINAL_XXX
counterparts, as that name is more expressive:

  BUILD_CFLAGS, BUILD_CPPFLAGS, BUILD_CXXFLAGS, BUILD_EXTRA_DEBUG_FLAGS,
  BUILD_INCLUDE, BUILD_LDFLAGS, BUILD_LIBFLAGS, BUILD_LPPFLAGS

Signed-off-by: Jan Lindemann <jan@janware.com>
2019-06-24 12:58:53 +00:00

28 lines
861 B
Makefile

SRC_ALL_CPP += main.cpp
YAPP_INCLUDE_DIR ?= .
YAPP_CLASS ?= $(firstword $(basename $(notdir $(wildcard $(addprefix \
$(YAPP_INCLUDE_DIR)/, YApp*.h App*.h Y*.h *.h)))))
YAPP_CLASS_H ?= $(firstword $(wildcard $(addsuffix /$(YAPP_CLASS).h,\
$(YAPP_INCLUDE_DIR) $(subst -I,,$(FINAL_INCLUDE)))) $(YAPP_CLASS).h)
YAPP_NAMESPACE ?=
ifneq ($(TARGET),mingw)
FINAL_LDFLAGS += -rdynamic
endif
include $(MODDIR)/make/exe.mk
all: build_EXE
install: install_EXE
clean: clean.yapp
distclean:
clean.yapp:
$(RM) -f main.cpp
main.cpp: $(YAPP_CLASS_H)
echo "#include \"$<\"" > $@.tmp
if [ "$(YAPP_NAMESPACE)" ]; then echo "using namespace $(YAPP_NAMESPACE);" >> $@.tmp; fi
echo "#include <ytools/YAppRunner.h>" >> $@.tmp
echo "yapp_main($(YAPP_CLASS))" >> $@.tmp
mv $@.tmp $@