Read site-env first

This may define environment variables, so we want to give the user
a chance to do that.
This commit is contained in:
Andrew Stryker 2023-09-16 13:26:58 +00:00
parent 4fa401d67b
commit 465e7f9579
1 changed files with 11 additions and 11 deletions

View File

@ -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})