[m-dev.] For review: fix an alt install dir annoyance
Warwick Harvey
wharvey at cs.monash.edu.au
Fri Jan 7 16:30:31 AEDT 2000
This change fixes an annoyance if one has a module which gets installed into
a directory hierarchy from which it also imports modules. There are some
other bugs/missing features with the alternative installation hierarchy
stuff which I expect to be posting fixes for in the near future, now that
it has finally made it into the HAL version of Mercury and I can start using
it on real examples. (I'm in the process of trying to break our dependence
on the alias branch, so we can track main branch changes more easily.)
Estimated hours taken: 4
Added some extra dependencies to the generated `.d' files, so that local
`.int', `.opt', etc. files shadow the installed versions properly (e.g. for
when you're trying to build a new version of an already installed library).
This saves the user from having to add these explicitly if they have
multiple libraries installed in the same installation hierarchy which
aren't independent (e.g. one uses another).
(In theory, perhaps this change shouldn't be needed; however, Make has a
habit of ignoring pattern rules whenever it feels like it.)
compiler/modules.m:
Generate the extra dependencies when writing `.d' files.
scripts/Mmake.rules:
Deleted some obsoleted dependency rules.
Index: compiler/modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.113
diff -u -r1.113 modules.m
--- compiler/modules.m 1999/12/03 12:51:59 1.113
+++ compiler/modules.m 2000/01/07 05:04:28
@@ -1674,6 +1674,37 @@
SourceFileName, "\n"
]),
+ module_name_to_file_name(ModuleName, ".int0", no,
+ Int0FileName),
+ module_name_to_file_name(ModuleName, ".int", no,
+ IntFileName),
+ module_name_to_file_name(ModuleName, ".int2", no,
+ Int2FileName),
+ module_name_to_file_name(ModuleName, ".int3", no,
+ Int3FileName),
+ module_name_to_file_name(ModuleName, ".opt", no,
+ OptFileName),
+ module_name_to_file_name(ModuleName, ".trans_opt", no,
+ TransOptFileName),
+ module_name_to_file_name(ModuleName, ".date3", no,
+ Date3FileName),
+
+ io__write_strings(DepStream, [
+ "\n",
+ Int0FileName, " : ", Date0FileName, "\n",
+ "\t@:\n",
+ IntFileName, " : ", DateFileName, "\n",
+ "\t@:\n",
+ Int2FileName, " : ", DateFileName, "\n",
+ "\t@:\n",
+ Int3FileName, " : ", Date3FileName, "\n",
+ "\t@:\n",
+ OptFileName, " : ", OptDateFileName, "\n",
+ "\t@:\n",
+ TransOptFileName, " : ", TransOptDateFileName, "\n",
+ "\t@:\n"
+ ]),
+
module_name_to_file_name(ModuleName, ".m", no,
ExpectedSourceFileName),
( { SourceFileName \= ExpectedSourceFileName } ->
@@ -1696,8 +1727,6 @@
% changes to scripts/Mmake.rules. See that
% file for documentation on these rules.
%
- module_name_to_file_name(ModuleName, ".date3", no,
- Date3FileName),
io__write_strings(DepStream, [
"\n",
Date0FileName, " : ", SourceFileName, "\n",
Index: scripts/Mmake.rules
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.rules,v
retrieving revision 1.73
diff -u -r1.73 Mmake.rules
--- scripts/Mmake.rules 1999/10/25 14:26:56 1.73
+++ scripts/Mmake.rules 2000/01/07 05:04:32
@@ -136,30 +136,6 @@
$(trans_opt_dates_subdir)%.trans_opt_date : %.m
$(MCTOI) $(ALL_MCTOIFLAGS) $<
-# Be very careful about changing the following rules.
-# The `@:' is a silent do-nothing command.
-# It is used to force GNU Make to recheck the timestamp
-# on the target file. (It is a pity that GNU Make doesn't
-# have a way of handling these sorts of rules in a nicer manner.)
-
-$(int0s_subdir)%.int0 : $(date0s_subdir)%.date0
- @:
-
-$(ints_subdir)%.int : $(dates_subdir)%.date
- @:
-
-$(int2s_subdir)%.int2 : $(dates_subdir)%.date
- @:
-
-$(int3s_subdir)%.int3 : $(date3s_subdir)%.date3
- @:
-
-$(opts_subdir)%.opt : $(optdates_subdir)%.optdate
- @:
-
-$(trans_opts_subdir)%.trans_opt : $(trans_opt_dates_subdir)%.trans_opt_date
- @:
-
#-----------------------------------------------------------------------------#
#
# Rules for compiling Mercury source files
--------------------------------------------------------------------------
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