From 5ca2e94ede1ff4ef411ebf060aa91845a03414ee Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 20 Nov 2007 10:33:29 +0000 Subject: [PATCH] Always do 'setup makefile' before building each library This forces preprocessing to happen, which is necessary if any of the .hsc files have been modified. Without this change, a 'setup makefile' would be required by hand after a .hsc file changed. Fortunately 'setup makefile' isn't much extra work, and I've made it not overwrite GNUmakefile if it hasn't changed, which avoids recalculating the dependencies each time. --- libraries/Makefile | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/libraries/Makefile b/libraries/Makefile index ea574e1..7cf8238 100644 --- a/libraries/Makefile +++ b/libraries/Makefile @@ -250,12 +250,19 @@ stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).%: %/setup/Setup # build dies! # Build the library using 'make' +# We re-run 'setup makefile' each time, just in case any preprocessing +# needs to be done. However, we're careful not to overwrite GNUmakefile +# if it hasn't changed, so that dependency-generation isn't forced +# every time. $(foreach SUBDIR,$(SUBDIRS),make.library.$(SUBDIR)):\ make.library.%: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \ - %/GNUmakefile \ %/setup/Setup ifBuildable/ifBuildable if ifBuildable/ifBuildable $*; then \ cd $* && \ + cmp -s ../Makefile.local Makefile.local || cp ../Makefile.local .; \ + mv GNUmakefile GNUmakefile.tmp; \ + setup/Setup makefile -f GNUmakefile; \ + cmp -s GNUmakefile GNUmakefile.tmp && mv GNUmakefile.tmp GNUmakefile; \ $(MAKE) $(MFLAGS) && \ setup/Setup register --inplace; \ fi @@ -269,15 +276,6 @@ build.library.%: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \ setup/Setup build $(addprefix --ghc-option=,$(GhcLibHcOpts)); \ fi -$(foreach SUBDIR,$(SUBDIRS),$(SUBDIR)/GNUmakefile):\ -%/GNUmakefile: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \ - %/setup/Setup ifBuildable/ifBuildable - $(RM) $*/GNUmakefile - cp Makefile.local $* - if ifBuildable/ifBuildable $*; then \ - cd $* && setup/Setup makefile -f GNUmakefile; \ - fi - .PHONY: doc html html: doc -- 1.7.10.4