From 465e7f957958343ca5b30465c04bceb1445359af Mon Sep 17 00:00:00 2001 From: Andrew Stryker Date: Sat, 16 Sep 2023 13:26:58 +0000 Subject: [PATCH] Read site-env first This may define environment variables, so we want to give the user a chance to do that. --- environment.mk | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/environment.mk b/environment.mk index 412dd46..a9ad5d3 100644 --- a/environment.mk +++ b/environment.mk @@ -36,6 +36,17 @@ export ENV_LOADED SHELL = /bin/sh export SHELL +# User-defined configuration file +SITE_ENV ?= content/site-env +SITE_ENV ::= $(strip ${site_env}) + +ifeq ($(strip $(shell [ -r ${SITE_ENV} ] && echo ${SITE_ENV})),) + $(info Generate a site configuration file first via `make configure`) + $(error Configuration file ${site_env} not readable.) +else + include ${SITE_ENV} +endif + # Base/root directory of the build system. Allows us to use absolute paths. MAKO_DIR ?= ${CURDIR} export MAKO_DIR @@ -45,17 +56,6 @@ CONTENT ?= ${MAKO_DIR}/content CONTENT ::= $(strip ${CONTENT}) export CONTENT -# User-defined configuration file -site_env ?= ${CONTENT}/site-env -site_env ::= $(strip ${site_env}) - -ifeq ($(strip $(shell [ -r ${site_env} ] && echo ${site_env})),) - $(info Generate a site configuration file first via `make configure`) - $(error Configuration file ${site_env} not readable.) -else - include ${site_env} -endif - # Place for intermediate files WORKING ?= ${MAKO_DIR}/workspace WORKING ::= $(strip ${WORKING})