# -----------------------------------------------------------------------------
# Include subsidiary build-system bits
+ifneq "$(findstring clean,$(MAKECMDGOALS))" ""
+-include mk/config.mk
+else
include mk/config.mk
-
ifeq "$(ProjectVersion)" ""
$(error Please run ./configure first)
endif
+endif
# (Optional) build-specific configuration
include mk/custom-settings.mk
+ifeq "$(findstring clean,$(MAKECMDGOALS))" ""
ifeq "$(GhcLibWays)" ""
$(error $$(GhcLibWays) is empty, it must contain at least one way)
endif
+endif
# -----------------------------------------------------------------------------
# Macros for standard targets
PACKAGES += haskeline
-ifneq "$(wildcard libraries/dph)" ""
PACKAGES_STAGE2 += \
dph/dph-base \
dph/dph-prim-interface \
dph/dph-prim-par \
dph/dph-seq \
dph/dph-par
-endif
BOOT_PKGS = Cabal hpc extensible-exceptions
utils/haddock/doc \
$(patsubst %, libraries/%, $(PACKAGES)) \
$(patsubst %, libraries/%, $(PACKAGES_STAGE2)) \
+ libraries/dph \
compiler \
$(GHC_HSC2HS_DIR) \
$(GHC_PKG_DIR) \
- utils/hasktags \
utils/hpc \
utils/runghc \
ghc
utils/haddock_dist_DISABLE = YES
utils/runghc_dist_DISABLE = YES
utils/hpc_dist_DISABLE = YES
-utils/hasktags_dist_DISABLE = YES
utils/hsc2hs_dist-install_DISABLE = YES
utils/ghc-pkg_dist-install_DISABLE = YES
compiler_stage2_DISABLE = YES
libraries/$(lib)_dist-install_DISABLE = YES))
endif
-ifneq "$(wildcard libraries/dph)" ""
-include libraries/dph/ghc.mk
-endif
include $(patsubst %, %/ghc.mk, $(BUILD_DIRS))
# We need -fno-warn-deprecated-flags to avoid failure with -Werror
ifneq "$(BINDIST)" "YES"
+ifneq "$(BOOTSTRAPPING_CONF)" ""
ifeq "$(wildcard $(BOOTSTRAPPING_CONF))" ""
$(shell echo "[]" >$(BOOTSTRAPPING_CONF))
endif
+endif
$(eval $(call clean-target,$(BOOTSTRAPPING_CONF),,$(BOOTSTRAPPING_CONF)))
aclocal.m4 README ANNOUNCE HACKING LICENSE Makefile install-sh \
ghc.spec.in ghc.spec extra-gcc-opts.in VERSION boot ghc.mk
-EXTRA_LIBS=$(patsubst %, $(SRC_DIST_NAME)/%, $(shell grep -E "extralibs|dph" packages | grep -v "^\#" | sed "s/ .*//"))
-
SRC_DIST_TARBALL = ghc-$(ProjectVersion)-src.tar.bz2
-SRC_DIST_EXTRALIBS_TARBALL = ghc-$(ProjectVersion)-src-extralibs.tar.bz2
VERSION :
echo $(ProjectVersion) >VERSION
.PHONY: sdist
sdist : sdist-prep
- $(TAR) chf - $(EXTRA_LIBS) | bzip2 >$(TOP)/$(SRC_DIST_EXTRALIBS_TARBALL)
- $(RM) -rf $(EXTRA_LIBS)
$(TAR) chf - $(SRC_DIST_NAME) 2>$src_log | bzip2 >$(TOP)/$(SRC_DIST_TARBALL)
sdist-manifest : $(SRC_DIST_TARBALL)
# over SSH.
ifneq "$(PublishLocation)" ""
publish-sdist :
- $(call nTimes,10,$(PublishCp) $(SRC_DIST_EXTRALIBS_TARBALL) $(PublishLocation)/dist)
$(call nTimes,10,$(PublishCp) $(SRC_DIST_TARBALL) $(PublishLocation)/dist)
endif
$(RM) configure mk/config.h.in
$(RM) -r autom4te.cache libraries/*/autom4te.cache
$(RM) ghc.spec
- $(RM) libraries/*/GNUmakefile libraries/*/ghc.mk libraries/*/configure
+ $(RM) $(patsubst %, libraries/%/GNUmakefile, \
+ $(PACKAGES) $(PACKAGES_STAGE2))
+ $(RM) $(patsubst %, libraries/%/ghc.mk, $(PACKAGES) $(PACKAGES_STAGE2))
+ $(RM) $(patsubst %, libraries/%/configure, \
+ $(PACKAGES) $(PACKAGES_STAGE2))
$(RM) libraries/base/include/HsBaseConfig.h.in
$(RM) libraries/directory/include/HsDirectoryConfig.h.in
$(RM) libraries/process/include/HsProcessConfig.h.in