#
# * per-source-file dependencies instead of one .depend file?
# * eliminate undefined variables, and use --warn-undefined-variables?
-# * perhaps we should make all the output dirs in the .depend rule, to
-# avoid all these mkdirhier calls?
# * put outputs from different ways in different subdirs of distdir/build,
# then we don't have to use -osuf/-hisuf. We would have to install
# them in different places too, so we'd need ghc-pkg support for packages
# -----------------------------------------------------------------------------
# Directories
+# Don't try to delete directories:
+.PRECIOUS: %/.
+
%/. : $(MKDIRHIER)
"$(MKDIRHIER)" $@
$(BINDIST_EXTRAS) \
$(includes_H_CONFIG) \
$(includes_H_PLATFORM) \
+ $(includes_H_FILES) \
includes/ghcconfig.h \
includes/rts/Config.h \
$(INSTALL_HEADERS) \
BIN_DIST_MK = $(BIN_DIST_PREP_DIR)/bindist.mk
unix-binary-dist-prep:
- "$(RM)" $(RM_OPTS) -r bindistprep/*
- mkdir $(BIN_DIST_PREP_DIR)
+ "$(RM)" $(RM_OPTS) -r bindistprep/
+ "$(MKDIRHIER)" $(BIN_DIST_PREP_DIR)
set -e; for i in LICENSE compiler ghc rts libraries utils docs libffi includes driver mk rules Makefile aclocal.m4 config.sub config.guess install-sh extra-gcc-opts.in ghc.mk inplace; do ln -s ../../$$i $(BIN_DIST_PREP_DIR)/; done
echo "HADDOCK_DOCS = $(HADDOCK_DOCS)" >> $(BIN_DIST_MK)
echo "LATEX_DOCS = $(LATEX_DOCS)" >> $(BIN_DIST_MK)
cd bindistprep && "$(TAR)" hcf - -T ../$(BIN_DIST_LIST) | bzip2 -c > ../$(BIN_DIST_PREP_TAR_BZ2)
windows-binary-dist-prep:
- "$(RM)" $(RM_OPTS) -r bindistprep/*
+ "$(RM)" $(RM_OPTS) -r bindistprep/
$(MAKE) prefix=$(TOP)/$(BIN_DIST_PREP_DIR) install
cd bindistprep && "$(TAR)" cf - $(BIN_DIST_NAME) | bzip2 -c > ../$(BIN_DIST_PREP_TAR_BZ2)
windows-installer:
- "$(ISCC)" /O. /F$(WINDOWS_INSTALLER_BASE) - < distrib/ghc.iss
+ "$(ISCC)" /O. /Fbindistprep/$(WINDOWS_INSTALLER_BASE) - < distrib/ghc.iss
nTimes = set -e; for i in `seq 1 $(1)`; do echo Try "$$i: $(2)"; if $(2); then break; fi; done
$(eval $(call clean-target,libraries/$(lib),dist-install,libraries/$(lib)/dist-install)))
endif
+clean : clean_bindistprep
+.PHONY: clean_bindistprep
+clean_bindistprep:
+ "$(RM)" $(RM_OPTS) -r bindistprep/
+
distclean : clean
"$(RM)" $(RM_OPTS) config.cache config.status config.log mk/config.h mk/stamp-h
"$(RM)" $(RM_OPTS) mk/config.mk mk/are-validating.mk mk/project.mk