diff --git a/curate.mk b/curate.mk index 6accd77..9b3838c 100644 --- a/curate.mk +++ b/curate.mk @@ -34,8 +34,10 @@ ifndef ENV_LOADED endif +#$(info $(value MAKE_SECTION_VARS)) + # Compute definitions for the section, working, and staging directories -$(eval $(call SECTION_DIRS)) +$(eval ${MAKE_SECTION_VARS}) # Gather file lists templates ::= $(wildcard *.gmi.m4) @@ -68,7 +70,6 @@ create: #> Create a new post (default) fi build: ${gemtext_copied} ${templates_expanded} - @echo "Makeflags .................... '$${MAKEFLAGS}'" @echo "✓ Completed processing ${section}" @echo diff --git a/environment.mk b/environment.mk index f3f8649..5b25b7c 100644 --- a/environment.mk +++ b/environment.mk @@ -72,15 +72,23 @@ export STAGING # assume the values appropriate for the current section. This approach defines # a macro that we can call when we recurse into each section # -# TODO: not call to the shell repeatedly -define SECTION_DIRS -section = $$(shell basename $${CURDIR}) -#working_section ::= ${WORKING}/$${section} -#staging_section = ${STAGING}/$$(value section) -working_section = ${WORKING}/$$(shell basename $${CURDIR}) -staging_section ::= ${STAGING}/$$(shell basename $${CURDIR}) +# TODO: Is it possible to simplify this? +define MAKE_SECTION_WORKING +working_section ::= ${WORKING}/$$(value $${1}) endef -export SECTION_DIRS +export MAKE_SECTION_WORKING + +define MAKE_SECTION_STAGING +staging_section ::= ${STAGING}/$${1} +endef +export MAKE_SECTION_STAGING + +define MAKE_SECTION_VARS +section ::= $$(shell basename $${CURDIR}) +$$(eval $$(call MAKE_SECTION_WORKING,$${section})) +$$(eval $$(call MAKE_SECTION_STAGING,$${section})) +endef +export MAKE_SECTION_VARS # Makefiles CURATE_MAKE ::= ${MAKO_DIR}/curate.mk