TOP=..
include $(TOP)/mk/boilerplate.mk
-SUBDIRS = base array packedstring containers bytestring
-SUBDIRS += old-locale old-time filepath directory
+SUBDIRS = ghc-prim $(INTEGER_LIBRARY) base array packedstring
+SUBDIRS += containers bytestring old-locale old-time filepath directory
ifeq "$(GhcLibsWithUnix)" "YES"
SUBDIRS += unix
endif
# We ought to be depending on %/Setup.*hs, but make makes that difficult.
+# -fffi is only needed for GHC 6.4 at the time of writing
+CABAL_GHC_FLAGS = -Wall -cpp -fffi
+
$(foreach SUBDIR,$(SUBDIRS),$(SUBDIR)/setup/Setup): \
%/setup/Setup: $(BOOTSTRAP_STAMPS)
-$(RM) -rf $*/setup
mkdir $*/setup
$(CP) $*/Setup.*hs $*/setup
- cd $*/setup && $(GHC) -Wall -cpp --make Setup.*hs -o Setup \
+ cd $*/setup && $(GHC) $(CABAL_GHC_FLAGS) --make Setup.*hs -o Setup \
$(BOOTSTRAP_INC_2_UP)
installPackage/installPackage: installPackage.hs $(BOOTSTRAP_STAMPS)
mkdir installPackage
$(CP) installPackage.hs installPackage/
ifeq "$(stage)" "2"
- cd installPackage && ../$(HC) -Wall -cpp \
+ cd installPackage && ../$(HC) $(CABAL_GHC_FLAGS) \
--make installPackage -o installPackage \
$(BOOTSTRAP_INC_1_UP) $(DEPLOYMENT_OPTS)
else
- cd installPackage && $(GHC) -Wall -cpp \
+ cd installPackage && $(GHC) $(CABAL_GHC_FLAGS) \
--make installPackage -o installPackage \
$(BOOTSTRAP_INC_1_UP)
endif
$(space)--configure-option=',\
$(space)$(CONFIGURE_ARGS))
-$(foreach SUBDIR,$(SUBDIRS), \
- stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).$(SUBDIR)): \
-stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).%: %/setup/Setup
- -$(RM) -f stamp/configure.library.*.$* $*/unbuildable
- ( cd $* && setup/Setup configure \
+ifeq "$(Windows)" "YES"
+NONEXISTENT=c:/NONEXISTENT
+else
+NONEXISTENT=/NONEXISTENT
+endif
+
+ALL_CONFIGURE_FLAGS = \
$(CONFIGURE_OPTS) \
- --prefix=/NONEXISTANT \
- --bindir=/NONEXISTANT \
- --libdir=/NONEXISTANT \
+ --prefix=$(NONEXISTENT) \
+ --bindir=$(NONEXISTENT) \
+ --libdir=$(NONEXISTENT) \
--libsubdir='$$pkgid' \
- --libexecdir=/NONEXISTANT \
- --datadir=/NONEXISTANT \
- --docdir=/NONEXISTANT \
- --haddockdir=/NONEXISTANT \
- --htmldir=/NONEXISTANT \
+ --libexecdir=$(NONEXISTENT) \
+ --datadir=$(NONEXISTENT) \
+ --docdir=$(NONEXISTENT) \
+ --haddockdir=$(NONEXISTENT) \
+ --htmldir=$(NONEXISTENT) \
--with-compiler=../../compiler/stage1/ghc-inplace \
--with-hc-pkg=../../utils/ghc-pkg/ghc-pkg-inplace \
--with-hsc2hs=../../utils/hsc2hs/hsc2hs-inplace \
--haddock-options="--use-contents=../index.html \
--use-index=../doc-index.html" \
$(FLAGGED_CONFIGURE_ARGS) \
- --configure-option=--with-cc=$(CC) ) \
+ --configure-option=--with-cc=$(CC)
+
+$(foreach SUBDIR,$(SUBDIRS), \
+ stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).$(SUBDIR)): \
+stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).%: %/setup/Setup
+ -$(RM) -f stamp/configure.library.*.$* $*/unbuildable
+ ( cd $* && setup/Setup configure $(ALL_CONFIGURE_FLAGS) ) \
&& touch $@ || touch $*/unbuildable
# We don't touch $@ if configure failed as we would prefer to try
# configuring it next time round, rather than assuming it'll still fail.
if ifBuildable/ifBuildable $*; then \
cd $* && \
setup/Setup build $(addprefix --ghc-option=,$(GhcLibHcOpts)); \
+ ../installPackage/installPackage register --inplace; \
fi
.PHONY: doc html
$(CABAL_HADDOCK_FLAGS); \
fi
ifneq "$(HSCOLOUR)" ""
- if ifBuildable/ifBuildable $*; then cp hscolour.css $*/dist/doc/html/$*/src/; fi
+# We use */src rather than $*/src due to the $(INTEGER_LIBRARY)/integer
+# mismatch
+ if ifBuildable/ifBuildable $*; then cp hscolour.css $*/dist/doc/html/*/src/; fi
endif
.PHONY: distclean clean clean.library.%