[m-dev.] diff: clean up uses of $(EXTRA_*) in Mmakefiles

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Jun 1 18:13:52 AEST 1999


Estimated hours taken: 1

browser/Mmakefile:
compiler/Mmakefile:
library/Mmakefile:
profiler/Mmakefile:
runtime/Mmakefile:
trace/Mmakefile:
util/Mmakefile:
	Simplify the code by deleting unnecessary uses of $(EXTRA_*), etc.
	This is now handled once and for all in scripts/Mmake.vars, and
	so it doesn't need to be separately handled by */Mmakefile.
	This patch also fixes an annoyance where if you set EXTRA_CFLAGS,
	the flags that you set were being passed to mgnuc twice.

Workspace: /home/mercury0/fjh/mercury-other
Index: browser/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/Mmakefile,v
retrieving revision 1.4
diff -u -r1.4 Mmakefile
--- Mmakefile	1999/04/08 12:57:48	1.4
+++ Mmakefile	1999/04/14 17:16:58
@@ -51,7 +51,7 @@
 MCG	=	$(M_ENV) $(MC) --compile-to-c
 MCS	=	$(M_ENV) $(MC) --split-c-files -c --cflags "$(ALL_CFLAGS)"
 MGNUC	=	$(M_ENV) $(SCRIPTS_DIR)/mgnuc
-MGNUCFLAGS =	$(EXTRA_MGNUCFLAGS) $(DLL_CFLAGS) $(EXTRA_CFLAGS)
+MGNUCFLAGS =	$(DLL_CFLAGS)
 LDFLAGS	=	-L$(LIBRARY_DIR) -L$(RUNTIME_DIR) -L$(BOEHM_GC_DIR)
 LDLIBS	=	-l$(STD_LIB_NAME) -l$(RT_LIB_NAME) \
 		` case "$(GRADE)" in 					\
Index: compiler/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Mmakefile,v
retrieving revision 1.17
diff -u -r1.17 Mmakefile
--- Mmakefile	1999/04/28 01:18:34	1.17
+++ Mmakefile	1999/06/01 08:06:15
@@ -35,13 +35,11 @@
 MCG	=	$(M_ENV) $(MC) --compile-to-c
 MCS	=	$(M_ENV) $(MC) --split-c-files -c --cflags $(ALL_CFLAGS)
 MGNUC	=	$(M_ENV) $(SCRIPTS_DIR)/mgnuc
-MGNUCFLAGS =	$(EXTRA_MGNUCFLAGS) $(EXTRA_CFLAGS)
 C2INIT =	MERCURY_MOD_LIB_MODS="$(BROWSER_DIR)/$(BROWSER_LIB_NAME).init $(LIBRARY_DIR)/$(STD_LIB_NAME).init $(RUNTIME_DIR)/$(RT_LIB_NAME).init" \
 		MERCURY_MKINIT=$(UTIL_DIR)/mkinit $(SCRIPTS_DIR)/c2init
 ML	=	MERCURY_C_LIB_DIR=. $(SCRIPTS_DIR)/ml
-MLFLAGS =	--mercury-libs none $(EXTRA_MLFLAGS)
-MLLIBS  =	$(EXTRA_MLLIBS) \
-		$(TRACE_DIR)/lib$(TRACE_LIB_NAME).a \
+MLFLAGS =	--mercury-libs none
+MLLIBS  =	$(TRACE_DIR)/lib$(TRACE_LIB_NAME).a \
 		$(BROWSER_DIR)/lib$(BROWSER_LIB_NAME).a \
 		$(LIBRARY_DIR)/lib$(STD_LIB_NAME).a \
 		$(RUNTIME_DIR)/lib$(RT_LIB_NAME).a ` \
Index: library/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/library/Mmakefile,v
retrieving revision 1.38
diff -u -r1.38 Mmakefile
--- Mmakefile	1999/04/30 06:21:00	1.38
+++ Mmakefile	1999/06/01 07:16:37
@@ -67,14 +67,16 @@
 MCS	=	$(M_ENV) $(MC) --split-c-files -c --cflags "$(ALL_CFLAGS)" \
 			$(INTERMODULE_OPTS) $(CHECK_TERM_OPTS)
 MGNUC	=	$(M_ENV) $(SCRIPTS_DIR)/mgnuc
-MGNUCFLAGS =	$(EXTRA_MGNUCFLAGS) $(DLL_CFLAGS) $(EXTRA_CFLAGS)
+MGNUCFLAGS =	$(DLL_CFLAGS)
 LDFLAGS	=	-L$(BOEHM_GC_DIR) -L$(RUNTIME_DIR)
+ALL_LDFLAGS =	$(LDFLAGS) $(EXTRA_LDFLAGS)
 LDLIBS	=	-l$(RT_LIB_NAME) \
 		` case "$(GRADE)" in 					\
 		    *.gc*.prof*) echo "-lgc_prof" ;;			\
 		    *.gc*)	 echo "-lgc" ;;				\
 		  esac							\
 		`
+ALL_LDLIBS =	$(LDLIBS) $(EXTRA_LDLIBS)
 
 MTAGS	=	$(SCRIPTS_DIR)/mtags
 
@@ -178,7 +180,7 @@
 lib$(STD_LIB_NAME).so : $(library.pic_os)
 	$(LINK_SHARED_OBJ) -o lib$(STD_LIB_NAME).so $(library.pic_os)	\
 		$(RPATH_1)$(RPATH_2)					\
-		$(LDFLAGS) $(LDLIBS)					\
+		$(ALL_LDFLAGS) $(ALL_LDLIBS)				\
 		$(SHARED_LIBS)
 
 $(STD_LIB_NAME).init: $(deps_subdir)library.dep
Index: profiler/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/profiler/Mmakefile,v
retrieving revision 1.10
diff -u -r1.10 Mmakefile
--- Mmakefile	1999/04/08 12:58:09	1.10
+++ Mmakefile	1999/06/01 07:23:34
@@ -35,13 +35,11 @@
 MCG	=	$(M_ENV) $(MC) --compile-to-c
 MCS	=	$(M_ENV) $(MC) --split-c-files -c --cflags "$(ALL_CFLAGS)"
 MGNUC	=	$(M_ENV) $(SCRIPTS_DIR)/mgnuc
-MGNUCFLAGS =	$(EXTRA_MGNUCFLAGS) $(EXTRA_CFLAGS)
 C2INIT	=	MERCURY_MOD_LIB_MODS="$(BROWSER_DIR)/$(BROWSER_LIB_NAME).init $(LIBRARY_DIR)/$(STD_LIB_NAME).init $(RUNTIME_DIR)/$(RT_LIB_NAME).init" \
                 MERCURY_MKINIT=$(UTIL_DIR)/mkinit $(SCRIPTS_DIR)/c2init
 ML	=	MERCURY_C_LIB_DIR=. $(SCRIPTS_DIR)/ml
-MLFLAGS =	--mercury-libs none $(EXTRA_MLFLAGS)
-MLLIBS  =	$(EXTRA_MLLIBS) \
-		$(TRACE_DIR)/lib$(TRACE_LIB_NAME).a \
+MLFLAGS =	--mercury-libs none
+MLLIBS  =	$(TRACE_DIR)/lib$(TRACE_LIB_NAME).a \
 		$(BROWSER_DIR)/lib$(BROWSER_LIB_NAME).a \
 		$(LIBRARY_DIR)/lib$(STD_LIB_NAME).a \
 		$(RUNTIME_DIR)/lib$(RT_LIB_NAME).a ` \
Index: runtime/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/Mmakefile,v
retrieving revision 1.47
diff -u -r1.47 Mmakefile
--- Mmakefile	1999/04/20 11:48:11	1.47
+++ Mmakefile	1999/06/01 08:12:23
@@ -13,14 +13,14 @@
 
 #-----------------------------------------------------------------------------#
 
-CFLAGS		= -g $(DLL_CFLAGS) $(EXTRA_CFLAGS)
+CFLAGS		= -g $(DLL_CFLAGS)
 MGNUC		= MERCURY_ALL_C_INCL_DIRS=" \
 			-I$(RUNTIME_DIR) \
 			-I$(BOEHM_GC_DIR) \
 			-I$(BOEHM_GC_DIR)/include \
 			" \
 		  $(SCRIPTS_DIR)/mgnuc 
-MGNUCFLAGS	= --no-ansi $(EXTRA_MGNUCFLAGS) $(CFLAGS)
+MGNUCFLAGS	= --no-ansi
 MOD2C		= $(SCRIPTS_DIR)/mod2c
 
 #-----------------------------------------------------------------------------#
Index: trace/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/Mmakefile,v
retrieving revision 1.10
diff -u -r1.10 Mmakefile
--- Mmakefile	1999/05/27 01:01:32	1.10
+++ Mmakefile	1999/06/01 08:12:44
@@ -21,7 +21,7 @@
 			-I$(BOEHM_GC_DIR) \
 			-I$(BOEHM_GC_DIR)/include \
 		  "
-CFLAGS		= -g $(DLL_CFLAGS) $(EXTRA_CFLAGS)
+CFLAGS		= -g $(DLL_CFLAGS)
 MGNUC		= $(M_ENV) $(SCRIPTS_DIR)/mgnuc
 MGNUCFLAGS	= --no-ansi
 
Index: util/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/util/Mmakefile,v
retrieving revision 1.4
diff -u -r1.4 Mmakefile
--- Mmakefile	1998/10/16 06:20:26	1.4
+++ Mmakefile	1999/03/25 15:11:02
@@ -16,8 +16,8 @@
 #-----------------------------------------------------------------------------#
 
 MGNUC   = MERCURY_C_INCL_DIR=$(RUNTIME_DIR) $(SCRIPTS_DIR)/mgnuc
-CFLAGS	= -I$(RUNTIME_DIR) $(EXTRA_CFLAGS) -O0
-# we need -I ../runtime for "mercury_getopt.h"
+CFLAGS	= -I$(RUNTIME_DIR) -O0
+# we need -I ../runtime for "mercury_std.h", etc.
 # the -O0 is to get around a stupid compiler bug in gcc 2.7.2.3 on cyclone
 
 PROGS=mkinit mdemangle info_to_mdb
@@ -27,7 +27,7 @@
 all:	$(PROGS)
 
 .c:
-	$(MGNUC) --grade $(GRADE) $(CFLAGS) -o $@ $<
+	$(MGNUC) $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -o $@ $<
 
 #-----------------------------------------------------------------------------#
 
-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list