macroises blog_rule
This commit is contained in:
+7
-6
@@ -29,11 +29,16 @@ endef
|
|||||||
|
|
||||||
blogs := $(subst blogs/,,$(wildcard blogs/*))
|
blogs := $(subst blogs/,,$(wildcard blogs/*))
|
||||||
|
|
||||||
blog_deps = $(patsubst \
|
blog_src = $(patsubst \
|
||||||
blogs/$(blog)/%.$(BLOG_EXT_$(blog)),\
|
blogs/$(blog)/%.$(BLOG_EXT_$(blog)),\
|
||||||
src/$(blog)/%$(if $(BLOG_LAYOUT_$(blog)),.$(BLOG_LAYOUT_$(blog))).upphtml,\
|
src/$(blog)/%$(if $(BLOG_LAYOUT_$(blog)),.$(BLOG_LAYOUT_$(blog))).upphtml,\
|
||||||
$(shell find -L "blogs/$(blog)" -type f -and -name *.$(BLOG_EXT_$(blog))))
|
$(shell find -L "blogs/$(blog)" -type f -and -name *.$(BLOG_EXT_$(blog))))
|
||||||
|
|
||||||
|
define blog_rule =
|
||||||
|
.PHONY: $(blog)
|
||||||
|
$(blog): $(blog_src)
|
||||||
|
endef
|
||||||
|
|
||||||
all: microlog blog public out
|
all: microlog blog public out
|
||||||
|
|
||||||
.PHONY: out
|
.PHONY: out
|
||||||
@@ -45,11 +50,7 @@ $(foreach layout,$(layouts),\
|
|||||||
$(foreach ext,$(sort $(out_deps_ext)),\
|
$(foreach ext,$(sort $(out_deps_ext)),\
|
||||||
$(eval $(call out_rule,$(ext),.$(layout)))))
|
$(eval $(call out_rule,$(ext),.$(layout)))))
|
||||||
|
|
||||||
.PHONY: microlog
|
$(foreach blog,$(blogs),$(eval $(blog_rule)))
|
||||||
microlog: $(let blog,microlog,$(blog_deps))
|
|
||||||
|
|
||||||
.PHONY: blog
|
|
||||||
blog: $(let blog,blog,$(blog_deps))
|
|
||||||
|
|
||||||
$(foreach blog,$(blogs),\
|
$(foreach blog,$(blogs),\
|
||||||
$(foreach layout,$(layouts),\
|
$(foreach layout,$(layouts),\
|
||||||
|
|||||||
Reference in New Issue
Block a user