jw-pkg/make/htdocs.mk
Jan Lindemann 9e245c986e make: Further improve build time
This commit sees several improvements to the build performance:

- Introduce cache.mk, which creates makefiles caching often used
  variables, per tree and per project.
- Define more variables with := enclosed in condistions, instead of
  defining them with ?=, because the RHS of ?= is expanded deferredly.
- Add more definitions for executables.
- Move some more specialized definitions out into specialized makefiles,
  notably htdocs.mk and tmpl.mk

Signed-off-by: Jan Lindemann <jan@janware.com>
2019-02-28 13:22:12 +00:00

36 lines
1 KiB
Makefile

LESS_SRC ?= $(wildcard *.less)
LESS_GENERATED_CSS ?= $(patsubst %.less,%.css,$(LESS_SRC))
LESS_CPY ?= lesscpy
include $(MODDIR)/make/defs.mk
# -- HTML
INSTALLATION_FILE_TYPES += HTML
BUILD_HTMLDIR = $(TOPDIR)/htdocs
LOCAL_HTML += $(filter-out $(DONT_INSTALL),$(wildcard *.html *.css *.php *.js) $(FONTS) $(IMAGES))
ifeq ($(HTML_SUBDIR),)
HTML_SUBDIR := $(shell $(PWD) | $(SED) '/.*\/htdocs\(\/\|$$\)/!d; s%.*/htdocs\(/\|$$\)%%')
endif
ifeq ($(HTML_SUBDIR),)
INSTALL_HTMLDIR ?= $(PROJECT_HTMLDIR)
else
INSTALL_HTMLDIR ?= $(PROJECT_HTMLDIR)/$(HTML_SUBDIR)
endif
INSTALLED_HTML += $(addprefix $(INSTALL_HTMLDIR)/,$(LOCAL_HTML))
include $(MODDIR)/make/js.mk
include $(MODDIR)/make/rules.mk
include $(MODDIR)/make/dev-utils.mk
all: $(LESS_GENERATED_CSS)
install: install_HTML
clean: textclean localclean doneclean clean.lesscpy
test:
%.css: %.less
$(LESS_CPY) $< > $@.tmp
mv $@.tmp $@
clean.lesscpy:
$(RM) -f $(LESS_GENERATED_CSS) *.tmp