Skip to content

Commit

Permalink
Enabled second expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
fadado committed Apr 6, 2017
1 parent 10a8e24 commit 8a44751
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
9 changes: 5 additions & 4 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ endif
# Variables:
# HomePage
# Pages
# OtherPages
# PagesJSON
# Nodes
# NodesJSON
Expand Down Expand Up @@ -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

Expand All @@ -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 \
Expand Down Expand Up @@ -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)))

Expand Down
4 changes: 2 additions & 2 deletions docs/make.d/config.make
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions docs/make.d/introspect.make
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# Exported variables:
# HomePage
# Pages
# OtherPages
# PagesJSON
# Nodes
# NodesJSON
Expand All @@ -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))
Expand Down Expand Up @@ -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)))
Expand All @@ -85,7 +83,6 @@ intro:
@echo
@echo 'HomePage: $(HomePage)'
@echo 'Pages: $(Pages)'
@echo 'OtherPages: $(OtherPages)'
@echo 'PagesJSON: $(PagesJSON)'
@echo 'Nodes: $(Nodes)'
@echo 'NodesJSON: $(NodesJSON)'
Expand Down
18 changes: 10 additions & 8 deletions docs/make.d/metadata.make
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 8a44751

Please sign in to comment.