|
@@ -1,3 +1,7 @@
|
|
|
+# Environment vars
|
|
|
+DIST_DIR := dist
|
|
|
+
|
|
|
+# Computed vars
|
|
|
SRC_HTMLS := $(shell find src -name '*.src.html')
|
|
|
SRC_MDS := $(shell find src -name '*.src.md')
|
|
|
|
|
@@ -8,14 +12,14 @@ GEN_FILES := $(GEN_HTMLS) $(GEN_MDS)
|
|
|
INCLUDED_FILES := $(shell find src/include -type f)
|
|
|
DOWNLOAD_FILES := $(shell find src/download -type f)
|
|
|
|
|
|
-DIST_GEN_FILES := $(GEN_FILES:src/%.gen.html=dist/%.html)
|
|
|
-DIST_INC_FILES := $(INCLUDED_FILES:src/%=dist/%)
|
|
|
-DIST_DWN_FILES := $(DOWNLOAD_FILES:src/%=dist/%)
|
|
|
+DIST_GEN_FILES := $(GEN_FILES:src/%.gen.html=$(DIST_DIR)/%.html)
|
|
|
+DIST_INC_FILES := $(INCLUDED_FILES:src/%=$(DIST_DIR)/%)
|
|
|
+DIST_DWN_FILES := $(DOWNLOAD_FILES:src/%=$(DIST_DIR)/%)
|
|
|
DIST_FILES := $(DIST_GEN_FILES) $(DIST_INC_FILES) $(DIST_DWN_FILES)
|
|
|
|
|
|
PANDOC_GEN := pandoc --standalone --wrap=none --template src/templates/main.html --metadata-file src/meta.yml
|
|
|
|
|
|
-.PHONY: build
|
|
|
+.PHONY: build dist
|
|
|
build: $(GEN_FILES)
|
|
|
$(info HTML generated)
|
|
|
|
|
@@ -25,18 +29,20 @@ build: $(GEN_FILES)
|
|
|
%.gen.html: %.src.md
|
|
|
$(PANDOC_GEN) --output $@ $<
|
|
|
|
|
|
-dist: $(DIST_FILES)
|
|
|
+dist: $(DIST_DIR)
|
|
|
$(info Distributed folder generated)
|
|
|
|
|
|
-dist/include/%: src/include/%
|
|
|
+$(DIST_DIR): $(DIST_FILES)
|
|
|
+
|
|
|
+$(DIST_DIR)/include/%: src/include/%
|
|
|
mkdir --parents $(dir $@)
|
|
|
cp $< $@
|
|
|
|
|
|
-dist/download/%: src/download/%
|
|
|
+$(DIST_DIR)/download/%: src/download/%
|
|
|
mkdir --parents $(dir $@)
|
|
|
cp $< $@
|
|
|
|
|
|
-dist/%.html: src/%.gen.html
|
|
|
+$(DIST_DIR)/%.html: src/%.gen.html
|
|
|
mkdir --parents $(dir $@)
|
|
|
cp $< $@
|
|
|
|
|
@@ -44,6 +50,9 @@ dist/%.html: src/%.gen.html
|
|
|
clean:
|
|
|
rm -f $(GEN_FILES)
|
|
|
|
|
|
+clean-dist:
|
|
|
+ rm -f $(DIST_FILES)
|
|
|
+
|
|
|
.PHONY: debug
|
|
|
debug:
|
|
|
$(info SRC_HTMLS $(SRC_HTMLS))
|