From 8a4475141d9b0d6492336f777f1e926ecab223cf Mon Sep 17 00:00:00 2001 From: Joan Josep Ordinas Rosa Date: Thu, 6 Apr 2017 20:14:04 +0200 Subject: [PATCH] Enabled second expansion --- docs/Makefile | 9 +++++---- docs/make.d/config.make | 4 ++-- docs/make.d/introspect.make | 7 ++----- docs/make.d/metadata.make | 18 ++++++++++-------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index 1489d70..fe0ce68 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -52,7 +52,6 @@ endif # Variables: # HomePage # Pages -# OtherPages # PagesJSON # Nodes # NodesJSON @@ -117,8 +116,6 @@ endif # __globals__ ifdef __globals__ # Files to build or publish -Home := index -Other := content data engine structure Static := styles.css JQT_Man := jqt.1 @@ -141,7 +138,8 @@ $(Pages): \ $(Metadata)/config.json \ # All pages except home page -$(OtherPages): \ +other_pages := $(filter-out $(HomePage),$(Pages)) +$(other_pages): \ $(Content)/FLOW.txt \ $(Layouts)/page.html \ $(Content)/opt/*.txt \ @@ -187,6 +185,9 @@ $(Destination)/$(1).html: $(Content)/$(1).md $(Layouts)/$(2).html \ @$(JQT) -d $$< $(Layouts)/$(2).html | $(DETAILS) > $$@ endef +# TODO: instrospect +Home := index +Other := content data engine structure $(eval $(call Target,$(Home),page)) $(foreach p,$(Other),$(eval $(call Target,$(p),page-toc))) diff --git a/docs/make.d/config.make b/docs/make.d/config.make index 49e37d3..bc0283d 100644 --- a/docs/make.d/config.make +++ b/docs/make.d/config.make @@ -63,8 +63,8 @@ SHELL := /bin/bash # exits with a nonzero exit status. .DELETE_ON_ERROR: -#!# Enable a second expansion of the prerequisites -#!.SECONDEXPANSION: +# Enable a second expansion of the prerequisites +.SECONDEXPANSION: ######################################################################## # Common macros diff --git a/docs/make.d/introspect.make b/docs/make.d/introspect.make index 3b8e72e..7d5bb96 100644 --- a/docs/make.d/introspect.make +++ b/docs/make.d/introspect.make @@ -9,7 +9,6 @@ # Exported variables: # HomePage # Pages -# OtherPages # PagesJSON # Nodes # NodesJSON @@ -24,7 +23,7 @@ i_documents := $(sort $(shell find $(Content) -type f -a -name '*.md')) i_paths := $(sort $(dir $(i_documents))) # Paths to create at $(Destination) -i_paths_destination := $(patsubst $(Content)%,$(Destination)%,$(i_paths)) +i_paths_destination := $(call rest,$(patsubst $(Content)%,$(Destination)%,$(i_paths))) # Paths to nodes at $(Metadata) i_paths_meta_nodes := $(patsubst $(Content)%,$(Metadata)/nodes%,$(i_paths)) @@ -58,13 +57,12 @@ HomePage := $(Destination)/index.html # Pages to generate at $(Destination) Pages := $(patsubst %.md,%.html,$(patsubst $(Content)%,$(Destination)%,$(i_documents))) -OtherPages := $(filter-out $(HomePage),$(Pages)) # JSON for each page to generate at $(Metadata)/pages PagesJSON := $(patsubst %.md,%.json,$(patsubst $(Content)%,$(Metadata)/pages%,$(i_documents))) # Nodes to generate at $(Destination) -Nodes := $(call rest,$(patsubst %/,%/index.html,$(i_paths_destination))) +Nodes := $(patsubst %/,%/index.html,$(i_paths_destination)) # JSON for each node to generate at $(Metadata)/nodes NodesJSON := $(call rest,$(patsubst %/,%.json,$(i_paths_meta_nodes))) @@ -85,7 +83,6 @@ intro: @echo @echo 'HomePage: $(HomePage)' @echo 'Pages: $(Pages)' - @echo 'OtherPages: $(OtherPages)' @echo 'PagesJSON: $(PagesJSON)' @echo 'Nodes: $(Nodes)' @echo 'NodesJSON: $(NodesJSON)' diff --git a/docs/make.d/metadata.make b/docs/make.d/metadata.make index 2aed199..83bad03 100644 --- a/docs/make.d/metadata.make +++ b/docs/make.d/metadata.make @@ -10,6 +10,8 @@ # $(Metadata)/config.json ==> # $(Metadata)/site.json ==> # $(Metadata)/globals.make +# Dependencies: +# globals.make => site.json => config.json => config.yaml # Metadata directory $(Metadata): @@ -63,14 +65,14 @@ $(Metadata)/site.json: $(Metadata)/config.json # Variables to define in globals.make define m_MAKE_GLOBALS := - "__globals__ := 1", \ - "Destination := " + .Destination, \ - "Assets := " + .Assets, \ - "Blocks := " + .Blocks, \ - "Content := " + .Content, \ - "Data := " + .Data, \ - "Layouts := " + .Layouts, \ - "Styles := " + .Styles, \ + "__globals__ := 1", \ + "Assets := " + .Assets, \ + "Blocks := " + .Blocks, \ + "Content := " + .Content, \ + "Data := " + .Data, \ + "Destination := " + .Destination, \ + "Layouts := " + .Layouts, \ + "Styles := " + .Styles, \ "# vim:syntax=make" endef