瀏覽代碼

:tada: Add embedde images in ditributable folder

DricomDragon 1 年之前
父節點
當前提交
0eef66039b
共有 1 個文件被更改,包括 10 次插入1 次删除
  1. 10 1
      makefile

+ 10 - 1
makefile

@@ -12,11 +12,13 @@ GEN_FILES := $(GEN_HTMLS) $(GEN_MDS)
 
 INCLUDED_FILES := $(shell find src/include -type f)
 DOWNLOAD_FILES := $(shell find src/download -type f)
+EMBEDDED_FILES := $(shell find src -name '*.png' -type f)
 
 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) $(DIST_DIR)/favicon.ico
+DIST_EMB_FILES := $(EMBEDDED_FILES:src/%=$(DIST_DIR)/%)
+DIST_FILES := $(DIST_GEN_FILES) $(DIST_INC_FILES) $(DIST_DWN_FILES) $(DIST_EMB_FILES) $(DIST_DIR)/favicon.ico
 
 PANDOC_GEN := pandoc --standalone --wrap=none --template src/templates/main.html --metadata-file src/meta.yml
 
@@ -47,6 +49,10 @@ $(DIST_DIR)/%.html: src/%.gen.html
 	mkdir --parents $(dir $@)
 	cp $< $@
 
+$(DIST_DIR)/%.png: src/%.png
+	mkdir --parents $(dir $@)
+	cp $< $@
+
 $(DIST_DIR)/favicon.ico: src/favicon.ico
 	cp $< $@
 
@@ -65,4 +71,7 @@ debug:
 	$(info GEN_HTMLS $(GEN_HTMLS))
 	$(info GEN_MDS $(GEN_MDS))
 	$(info GEN_FILES $(GEN_FILES))
+	$(info INCLUDED_FILES $(INCLUDED_FILES))
+	$(info DOWNLOAD_FILES $(DOWNLOAD_FILES))
+	$(info EMBEDDED_FILES $(EMBEDDED_FILES))
 	$(info DIST_FILES $(DIST_FILES))