mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 01:43:35 +00:00
Enforce namespace cleanliness in the library and browser directories
Estimated hours taken: 6 Branches: main Enforce namespace cleanliness in the library and browser directories as well as in the runtime and trace directories. Mmake.common.in: Move the rules check_namespace here (they used to be in the Mmakefiles of the runtime and trace directories), together with the variables they need. Generalize them to also handle the needs of the browser, library and bytecode directories. The former two in particular need the ability to check automatically generated .mh files. Make all the rules used by check_namespace conditional on a macro that is defined by the Makefiles in all the directories that are checked for namespace cleanliness. trace/Mmakefile: runtime/Mmakefile: Replace the old rules for check_namespace, which are now in ../Mmake.common.in, with the macros needed to control their behavior. bytecode/Mmakefile: Add the macros needed to control the behavior of the rules for check_namespace. Move the lists of files to the start, before the include of ../Mmake.common. browser/Mmakefile: library/Mmakefile: Add the macros needed to control the behavior of the rules for check_namespace. runtime/RESERVED_MACRO_NAMES: Update comments, and delete obsolete exceptions. browser/RESERVED_MACRO_NAMES: library/RESERVED_MACRO_NAMES: New files to contain the exceptions from the naming scheme. tools/bootcheck: Invoke "mmake check_namespace" in the library and browser directories as well as the runtime and the trace directories. Perform the invocation before we delete the object files we are checking for cleanliness. Clean up object files in all stage2 directories, not just the library, as soon as we can. library/array.m: library/builtin.m: library/io.m: library/time.m: Fix namespace violations.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#-----------------------------------------------------------------------------#
|
||||
# Copyright (C) 1998-2001 The University of Melbourne.
|
||||
# Copyright (C) 1998-2002 The University of Melbourne.
|
||||
# This file may only be copied under the terms of the GNU General
|
||||
# Public License - see the file COPYING in the Mercury distribution.
|
||||
#-----------------------------------------------------------------------------#
|
||||
@@ -8,40 +8,6 @@
|
||||
|
||||
MAIN_TARGET=all
|
||||
|
||||
MERCURY_DIR=..
|
||||
include $(MERCURY_DIR)/Mmake.common
|
||||
-include ../Mmake.params
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
# NOTE: any library functions that called from bytecode must be compiled
|
||||
# with trace information. (So their entry labels can be looked up)
|
||||
#-----------------------------------------------------------------------------#
|
||||
|
||||
MERCURY_SYSTEM = \
|
||||
$(RUNTIME_DIR)/*.c $(RUNTIME_DIR)/*.h \
|
||||
$(RUNTIME_DIR)/machdeps/*.c $(RUNTIME_DIR)/machdeps/*.h\
|
||||
$(LIBRARY_DIR)/*.m \
|
||||
$(TRACE_DIR)/*.h $(TRACE_DIR)/*.c \
|
||||
$(BROWSER_DIR)/*.h $(BROWSER_DIR)/*.c \
|
||||
$(BOEHM_GC_DIR)/*.h $(BOEHM_GC_DIR)/include/*.h
|
||||
|
||||
MERCURY_INC = \
|
||||
-I$(LIBRARY_DIR) \
|
||||
-I$(RUNTIME_DIR) \
|
||||
-I$(BOEHM_GC_DIR) \
|
||||
-I$(BOEHM_GC_DIR)/include \
|
||||
-I$(TRACE_DIR)
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
|
||||
CFLAGS = $(MERCURY_INC) -DMR_BYTECODE_CALLABLE -g
|
||||
|
||||
MGNUCFLAGS-mb_disasm = --no-ansi
|
||||
|
||||
MCFLAGS = --trace shallow --generate-bytecode -O 0
|
||||
|
||||
MLFLAGS = --trace
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
# keep these lists in alphabetical order, please
|
||||
|
||||
@@ -83,6 +49,48 @@ MB_OBJS = $(MB_MFILES:%.m=%.o) $(MB_CFILES:%.c=%.o)
|
||||
|
||||
$(MB_OBJS): $(MB_HDRS)
|
||||
|
||||
# Specify which files to check for namespace cleanliness, and which name
|
||||
# prefixes are allowed.
|
||||
|
||||
CHECK_HDRS = $(MB_HDRS)
|
||||
CHECK_MHDRS =
|
||||
CHECK_OBJS = $(MB_OBJS)
|
||||
ALLOW_LIB_PREFIX=no
|
||||
ALLOW_BROWSER_PREFIX=no
|
||||
|
||||
MERCURY_DIR=..
|
||||
include $(MERCURY_DIR)/Mmake.common
|
||||
-include ../Mmake.params
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
# NOTE: any library functions that called from bytecode must be compiled
|
||||
# with trace information. (So their entry labels can be looked up)
|
||||
#-----------------------------------------------------------------------------#
|
||||
|
||||
MERCURY_SYSTEM = \
|
||||
$(RUNTIME_DIR)/*.c $(RUNTIME_DIR)/*.h \
|
||||
$(RUNTIME_DIR)/machdeps/*.c $(RUNTIME_DIR)/machdeps/*.h\
|
||||
$(LIBRARY_DIR)/*.m \
|
||||
$(TRACE_DIR)/*.h $(TRACE_DIR)/*.c \
|
||||
$(BROWSER_DIR)/*.h $(BROWSER_DIR)/*.c \
|
||||
$(BOEHM_GC_DIR)/*.h $(BOEHM_GC_DIR)/include/*.h
|
||||
|
||||
MERCURY_INC = \
|
||||
-I$(LIBRARY_DIR) \
|
||||
-I$(RUNTIME_DIR) \
|
||||
-I$(BOEHM_GC_DIR) \
|
||||
-I$(BOEHM_GC_DIR)/include \
|
||||
-I$(TRACE_DIR)
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
|
||||
CFLAGS = $(MERCURY_INC) -DMR_BYTECODE_CALLABLE -g
|
||||
|
||||
MGNUCFLAGS-mb_disasm = --no-ansi
|
||||
|
||||
MCFLAGS = --trace shallow --generate-bytecode -O 0
|
||||
|
||||
MLFLAGS = --trace
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
# The actual program (as distinct from bytecode interpreter)
|
||||
|
||||
Reference in New Issue
Block a user