Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH (?): Re: Makefiles are still rebuilt on 'make clean'



On May 30,  3:27pm, Andrej Borsenkow wrote:
} Subject: Makefiles are still rebuilt on 'make clean'
}
} Well, as in subject. make (real|dist|)clean will happily rebuild all
} Makefiles. I believe, it has been corrected at least once?

Do you get more things rebuilt than this?

[prep stuff deleted]
Updated `modules.index'.
cd .. && /bin/sh $top_srcdir/Src/mkmakemod.sh Src Makemod
creating Src/Makemod.in
creating Src/Makemod
echo 'timestamp for *.mdd files' > ../Src/modules.stamp
creating Src/Aliases/Makefile.in
creating Src/Aliases/Makefile
creating Src/Builtins/Makefile.in
creating Src/Builtins/Makefile
creating Src/Modules/Makefile.in
creating Src/Modules/Makefile
creating Src/Zle/Makefile.in
creating Src/Zle/Makefile
[call to "make -f Makemod" and "rm"s deleted]

Here's what's going on ...

The rule for `clean' has a dependency on `clean-modules', which has a
dependency on `modules.index'.

The rule for clean-modules tries to avoid building Makemod if it doesn't
already exist ... but the rule for modules.index unconditionally builds
Makemod, so the test in clean-modules is irrelevant: it always succeeds.

Further, the rule for modules.index invokes `make -f Makemod prep' which
is what rebuilds all the rest of the subdirectory Makefiles.

`clean' also has a dependency on `clean-here' which then removes both
modules.index and modules-bltin (on which modules.index depends), thus
guaranteeing that the whole process starts over at the top.  It does not
remove Makemod because of the clean-modules rule, but of course that is
already irrelevant.

Possible fixes are:

(1) Don't remove `modules.index' and `modules-bltin' under `clean-here'
    (instead do it under `distclean-here').  This will at least keep two
    consecutive `make clean' from rebuilding everything the second time.

(2) Rewrite the whole build system to avoid having Makefiles that build
    other Makefiles.  Makefiles ought to get built at configure time.

(I keep thinking of Rabbit and Winnie-the-Pooh:  "It all comes of eating
too much."  "It all comes of not having front doors big enough.")

Index: Src/Makefile.in
===================================================================
@@ -216,12 +216,12 @@
 
 clean-here:
 	rm -f modules.index.tmp modules.stamp zsh$(EXEEXT) ansi2knr.o ansi2knr
-	rm -f modules.index modules-bltin
 	rm -f libzsh-*.$(DL_EXT)
 .PHONY: clean-here
 
 distclean-here:
 	rm -f TAGS tags
+	rm -f modules.index modules-bltin
 	rm -f Makefile mymods.conf
 .PHONY: distclean-here
 

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author