tmpl.mk: Re-add because it's useful

Templates (i.e. text files ending as .tmpl) are not part of jw-pkg
anylonger, but controlling the way they are installed is beneficial
to other packages, so add tmpl.mk back.

That said, the variable names will need some tweaking to avoid
collisions. Postponed.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2025-12-17 12:15:30 +01:00
commit ca5910d423

22
make/tmpl.mk Normal file
View file

@ -0,0 +1,22 @@
include $(JWBDIR)/make/defs.mk
# -- TMPL
INSTALLATION_FILE_TYPES += TMPL
BUILD_TMPLDIR = $(TOPDIR)/tmpl
LOCAL_TMPL += $(filter-out $(DONT_INSTALL),$(wildcard *.tmpl))
ifndef TMPL_SUBDIR
TMPL_SUBDIR := $(shell $(PWD) | $(SED) '/.*\/tmpl\(\/\|$$\)/!d; s%.*/tmpl\(/\|$$\)%%')
endif
ifeq ($(TMPL_SUBDIR),)
INSTALL_TMPLDIR = $(PROJECT_TMPLDIR)
else
INSTALL_TMPLDIR = $(PROJECT_TMPLDIR)/$(TMPL_SUBDIR)
endif
INSTALLED_TMPL += $(addprefix $(INSTALL_TMPLDIR)/,$(LOCAL_TMPL))
include $(JWBDIR)/make/rules.mk
all:
install: install_TMPL
clean: textclean localclean doneclean
test: