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_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_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; \
......@@ -269,15 +276,6 @@ build.library.%: stamp/$(CONFIGURE_STAMP_EXTRAS).% \
setup/Setup build $(addprefix --ghc-option=,$(GhcLibHcOpts)); \
$(foreach SUBDIR,$(SUBDIRS),$(SUBDIR)/GNUmakefile):\
%/GNUmakefile: stamp/$(CONFIGURE_STAMP_EXTRAS).% \
%/setup/Setup ifBuildable/ifBuildable
$(RM) $*/GNUmakefile
cp Makefile.local $*
if ifBuildable/ifBuildable $*; then \
cd $* && setup/Setup makefile -f GNUmakefile; \
.PHONY: doc html
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