htdocs.mk: Support HTML_STOPDIR_NAME

htdocs.mk's install relies on source code having its HTML contents installed in
a subdir called "htdocs". Make that choice a variable named
"HTML_STOPDIR_NAME".

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2025-09-21 11:43:45 +00:00
commit 64bc96624e

View file

@ -11,8 +11,9 @@ BUILD_HTMLDIR = $(TOPDIR)/htdocs
LOCAL_HTML += $(filter-out $(DONT_INSTALL),$(wildcard *.html *.css *.php *.js) $(FONTS) $(IMAGES)) LOCAL_HTML += $(filter-out $(DONT_INSTALL),$(wildcard *.html *.css *.php *.js) $(FONTS) $(IMAGES))
DONT_LINT_HTML += $(shell $(ECHO) $(wildcard *.html) | xargs --no-run-if-empty $(GREP) -l '<?php') DONT_LINT_HTML += $(shell $(ECHO) $(wildcard *.html) | xargs --no-run-if-empty $(GREP) -l '<?php')
LOCAL_HTML_LINT ?= $(addprefix .,$(addsuffix .lint,$(filter-out $(DONT_LINT_HTML),$(wildcard *.html *.php *.css *.js)))) LOCAL_HTML_LINT ?= $(addprefix .,$(addsuffix .lint,$(filter-out $(DONT_LINT_HTML),$(wildcard *.html *.php *.css *.js))))
HTML_STOPDIR_NAME ?= htdocs
ifeq ($(HTML_SUBDIR),) ifeq ($(HTML_SUBDIR),)
HTML_SUBDIR := $(shell $(PWD) | $(SED) '/.*\/htdocs\(\/\|$$\)/!d; s%.*/htdocs\(/\|$$\)%%') HTML_SUBDIR := $(shell $(PWD) | $(SED) '/.*\/$(HTML_STOPDIR_NAME)\(\/\|$$\)/!d; s%.*/$(HTML_STOPDIR_NAME)\(/\|$$\)%%')
endif endif
ifeq ($(HTML_SUBDIR),) ifeq ($(HTML_SUBDIR),)
INSTALL_HTMLDIR ?= $(PROJECT_HTMLDIR) INSTALL_HTMLDIR ?= $(PROJECT_HTMLDIR)