From f6f3bbf63e505ab2a068a7603eec7c8564317bab Mon Sep 17 00:00:00 2001 From: Peter Wang Date: Tue, 17 Oct 2023 11:39:01 +1100 Subject: [PATCH] Fix undefined variable warning about MERC_INT_DIR. GNU Make 4.4 reports undefined variable warnings about MERC_INT_DIR. The problem is related to MERC_INT_DIR being referenced in a $(shell ...) command, but being defined later. scripts/Mmake.vars.in: Move the definition of MERC_INT_DIR to Mmake.vars, before its reference in MERC_INT_DIR_FOR_VPATH. scripts/Mmake.rules: Delete definition of MERC_INT_DIR from Mmake.rules. --- scripts/Mmake.rules | 12 ------------ scripts/Mmake.vars.in | 8 ++++++++ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/scripts/Mmake.rules b/scripts/Mmake.rules index 9f1c72e4a..4d7054380 100644 --- a/scripts/Mmake.rules +++ b/scripts/Mmake.rules @@ -43,18 +43,6 @@ ALL_MGNUCFLAGS += -I. -I$(mihs_subdir). endif -#-----------------------------------------------------------------------------# -# -# Find the directory containing the interface files for the standard library. -# - -ifdef MERCURY_STDLIB_DIR - export MERCURY_STDLIB_DIR - MERC_INT_DIR = $(MERCURY_STDLIB_DIR)/ints -else - MERC_INT_DIR = -endif - #-----------------------------------------------------------------------------# .PRECIOUS: $(date0s_subdir)%.date0 diff --git a/scripts/Mmake.vars.in b/scripts/Mmake.vars.in index d07e9dc31..0eca0f257 100644 --- a/scripts/Mmake.vars.in +++ b/scripts/Mmake.vars.in @@ -15,6 +15,14 @@ # Ensure that commands use /bin/sh not the user's shell SHELL = /bin/sh +# The directory containing the interface files for the standard library. +ifdef MERCURY_STDLIB_DIR + export MERCURY_STDLIB_DIR + MERC_INT_DIR = $(MERCURY_STDLIB_DIR)/ints +else + MERC_INT_DIR = +endif + ALL_EXTRA_LIBRARIES = $(TARGET_EXTRA_LIBRARIES) $(EXTRA_LIBRARIES) EXTRA_LIB_DIRS = EXTRA_LIBRARIES =