Every directory should have a test target, and the test target should depend on all so that all files are generated that might be needed for testing. This commit fixes some missing targets, and adds some missing dependencies.
Signed-off-by: Jan Lindemann <jan@janware.com>
70 lines
1.9 KiB
Makefile
70 lines
1.9 KiB
Makefile
LESS_SRC ?= $(wildcard *.less)
|
|
LESS_GENERATED_CSS ?= $(patsubst %.less,%.css,$(LESS_SRC))
|
|
LESS_CPY ?= lesscpy
|
|
|
|
include $(JWBDIR)/make/defs.mk
|
|
|
|
# -- HTML
|
|
PRETTIER := $(shell $(WHICH) prettier 2>/dev/null)
|
|
INSTALLATION_FILE_TYPES += HTML
|
|
BUILD_HTMLDIR = $(TOPDIR)/htdocs
|
|
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')
|
|
LOCAL_HTML_LINT ?= $(addprefix .,$(addsuffix .lint,$(filter-out $(DONT_LINT_HTML),$(wildcard *.html *.php *.css *.js))))
|
|
HTML_STOPDIR_NAME ?= htdocs
|
|
ifeq ($(HTML_SUBDIR),)
|
|
HTML_SUBDIR := $(shell $(PWD) | $(SED) '/.*\/$(HTML_STOPDIR_NAME)\(\/\|$$\)/!d; s%.*/$(HTML_STOPDIR_NAME)\(/\|$$\)%%')
|
|
endif
|
|
ifeq ($(HTML_SUBDIR),)
|
|
INSTALL_HTMLDIR ?= $(PROJECT_HTMLDIR)
|
|
else
|
|
INSTALL_HTMLDIR ?= $(PROJECT_HTMLDIR)/$(HTML_SUBDIR)
|
|
endif
|
|
INSTALLED_HTML += $(addprefix $(INSTALL_HTMLDIR)/,$(LOCAL_HTML))
|
|
|
|
|
|
include $(JWBDIR)/make/js.mk
|
|
include $(JWBDIR)/make/rules.mk
|
|
include $(JWBDIR)/make/dev-utils.mk
|
|
|
|
all: $(LESS_GENERATED_CSS) lint
|
|
install: install_HTML
|
|
clean: textclean localclean doneclean clean.lesscpy
|
|
test: all
|
|
|
|
%.css: %.less
|
|
$(LESS_CPY) $< > $@.tmp
|
|
mv $@.tmp $@
|
|
|
|
clean.lesscpy:
|
|
$(RM) -f $(LESS_GENERATED_CSS) *.tmp
|
|
|
|
lint: $(LOCAL_HTML_LINT)
|
|
clean: lint.clean
|
|
lint.clean:
|
|
rm -f .*.lint
|
|
|
|
.%.html.lint: %.html
|
|
ifneq ($(PRETTIER),)
|
|
$(PRETTIER) $< >/dev/null
|
|
endif
|
|
touch $@
|
|
|
|
.%.php.lint: %.php
|
|
php -l $<
|
|
ifneq ($(PRETTIER),)
|
|
#$(PRETTIER) --parser html $< >/dev/null
|
|
endif
|
|
touch $@
|
|
|
|
.%.css.lint: %.css
|
|
ifneq ($(PRETTIER),)
|
|
$(PRETTIER) $< >/dev/null
|
|
endif
|
|
touch $@
|
|
|
|
.%.js.lint: %.js
|
|
ifneq ($(PRETTIER),)
|
|
$(PRETTIER) $< >/dev/null
|
|
endif
|
|
touch $@
|