diff: Mmake.rules bug fix

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Jun 13 02:34:30 AEST 1998


Hmm, hope it works this time...

--------------------

scripts/Mmake.rules:
	Fix a bug or two introduced in my previous change:
	it turns out that making `%.depend' depend on `%.dep'
	doesn't work, because (a) GNU Make deletes the 
	"intermediate" .dep file after making it and
	(b) it won't remaking the `.dep' file if it already exists.
	So I when back to the old solution of code duplication,
	just adding a comment to warn about the duplication.

Index: scripts/Mmake.rules
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.rules,v
retrieving revision 1.62
diff -u -r1.62 Mmake.rules
--- Mmake.rules	1998/06/12 04:11:37	1.62
+++ Mmake.rules	1998/06/12 16:30:33
@@ -73,18 +73,27 @@
 # Rules for building dependency files
 #
 
-.PHONY: %.depend
-%.depend : $(deps_subdir)%.dep
-	@:
-
 # When creating the dependencies with `--use-subdirs' enabled,
-# we need to create the `Mercury/dates' directory manually
+# we need to create the `Mercury/dates' directories manually
 # in order to get things started.  This should not be necessary,
 # but there is a bug in GNU Make with regard to directory caching.
 # I have sent off a bug report to the GNU Make maintainers (19 March 1998).
 #	-fjh.
 
+# beware the code for `%.depend' and `%.dep' is duplicated
 $(deps_subdir)%.dep:
+	$(MCD) $(MCDFLAGS) $*
+ifeq ($(MMAKE_USE_SUBDIRS),yes)
+	# the following mkdirs work around a bug in GNU Make
+	-[ -d Mercury/dates ] || mkdir Mercury/dates
+	-[ -d Mercury/date0s ] || mkdir Mercury/date0s
+	-[ -d Mercury/date3s ] || mkdir Mercury/date3s
+	-[ -d Mercury/optdates ] || mkdir Mercury/optdates
+endif
+
+# beware the code for `%.depend' and `%.dep' is duplicated
+.PHONY: %.depend
+%.depend :
 	$(MCD) $(MCDFLAGS) $*
 ifeq ($(MMAKE_USE_SUBDIRS),yes)
 	# the following mkdirs work around a bug in GNU Make

-- 
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.



More information about the developers mailing list