Continue movement to making directories in recipes

This commit is contained in:
Andrew Stryker 2023-10-10 19:50:24 -07:00
parent dc7cc4ce8f
commit 4d97d9ce50

View File

@ -55,20 +55,20 @@ build_date_msg ?= This page was built on $$(date).
# Define special files
index_template ::= index.gmi.m4
index ::= ${STG_SECTION}/index.gmi
index ::= ${STAGING_SECTION}/index.gmi
header_template ::= header.gmi.m4
header ::= ${WRK_SECTION}/header.gmi
header ::= ${WORKING_SECTION}/header.gmi
footer_template ::= footer.gmi.m4
footer ::= ${WRK_SECTION}/footer.gmi
footer ::= ${WORKING_SECTION}/footer.gmi
# Capture all posts as Gemtext files that begin with an ISO formatted date
posts_gmi ::= $(shell ls *.gmi | grep "[[:digit:]]\{4\}\(-[[:digit:]]\{2\}\)\{2\}")
posts ::= $(addprefix ${STG_SECTION}/, ${posts_gmi})
entries ::= $(addprefix ${WRK_SECTION}/, ${posts_gmi:.gmi=.lnk})
posts ::= $(addprefix ${STAGING_SECTION}/, ${posts_gmi})
entries ::= $(addprefix ${WORKING_SECTION}/, ${posts_gmi:.gmi=.lnk})
TAG_LIST ::= ${WRK_SECTION}/tag-list
TAG_LIST ::= ${WORKING_SECTION}/tag-list
export TAG_LIST
# Create list of potential dependencies of *.gmi.m4 templates
@ -122,21 +122,20 @@ help: #> Display this help message
#
#-----------------------------------------------------------------------------#
${WRK_SECTION} ${STG_SECTION}: %:
@mkdir -p $@
@echo "\t✓ Created space: $@"
${header} ${footer}: ${WRK_SECTION}/%: % ${WRK_SECTION} ${template_depends}
${header} ${footer}: ${WORKING_SECTION}/%: % ${template_depends}
@mkdir -p ${WORKING_SECTION}
@m4 --include=${MAKO_DIR} $< > $@
@echo "\t✓ Created: $@"
${posts}: ${STG_SECTION}/%: % ${header} ${footer} ${STG_SECTION}
${posts}: ${STAGING_SECTION}/%: % ${header} ${footer}
@mkdir -p ${STAGING_SECTION}
@cat ${header} $< ${footer} > $@
@echo "${build_date_msg}" >> $@
@echo "\t✓ Created $@"
${entries}: ${WRK_SECTION}/%.lnk: ${MAKO_DIR}/create-index-entry.awk %.gmi ${WRK_SECTION}
@awk -f $(notdir $^) > $@
${entries}: ${WORKING_SECTION}/%.lnk: ${MAKO_DIR}/create-index-entry.awk %.gmi
@mkdir -p ${WORKING_SECTION}
@awk -f $^ > $@
@echo "\t✓ Created: $@"
${TAG_LIST}: ${entries}