lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master fbe3879 3/6: Assert a precondition; improve d


From: Greg Chicares
Subject: [lmi-commits] [lmi] master fbe3879 3/6: Assert a precondition; improve documentation
Date: Wed, 22 May 2019 15:27:39 -0400 (EDT)

branch: master
commit fbe3879978e6d19aae5deeccc7dd6605b0cebb9e
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Assert a precondition; improve documentation
---
 GNUmakefile | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/GNUmakefile b/GNUmakefile
index ef8d813..53450f5 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -77,8 +77,14 @@ MAKEFLAGS := \
 
 
################################################################################
 
-# Remake this file to "source" a script that sets various crucial
+# Remake this makefile to "source" a script that sets various crucial
 # environment variables.
+#
+# For similar usage elsewhere, $(srcdir) is generally preferred to
+# $(CURDIR), especially in submakefiles made in other directories,
+# where $(CURDIR) would be wrong. In this particular case, however,
+# $(srcdir) has not yet been assigned, and it's best to remake this
+# makefile early.
 
 export LMI_ENV_FILE := env_$(shell date -u +'%s_%N').eraseme
 
@@ -130,6 +136,12 @@ htmldir         := $(docdir)
 # source files (GNU Coding Standards don't suggest any default value)
 srcdir          := $(CURDIR)
 
+# $(srcdir) really shouldn't be overridden. A noisy assertion is more
+# helpful than a silent 'override' directive.
+ifneq ($(srcdir),$(CURDIR))
+  $(error Assertion failure: source directory misconfigured)
+endif
+
 # These directories are outside the scope of the GNU Coding Standards.
 # Therefore, their names may contain '_' for distinction and clarity.
 localbindir     := $(prefix)/local/$(LMI_COMPILER)_$(LMI_TRIPLET)/bin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]