jw-pkg/make/yapp.mk
Jan Lindemann 17a080138c make: Prefix BUILD_ to a couple of makefile variables
Rename variables to avoid collision:

  OBJ      -> BUILD_OBJ
  INCLUDE  -> BUILD_INCLUDE
  LIBFLAGS -> BUILD_LIBFLAGS
  LPPFLAGS -> BUILD_LPPFLAGS

Signed-off-by: Jan Lindemann <jan@janware.com>
2019-04-08 18:26:45 +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,,$(BUILD_INCLUDE)))) $(YAPP_CLASS).h)
YAPP_NAMESPACE ?=
ifneq ($(TARGET),mingw)
LOCAL_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 $@