jw-pkg/make/yapp.mk
Jan Lindemann ddf310d3ad
make: Support INSTALL_PREFIXDIR
During "make install", the packaging machinery should run "$(LOG_INSTALL)
-D /opt/<pkg>" but runs "mkdir -p /opt/<pkg>" instead. As a consequence,
the created directory is not owned by any of the created packages. This
commit fixes that by introducing INSTALL_PREFIXDIR and installing it like
all other directories.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-09-07 09:23:16 +02:00

28 lines
880 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 $(JWBDIR)/make/exe.mk
all: build_EXE
install: install_dir_PREFIX 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 $@