-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (63 loc) · 1.52 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
##############
# parameters #
##############
# do you want to validate html?
DO_CHECKHTML:=1
# do you want dependency on the makefile itself ?
DO_ALLDEP:=1
# do you want to show the commands executed ?
DO_MKDBG:=0
########
# code #
########
# where is the output folder ?
ALL:=
OUT:=out
SOURCES_HTML_MAKO:=$(shell find templates \( -type f -or -type l \) -and -name "*.html.mako" 2> /dev/null)
SOURCES_HTML:=$(basename $(shell pymakehelper remove_folders $(SOURCES_HTML_MAKO)))
ifndef SOURCES_HTML
$(error SOURCES_HTML not set)
endif
HTMLCHECK:=$(OUT)/html.stamp
ifeq ($(DO_CHECKHTML),1)
ALL+=$(HTMLCHECK)
endif # DO_CHECKHTML
# dependency on the makefile itself
ifeq ($(DO_ALLDEP),1)
.EXTRA_PREREQS+=$(foreach mk, ${MAKEFILE_LIST},$(abspath ${mk}))
endif
# silent stuff
ifeq ($(DO_MKDBG),1)
Q:=
# we are not silent in this branch
else # DO_MKDBG
Q:=@
#.SILENT:
endif # DO_MKDBG
#########
# rules #
#########
# do not touch this rule
.PHONY: all
all: $(ALL)
@true
$(HTMLCHECK): $(SOURCES_HTML)
$(info doing [$@])
$(Q)pymakehelper only_print_on_error node_modules/htmlhint/bin/htmlhint $(SOURCES_HTML)
$(Q)pymakehelper touch_mkdir $@
# this next line doesnt work because tidy does not support html5
#$(Q)tidy -errors -q -utf8 $(SOURCES_HTML)
.PHONY: debug
debug:
$(info doing [$@])
$(info ALL is $(ALL))
$(info SOURCES_HTML_MAKO is $(SOURCES_HTML_MAKO))
$(info SOURCES_HTML is $(SOURCES_HTML))
$(info HTMLCHECK is $(HTMLCHECK))
.PHONY: clean
clean:
$(Q)rm -f $(ALL)
.PHONY: clean_hard
clean_hard:
$(info doing [$@])
$(Q)git clean -qffxd