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.
This commit is contained in:
Peter Wang
2023-10-17 11:39:01 +11:00
parent 8a06c176b4
commit f6f3bbf63e
2 changed files with 8 additions and 12 deletions

View File

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

View File

@@ -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 =