for review: faster clean actions in .dep files
Zoltan Somogyi
zs at cs.mu.oz.au
Thu Jan 1 15:44:57 AEDT 1998
Fergus, please review this.
modules.m:
When creating .dep files, consolidate the action for the "mmake clean"
and similar targets into single invocations of rm. This greatly reduces
the number of processes that make will need to start, and thus should
speed up these actions (especially on WNT, where process creation is
slower than on Unix).
Zoltan.
Index: modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.45
diff -u -u -r1.45 modules.m
--- modules.m 1997/12/22 09:56:09 1.45
+++ modules.m 1997/12/30 09:15:45
@@ -961,7 +961,6 @@
io__write_strings(DepStream, [
ModuleName, ".check : $(", ModuleName, ".errs)\n\n",
-
ModuleName, ".ints : $(", ModuleName, ".dates)\n\n",
ModuleName, ".int3s : $(", ModuleName, ".date3s)\n\n",
ModuleName, ".opts : $(", ModuleName, ".optdates)\n\n"
@@ -973,32 +972,44 @@
io__write_strings(DepStream, [
ModuleName, ".clean :\n",
- "\t-rm -rf ", ModuleName, ".dir\n",
- "\t-rm -f $(", ModuleName, ".cs) ", ModuleName, "_init.c\n",
- "\t-rm -f $(", ModuleName, ".ss) ", ModuleName, "_init.s\n",
- "\t-rm -f $(", ModuleName, ".os) ", ModuleName, "_init.o\n",
- "\t-rm -f $(", ModuleName, ".nos)\n",
- "\t-rm -f $(", ModuleName, ".qls)\n",
- "\t-rm -f $(", ModuleName, ".errs)\n"
+ "\t-rm -rf ",
+ ModuleName, ".dir ",
+ "\\\n\t",
+ ModuleName, "_init.c ",
+ ModuleName, "_init.s ",
+ ModuleName, "_init.o ",
+ "\\\n\t",
+ "$(", ModuleName, ".cs) ",
+ "$(", ModuleName, ".ss) ",
+ "$(", ModuleName, ".os) ",
+ "\\\n\t",
+ "$(", ModuleName, ".nos) ",
+ "$(", ModuleName, ".qls) ",
+ "$(", ModuleName, ".errs)\n\n"
]),
- io__write_string(DepStream, "\n"),
-
io__write_strings(DepStream, [
ModuleName, ".change_clean :\n",
- "\t-rm -f $(", ModuleName, ".cs) ", ModuleName, "_init.c\n",
- "\t-rm -f $(", ModuleName, ".ss) ", ModuleName, "_init.s\n",
- "\t-rm -f $(", ModuleName, ".os) ", ModuleName, "_init.o\n",
- "\t-rm -f $(", ModuleName, ".hs)\n",
- "\t-rm -f $(", ModuleName, ".ds)\n",
"\t-rm -f ",
- ModuleName, " ",
- ModuleName, ".split ",
- ModuleName, ".split.a ",
- ModuleName, ".init ",
- "lib", ModuleName, ".a ",
- "lib", ModuleName, ".so ",
- ModuleName, ".dep\n\n"
+ ModuleName, "_init.c ",
+ ModuleName, "_init.s ",
+ ModuleName, "_init.o ",
+ "\\\n\t",
+ "$(", ModuleName, ".cs) ",
+ "$(", ModuleName, ".ss) ",
+ "$(", ModuleName, ".os) ",
+ "\\\n\t",
+ "$(", ModuleName, ".hs) ",
+ "$(", ModuleName, ".ds) ",
+ "\\\n\t",
+ ModuleName, ".split ",
+ ModuleName, ".split.a ",
+ ModuleName, ".init ",
+ "\\\n\t",
+ ModuleName, " ",
+ "lib", ModuleName, ".a ",
+ "lib", ModuleName, ".so ",
+ ModuleName, ".dep\n\n"
]),
io__write_strings(DepStream, [
@@ -1007,31 +1018,36 @@
io__write_strings(DepStream, [
ModuleName, ".realclean : ", ModuleName, ".clean\n",
- "\t-rm -f $(", ModuleName, ".dates)\n",
- "\t-rm -f $(", ModuleName, ".date3s)\n",
- "\t-rm -f $(", ModuleName, ".optdates)\n",
- "\t-rm -f $(", ModuleName, ".ints)\n",
- "\t-rm -f $(", ModuleName, ".int3s)\n",
- "\t-rm -f $(", ModuleName, ".opts)\n",
- "\t-rm -f $(", ModuleName, ".ds)\n",
- "\t-rm -f $(", ModuleName, ".hs)\n"
- ]),
- io__write_strings(DepStream, [
"\t-rm -f ",
- ModuleName, " ",
- ModuleName, ".split ",
- ModuleName, ".split.a ",
- ModuleName, ".init ",
- "lib", ModuleName, ".a ",
- "lib", ModuleName, ".so ",
- ModuleName, ".nu ",
- ModuleName, ".nu.save ",
- ModuleName, ".nu.debug.save ",
- ModuleName, ".nu.debug ",
- ModuleName, ".sicstus ",
- ModuleName, ".sicstus.debug ",
- ModuleName, ".dep\n\n"
+ "$(", ModuleName, ".dates) ",
+ "$(", ModuleName, ".date3s) ",
+ "$(", ModuleName, ".optdates) ",
+ "\\\n\t",
+ "$(", ModuleName, ".ints) ",
+ "$(", ModuleName, ".int3s) ",
+ "$(", ModuleName, ".opts) ",
+ "\\\n\t",
+ "$(", ModuleName, ".ds) ",
+ "$(", ModuleName, ".hs) ",
+ "\\\n\t",
+ ModuleName, ".split ",
+ ModuleName, ".split.a ",
+ ModuleName, ".init ",
+ "\\\n\t",
+ ModuleName, " ",
+ "lib", ModuleName, ".a ",
+ "lib", ModuleName, ".so ",
+ "\\\n\t",
+ ModuleName, ".nu ",
+ ModuleName, ".nu.save ",
+ ModuleName, ".nu.debug ",
+ ModuleName, ".nu.debug.save ",
+ "\\\n\t",
+ ModuleName, ".sicstus ",
+ ModuleName, ".sicstus.debug ",
+ ModuleName, ".dep\n\n"
]),
+
io__write_strings(DepStream, [
"clean_nu: ", ModuleName, ".clean_nu\n",
ModuleName, ".clean_nu :\n",
More information about the developers
mailing list