yapp.mk: Add YAPP_NAMESPACE to yapp.mk

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2014-10-12 12:56:58 +00:00
commit 0d5cfd1494

View file

@ -2,6 +2,7 @@ SRC_ALL_CPP += main.cpp
YAPP_CLASS ?= $(firstword $(basename $(wildcard YApp*.h Y*.h *.h)))
YAPP_CLASS_H ?= $(firstword $(wildcard $(addsuffix /$(YAPP_CLASS).h,\
$(subst -I,,$(INCLUDE)))) $(YAPP_CLASS).h)
YAPP_NAMESPACE ?=
ifneq ($(TARGET),mingw)
LOCAL_LDFLAGS += -rdynamic
@ -18,5 +19,9 @@ clean.yapp:
rm -f main.cpp
main.cpp: $(YAPP_CLASS_H)
echo -e "#include \"$<\"\n#include <YAppRunner.h>\nyapp_main($(YAPP_CLASS))" > $@
echo "#include \"$<\"" > $@.tmp
if [ "$(YAPP_NAMESPACE)" ]; then echo "using namespace $(YAPP_NAMESPACE);" >> $@.tmp; fi
echo "#include <YAppRunner.h>" >> $@.tmp
echo "yapp_main($(YAPP_CLASS))" >> $@.tmp
mv $@.tmp $@