diff options
-rw-r--r-- | Makefile | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/Makefile b/Makefile index 5b3cadd..168fac8 100644 --- a/Makefile +++ b/Makefile | |||
@@ -25,7 +25,7 @@ PTMPC = \ | |||
25 | PTMPR = \ | 25 | PTMPR = \ |
26 | $$hb: $$ht ; \ | 26 | $$hb: $$ht ; \ |
27 | ${HTAWK} < '$$ht' | \ | 27 | ${HTAWK} < '$$ht' | \ |
28 | env HTTMP='$T' HTENV='$T/\$$<.env' HTOUT='\$$@' \ | 28 | env HTTMP='$T' HTENV='$T/\$$<.env' HTOUT='\$$@' HTBOD='\$$<.bod.txt' \ |
29 | ${HTSH} '${PTMPL}' > '\$$@' | 29 | ${HTSH} '${PTMPL}' > '\$$@' |
30 | 30 | ||
31 | ITMPL = tmpl.index.htm | 31 | ITMPL = tmpl.index.htm |
@@ -45,6 +45,19 @@ ITMPR = \ | |||
45 | TMPL = ${PTMPL} ${ITMPL} | 45 | TMPL = ${PTMPL} ${ITMPL} |
46 | BUILD_INPUTS = ${INPUT}/* ${TMPL} ${HT} | 46 | BUILD_INPUTS = ${INPUT}/* ${TMPL} ${HT} |
47 | 47 | ||
48 | RSYNCEXCLUDE = \ | ||
49 | "*.ht" \ | ||
50 | "*.sh" \ | ||
51 | "*.htm" \ | ||
52 | "*.mk" \ | ||
53 | "*.awk" \ | ||
54 | "*.bod.txt" \ | ||
55 | "tmp/" | ||
56 | RSYNCEXCLUDEFILE = ${BUILD}/.rsync-exclude | ||
57 | RSYNC = rsync -avz --exclude-from="${RSYNCEXCLUDEFILE}" --delete | ||
58 | |||
59 | #################### | ||
60 | |||
48 | ${BUILD}: ${BUILD_INPUTS} | 61 | ${BUILD}: ${BUILD_INPUTS} |
49 | @touch ${LASTB} | 62 | @touch ${LASTB} |
50 | @mkdir -p ${BUILD} | 63 | @mkdir -p ${BUILD} |
@@ -73,16 +86,11 @@ ${ITMPL}: ; printf '${ITMPC}' > '$@' | |||
73 | 86 | ||
74 | .PHONY: clean clean-build nuke | 87 | .PHONY: clean clean-build nuke |
75 | clean: ; -rm -rf ${BUILD} ${HTMK} $T ${LASTB} | 88 | clean: ; -rm -rf ${BUILD} ${HTMK} $T ${LASTB} |
76 | clean-build: | ||
77 | rm -rf '${BUILD}/$T' | ||
78 | for file in ${BUILD}/*; do \ | ||
79 | case "$$file" in \ | ||
80 | *.ht|*.sh|*.htm|*.mk|*.awk) rm -rf "$$file" ;; \ | ||
81 | esac \ | ||
82 | done | ||
83 | nuke: clean ; -rm ${TMPL} | 89 | nuke: clean ; -rm ${TMPL} |
84 | 90 | ||
85 | .PHONY: publish | 91 | ${RSYNCEXCLUDEFILE}: ${BUILD} |
86 | publish: build clean-build | 92 | printf '%s\n' ${RSYNCEXCLUDE} > '$@' |
87 | scp -r ${BUILD}/* '${UPLOAD_TARGET}'; \ | ||
88 | 93 | ||
94 | .PHONY: publish | ||
95 | publish: build ${RSYNCEXCLUDEFILE} | ||
96 | ${RSYNC} ${BUILD}/* '${UPLOAD_TARGET}' | ||