make, scripts: Re-add files necessary for building ytools

Re-add everthing needed for building and packaging ytools. This is a
big commit, 2002 lines of code. It mostly consists of C/C++ machinery,
plus some documentation-related stuff.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2025-11-14 15:59:49 +01:00
commit bf16c6714b
27 changed files with 1975 additions and 0 deletions

28
make/yapp.mk Normal file
View file

@ -0,0 +1,28 @@
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_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 $@