Commit 5ca2e94e authored by Simon Marlow's avatar Simon Marlow
Browse files

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.
parent 4899a56b
...@@ -250,12 +250,19 @@ stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).%: %/setup/Setup ...@@ -250,12 +250,19 @@ stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).%: %/setup/Setup
# build dies! # build dies!
# Build the library using 'make' # 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)):\ $(foreach SUBDIR,$(SUBDIRS),make.library.$(SUBDIR)):\
make.library.%: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \ make.library.%: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \
%/GNUmakefile \
%/setup/Setup ifBuildable/ifBuildable %/setup/Setup ifBuildable/ifBuildable
if ifBuildable/ifBuildable $*; then \ if ifBuildable/ifBuildable $*; then \
cd $* && \ 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) && \ $(MAKE) $(MFLAGS) && \
setup/Setup register --inplace; \ setup/Setup register --inplace; \
fi fi
...@@ -269,15 +276,6 @@ build.library.%: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \ ...@@ -269,15 +276,6 @@ build.library.%: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \
setup/Setup build $(addprefix --ghc-option=,$(GhcLibHcOpts)); \ setup/Setup build $(addprefix --ghc-option=,$(GhcLibHcOpts)); \
fi 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 .PHONY: doc html
html: doc html: doc
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment