[m-dev.] rl_exprn doesn't compile without ADITI

Simon Taylor stayl at cs.mu.OZ.AU
Wed Jun 23 12:21:45 AEST 1999


 
I wrote:
> I've got a better fix bootstrapping now.
> I've also added some more comments to Mmake.common.in.

Estimated hours taken: 1

Mmake.common.in:
	Document that `mmake depend' needs to be run
	in the compiler directory if the setting
	of `INCLUDE_ADITI_OUTPUT' is changed.

compiler/Mmakefile:
	Change the action of `mmake depend' so that it always
	regenerates the `.m' files for which `.pp' files exist.

	Don't update the timestamp on a `.m' file if regenerating
	it does not change it.

tools/bootcheck:
	Link rather than copy `.pp' files now that reprocessing
	them is handled by `mmake depend'.

Index: Mmake.common.in
===================================================================
RCS file: /home/staff/zs/imp/mercury/Mmake.common.in,v
retrieving revision 1.37
diff -u -u -r1.37 Mmake.common.in
--- Mmake.common.in	1999/04/28 01:18:27	1.37
+++ Mmake.common.in	1999/06/23 02:11:08
@@ -186,6 +186,9 @@
 # To disable the Aditi support, put `INCLUDE_ADITI_OUTPUT = no'
 # in Mmake.stage.params. Do not put this into Mmake.params - we still
 # want to check that the Aditi code compiles after any changes.
+# `mmake depend' must be run in any compiler directories affected by
+# the changed value (tools/bootcheck will do this automatically for
+# the stage2 and stage3 directories). 
 INCLUDE_ADITI_OUTPUT = yes
 
 #-----------------------------------------------------------------------------#
Index: compiler/Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/Mmakefile,v
retrieving revision 1.19
diff -u -u -r1.19 Mmakefile
--- Mmakefile	1999/06/10 13:14:52	1.19
+++ Mmakefile	1999/06/23 02:07:11
@@ -54,30 +54,52 @@
 #-----------------------------------------------------------------------------#
 
 # Rules for preprocessing `.pp' files.
+# `.pp_date' files are used as timestamps as for interface files.
 
 ifeq ($(INCLUDE_ADITI_OUTPUT),yes)
 
 # Remove the #if line and everything between the #else and #endif lines.
-%.m: %.pp
-	@-[ ! -f $@ ] || chmod +w $@
+$(dates_subdir)%.pp_date: %.pp
+	m_file=$(<:.pp=.m); \
+	[ ! -f $$m_file ] || chmod +w $$m_file; \
 	sed	-e '/^#if *INCLUDE_ADITI_OUTPUT/s/.*//' \
 		-e '/^#else/,/^#endif/s/.*//' \
-		$< > $@
-	@-chmod -w $@
+		$< > $$m_file.tmp; \
+	mercury_update_interface -v $$m_file; \
+	touch $@; \
+	chmod -w $$m_file
 
 else
 
 # Remove everything between the #if line and the #else line,
 # and the #endif line.
-%.m: %.pp
-	@-[ ! -f $@ ] || chmod +w $@
+$(dates_subdir)%.pp_date: %.pp
+	m_file=$(<:.pp=.m); \
+	[ ! -f $$m_file ] || chmod +w $$m_file; \
 	sed	-e '/^#if *INCLUDE_ADITI_OUTPUT/,/^#else/s/.*//' \
 		-e '/^#endif/s/.*//' \
-		$< > $@
-	@-chmod -w $@
+		$< > $$m_file.tmp; \
+	mercury_update_interface -v $$m_file; \
+	touch $@; \
+	chmod -w $$m_file
 
 endif
 
+PREPROCESSED_MODULES = rl_file rl_out
+PREPROCESSED_FILES = $(PREPROCESSED_MODULES:%=%.pp)
+PREPROCESSED_M_FILES = $(PREPROCESSED_MODULES:%=%.m)
+PP_DATE_FILES = $(PREPROCESSED_MODULES:%=$(dates_subdir)%.pp_date)
+
+# Force regeneration of the preprocessed modules.
+# This is necessary if the setting of `INCLUDE_ADITI_OUTPUT' has changed.
+regenerate_preprocessed_files:
+	touch $(PREPROCESSED_FILES)
+	$(MMAKE) $(PREPROCESSED_M_FILES)
+
+# The `.m' files for the preprocessed modules depend on the `.pp_date' files.
+$(PREPROCESSED_M_FILES): %.m: $(dates_subdir)%.pp_date
+	@:
+
 #-----------------------------------------------------------------------------#
 
 # targets
@@ -87,9 +109,7 @@
 .PHONY: depend
 depend:		mercury_compile.depend
 
-# we need to make sure the .pp files get converted to .m before
-# we do the make depend
-mercury_compile.depend: rl_file.m rl_out.m
+mercury_compile.depend: regenerate_preprocessed_files
 
 .PHONY: all
 all:		mercury
@@ -151,7 +171,7 @@
 	done
 
 realclean:
-	rm -f tags mercury_compile.stats
+	rm -f tags mercury_compile.stats $(PP_DATE_FILES)
 
 #-----------------------------------------------------------------------------#
 #-----------------------------------------------------------------------------#
Index: tools/bootcheck
===================================================================
RCS file: /home/staff/zs/imp/mercury/tools/bootcheck,v
retrieving revision 1.81
diff -u -u -r1.81 bootcheck
--- bootcheck	1999/05/05 05:24:28	1.81
+++ bootcheck	1999/06/22 05:40:44
@@ -286,9 +286,7 @@
 	ln -s $root/compiler/[a-h]*.m .
 	ln -s $root/compiler/[i-s]*.m .
 	ln -s $root/compiler/[t-z]*.m .
-	# Make sure rl_out.m and rl_file.m are recreated with
-	# the value of INCLUDE_ADITI_OUTPUT in Mmake.stage.params.
-	cp $root/compiler/*.pp .
+	ln -s $root/compiler/*.pp .	
 
 	cp $root/compiler/Mmake* .
 	cd $root/stage2
@@ -489,9 +487,7 @@
 	ln -s $root/compiler/[a-h]*.m .
 	ln -s $root/compiler/[i-s]*.m .
 	ln -s $root/compiler/[t-z]*.m .
-	# Make sure rl_out.m and rl_file.m are recreated with
-	# the value of INCLUDE_ADITI_OUTPUT in Mmake.stage.params.
-	cp $root/compiler/*.pp .
+	ln -s $root/compiler/*.pp .	
 
 	cp $root/compiler/Mmake* .
 	cd $root/stage3
--------------------------------------------------------------------------
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