for review: avoid invoking mmake

Tyson Dowd trd at stimpy.cs.mu.oz.au
Thu Feb 12 18:11:42 AEDT 1998


Hi,

Someone want to look at this?

===================================================================


Estimated hours taken: 0.5

On some Linux boxes (e.g. mine), the invoking "mmake" in the compiler
directory has a 50 second startup time, due to all the file accesses. 
This adds about 1.5 hours to the compilation process.

"mmake" only needs to be invoked to if we want to remove .c files,
so the startup can be avoided by using more disk space.

scripts/Mmake.rules:
	If RM_C is set to ':' (that is, removal of .c files is turned
	off), we don't need to re-invoke "mmake" on each .c file,
	because we don't need to remove the intermediate .c files.
	We can also generate .pic_o files directly from .c files.

	


cvs server: Diffing scripts
Index: scripts/Mmake.rules
===================================================================
RCS file: /home/staff/zs/imp/mercury/scripts/Mmake.rules,v
retrieving revision 1.48
diff -u -r1.48 Mmake.rules
--- Mmake.rules	1998/01/25 16:24:41	1.48
+++ Mmake.rules	1998/02/12 06:59:21
@@ -113,8 +113,12 @@
 .c.o:
 	$(MGNUC) $(GRADEFLAGS) $(MGNUCFLAGS) -c $< -o $@
 
-# .c.pic_o:
-# 	$(MGNUC) $(GRADEFLAGS) $(MGNUCFLAGS) $(CFLAGS_FOR_PIC) -c $< -o $@
+# If we aren't removing the .c files, we generate .pic_o files
+# without invoking mmake.
+ifeq ($(RM_C),:)
+.c.pic_o:
+ 	$(MGNUC) $(GRADEFLAGS) $(MGNUCFLAGS) $(CFLAGS_FOR_PIC) -c $< -o $@
+endif
 
 .c.s:
 	$(MGNUC) $(GRADEFLAGS) $(MGNUCFLAGS) -S $< -o $@
@@ -125,6 +129,9 @@
 .c.i:
 	$(MGNUC) $(GRADEFLAGS) $(MGNUCFLAGS) -E $< > $@
 
+# If we aren't removing the .c files, we don't need to invoke mmake
+# for each .c file
+ifneq ($(RM_C),:)
 .m.o:
 	$(MMAKE_MAKE_CMD) $(MAKEOVERRIDES) $*.c
 	$(MGNUC) $(GRADEFLAGS) $(MGNUCFLAGS) -c $*.c -o $@
@@ -133,6 +140,7 @@
 .o.pic_o:
 	$(MMAKE_MAKE_CMD) $(MAKEOVERRIDES) $*.c
 	$(MGNUC) $(GRADEFLAGS) $(MGNUCFLAGS) $(CFLAGS_FOR_PIC) -c $*.c -o $@
+endif
 
 %.dir/*.o: %.m
 	rm -f $@




More information about the developers mailing list