[m-dev.] diff: GCC back-end: clean up gcc/mercury/Mmakefile

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Jan 31 01:15:22 AEDT 2001


Estimated hours taken: 0.5

gcc/mercury/Mmakefile:
	Update to reflect recent improvements in Mmake support for the
	GCC back-end interface.
	Add some comments.

Index: Mmakefile
===================================================================
RCS file: /home/mercury1/repository/gcc/mercury/Mmakefile,v
retrieving revision 1.3
diff -u -d -u -r1.3 Mmakefile
--- Mmakefile	2001/01/17 02:45:43	1.3
+++ Mmakefile	2001/01/30 14:10:40
@@ -1,39 +1,56 @@
-# RM_C = echo
-# MCFLAGS = --target asm
-MCFLAGS = --no-line-numbers
-
-hello.cs =
-calculator.cs =
-tak.cs =
-query.cs =
-queens.cs =
-c.cs =
-eliza.cs =
-interpreter.cs =
+# This Mmakefile is used to do some simple-minded testing.
 
+# Compile Mercury code via asm
 GRADE = hlc.gc
+TARGET_ASM = yes
+ASM_OPT = --target asm
 
+# Make the generated code more readable
+MCFLAGS = --no-line-numbers
 
+# Specify which gcc driver to use
 GCC = ../xgcc -B../
 CC = $(GCC)
 
-# GMCFLAGS = -O2 -fomit-frame-pointer
-GMCFLAGS = --mmc-flag=-I../../mercury/library
-GMCFLAGS += -save-temps -g
-CFLAGS += -save-temps -g
-GMCFLAGS += --mmc-flag=-O0 --mmc-flag=--no-static-ground-terms
-MCFLAGS += -O0 --no-static-ground-terms
-MLFLAGS = -g
-MGNUCFLAGS = -v --no-c-optimize
+# This variable contains options to pass to the 
+# gcc driver when compiling Mercury
+GMCFLAGS =
+
+# Specify where to find the Mercury library
+GMCFLAGS += --mmc-flag=-I../../mercury/library
 
+# Enable GCC optimization
+MGNUCFLAGS =
+GMCFLAGS += -O2 -fomit-frame-pointer
+
+# Disable GCC optimization
+# MGNUCFLAGS = -v --no-c-optimize
+
+# Enable GCC debugging
+# GMCFLAGS += -g
+# CFLAGS += -g
+# MLFLAGS = -g
+
+# Enable Mercury optimization
+GMCFLAGS += --mmc-flag=-O2
+
+# Disable Mercury optimization
+# GMCFLAGS += --mmc-flag=-O0 --mmc-flag=--no-static-ground-terms
+# MCFLAGS += -O0 --no-static-ground-terms
+
+# Enable Mercury type/mode/determinism inference
 GMCFLAGS += --mmc-flag=--infer-all
 MCFLAGS += --infer-all
 
-%.o : %.m ../mercury1 Mmakefile
-	$(GCC) -x mercury $(GMCFLAGS) -c $<
+#%.o : %.m ../mercury1 Mmakefile
+#$(GCC) -x mercury $(GMCFLAGS) -c $<
 
 %.s : %.m ../mercury1 Mmakefile
 	$(GCC) -x mercury $(GMCFLAGS) -S $<
 
-%.s0 : %.c
-	MERCURY_C_COMPILER="$(CC)" $(MGNUC) $(ALL_GRADEFLAGS) $(ALL_MGNUCFLAGS) -S $< -o $@
+%.c0: %.m
+	$(MCG) $(USUAL_GRADEFLAGS) $(ALL_MCGFLAGS) $<
+	mv $*.c $*.c0
+
+%.s0 : %.c0
+	MERCURY_C_COMPILER="$(CC)" $(MGNUC) $(ALL_GRADEFLAGS) $(ALL_MGNUCFLAGS) -x c -S $< -o $@

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- 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