[m-rev.] trivial diff: fix `mmc --make module.depend' bug

Simon Taylor stayl at cs.mu.OZ.AU
Thu May 2 03:09:37 AEST 2002



Estimated hours taken: 0.25
Branches: main

compiler/make.m:
	Check for `.depend' targets (which are ignored) before other targets.
	Given a target `module.depend', `mmc --make' was attempting to build 
	an executable `module.depend'.

Index: make.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/make.m,v
retrieving revision 1.3
diff -u -u -r1.3 make.m
--- make.m	20 Mar 2002 12:36:36 -0000	1.3
+++ make.m	1 May 2002 17:04:59 -0000
@@ -251,6 +251,18 @@
 	    (pred(TargetStr::in, Success0::out,
 	    		Info0::in, Info::out, di, uo) is det -->	
 		(
+			% Accept and ignore `.depend' targets.
+			% `mmc --make' does not need a separate
+			% make depend step. The dependencies for
+			% each module are regenerated on demand.
+			{ string__length(TargetStr, NameLength) },
+			{ search_backwards_for_dot(TargetStr,
+				NameLength - 1, DotLocn) },
+			{ string__split(TargetStr, DotLocn, _, ".depend") }
+		->
+			{ Success0 = yes },
+			{ Info = Info0 }
+		;
 			{ target_file(Globals, TargetStr,
 				ModuleName, TargetType) }
 		->
@@ -269,18 +281,6 @@
 			    make_misc_target(ModuleName - MiscTargetType,
 			    	Success0, Info0, Info)
 			)
-		;
-			% Accept and ignore `.depend' targets.
-			% `mmc --make' does not need a separate
-			% make depend step. The dependencies for
-			% each module are regenerated on demand.
-			{ string__length(TargetStr, NameLength) },
-			{ search_backwards_for_dot(TargetStr,
-				NameLength - 1, DotLocn) },
-			{ string__split(TargetStr, DotLocn, _, ".depend") }
-		->
-			{ Success0 = yes },
-			{ Info = Info0 }
 		;
 			{ Info = Info0 },
 			{ Success0 = no },
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list