From: Ian Lynagh Date: Fri, 18 Jul 2008 15:34:59 +0000 (+0000) Subject: More build system changes; hasktags is now built with Cabal X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=4d7ecf304ab398c4aed110822cd934cb6dc071e3 More build system changes; hasktags is now built with Cabal --- diff --git a/mk/cabal.mk b/mk/cabal.mk new file mode 100644 index 0000000..5e0de0d --- /dev/null +++ b/mk/cabal.mk @@ -0,0 +1,55 @@ + +include $(TOP)/mk/cabal-flags.mk + +# XXX We would like to turn this on, but Cabal generates paths files +# that are not -Wall clean! +# SRC_HC_OPTS += -Wall + +ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32" +INSTALL_FLAGS = +else +ifeq "$(ENABLE_SHELL_WRAPPERS)" "YES" +INSTALL_FLAGS = --enable-shell-wrappers +else +INSTALL_FLAGS = +endif +endif + +.PHONY: default all with-bootstrapping-compiler with-stage-1 clean distclean + +default all: with-bootstrapping-compiler + +with-bootstrapping-compiler: + $(CABAL) configure --distpref dist-inplace \ + $(INPLACE_DIRS_CONFIGURE_FLAGS) \ + $(USE_BOOT_CONFIGURE_FLAGS) \ + $(COMMON_CONFIGURE_FLAGS) + $(CABAL) build --distpref dist-inplace $(BUILD_FLAGS) + $(CABAL) install --distpref dist-inplace $(INSTALL_FLAGS) + +with-stage-1: + $(CABAL) configure --distpref dist-install \ + $(INSTALL_DIRS_CONFIGURE_FLAGS) \ + $(USE_STAGE1_CONFIGURE_FLAGS) \ + $(COMMON_CONFIGURE_FLAGS) + $(CABAL) build --distpref dist-install $(BUILD_FLAGS) + +install: + $(INSTALL_PACKAGE) install UNUSED UNUSED '$(DESTDIR)' '$(prefix)' \ + '$(prefix)' '$(bindir)' '$(libdir)' \ + '$(libexecdir)' '$(dynlibdir)' '$(datadir)' \ + '$(docdir)' '$(htmldir)' '$(haddockdir)' \ + --distpref dist-install \ + $(INSTALL_FLAGS) + +clean: distclean + +distclean: + -$(CABAL) clean --distpref dist-inplace + -$(CABAL) clean --distpref dist-install +ifneq "$(EXTRA_CLEAN)" "" + $(RM) -f $(EXTRA_CLEAN) +endif + +# XXX fix binary-dist + diff --git a/utils/Makefile b/utils/Makefile index 4ecbd72..9f2b1b0 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -3,12 +3,12 @@ include $(TOP)/mk/boilerplate.mk ifeq "$(DOING_BIN_DIST)" "YES" # We're doing a binary-dist, descend into a subset of the dirs. -SUBDIRS = mkdirhier hasktags hp2ps parallel unlit runghc hpc pwd +SUBDIRS = mkdirhier hp2ps parallel unlit runghc hpc pwd else ifeq "$(BootingFromHc)" "YES" SUBDIRS = mkdependC mkdirhier runstdtest genapply genprimopcode unlit else -SUBDIRS = mkdependC mkdirhier runstdtest hasktags hp2ps \ +SUBDIRS = mkdependC mkdirhier runstdtest hp2ps \ installPackage parallel unlit genprimopcode genapply runghc hpc pwd endif ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32" @@ -55,11 +55,14 @@ endif WITH_BOOTSTRAPPING_COMPILER = ghc-pkg hsc2hs -WITH_STAGE1 = ghc-pkg +WITH_STAGE1 = ghc-pkg hasktags ifneq "$(NO_INSTALL_HSC2HS)" "YES" WITH_STAGE1 += hsc2hs endif +# sort removes duplicates - we don't actually care about the order +WITH_EITHER = $(sort $(WITH_BOOTSTRAPPING_COMPILER) $(WITH_STAGE1)) + with-bootstrapping-compiler: \ $(foreach P,$(WITH_BOOTSTRAPPING_COMPILER),with-bootstrapping-compiler.$P) diff --git a/utils/ghc-pkg/Makefile b/utils/ghc-pkg/Makefile index 6f62b63..61e4893 100644 --- a/utils/ghc-pkg/Makefile +++ b/utils/ghc-pkg/Makefile @@ -1,51 +1,13 @@ TOP=../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/cabal-flags.mk - -SRC_HC_OPTS += -Wall - -ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32" -INSTALL_FLAGS = -else -INSTALL_FLAGS = --enable-shell-wrappers -endif +ENABLE_SHELL_WRAPPERS = YES +EXTRA_CLEAN = Version.hs -default all: with-bootstrapping-compiler +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/cabal.mk with-bootstrapping-compiler: Version.hs - $(CABAL) configure --distpref dist-inplace \ - $(INPLACE_DIRS_CONFIGURE_FLAGS) \ - $(USE_BOOT_CONFIGURE_FLAGS) \ - $(COMMON_CONFIGURE_FLAGS) - $(CABAL) build --distpref dist-inplace $(BUILD_FLAGS) - $(CABAL) install --distpref dist-inplace $(INSTALL_FLAGS) - with-stage-1: Version.hs - $(CABAL) configure --distpref dist-install \ - $(INSTALL_DIRS_CONFIGURE_FLAGS) \ - $(USE_STAGE1_CONFIGURE_FLAGS) \ - $(COMMON_CONFIGURE_FLAGS) - $(CABAL) build --distpref dist-install $(BUILD_FLAGS) - -install: - $(INSTALL_PACKAGE) install UNUSED UNUSED '$(DESTDIR)' '$(prefix)' \ - '$(prefix)' '$(bindir)' '$(libdir)' \ - '$(libexecdir)' '$(dynlibdir)' '$(datadir)' \ - '$(docdir)' '$(htmldir)' '$(haddockdir)' - --distpref dist-install \ - $(INSTALL_FLAGS) - -clean: distclean - -distclean: - -$(CABAL) clean --distpref dist-inplace - -$(CABAL) clean --distpref dist-install - $(RM) -f Version.hs - -# XXX fix binary-dist - -##### Here down is unique to ghc-pkg Version.hs: Makefile $(TOP)/mk/config.mk $(RM) -f Version.hs diff --git a/utils/hasktags/Makefile b/utils/hasktags/Makefile index 20c52ba..0f34de9 100644 --- a/utils/hasktags/Makefile +++ b/utils/hasktags/Makefile @@ -1,32 +1,5 @@ + TOP=../.. include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/cabal.mk -# Beyond stage 1, honour any Mac OS X depolyment target options. If we use -# these options in stage 1 we get a linker error if the bootstrap compiler is -# for a more recent OS version -ifeq "$(stage)" "2" -SRC_CC_OPTS += $(MACOSX_DEPLOYMENT_CC_OPTS) -SRC_HC_OPTS += $(addprefix -optc, $(MACOSX_DEPLOYMENT_CC_OPTS)) -SRC_LD_OPTS += $(addprefix -optl, $(MACOSX_DEPLOYMENT_LD_OPTS)) -endif - -# We have two version: the inplace version compiled by the bootstrap compiler -# and the install version compiled by the stage 1 compiler -ifeq "$(stage)" "2" -HS_PROG = hasktags -else -HS_PROG = hasktags-inplace -endif - -CLEAN_FILES += Main.hi - -SRC_HC_OPTS += -Wall - -INSTALL_PROGS += $(HS_PROG) - -binary-dist: - $(INSTALL_DIR) $(BIN_DIST_DIR)/utils/hasktags - $(INSTALL_DATA) Makefile $(BIN_DIST_DIR)/utils/hasktags/ - $(INSTALL_PROGRAM) $(HS_PROG) $(BIN_DIST_DIR)/utils/hasktags/ - -include $(TOP)/mk/target.mk diff --git a/utils/hasktags/hasktags.cabal b/utils/hasktags/hasktags.cabal new file mode 100644 index 0000000..045256d --- /dev/null +++ b/utils/hasktags/hasktags.cabal @@ -0,0 +1,19 @@ +Name: hasktags +-- XXX version number: +Version: 0.67 +Copyright: XXX +License: BSD3 +-- XXX License-File: LICENSE +Author: XXX +Maintainer: XXX +Synopsis: XXX +Description: + XXX +Category: Development +build-type: Simple +cabal-version: >=1.2 + +Executable hasktags + Main-Is: HaskTags.hs + Build-Depends: haskell98, base + diff --git a/utils/hsc2hs/Makefile b/utils/hsc2hs/Makefile index 66fb9de..1856d27 100644 --- a/utils/hsc2hs/Makefile +++ b/utils/hsc2hs/Makefile @@ -1,54 +1,7 @@ TOP=../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/cabal-flags.mk - -# XXX We would like to turn this on, but Cabal generates paths files -# that are not -Wall clean! -# SRC_HC_OPTS += -Wall - -ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32" -INSTALL_FLAGS = -else -INSTALL_FLAGS = --enable-shell-wrappers -endif - -default all: with-bootstrapping-compiler - -with-bootstrapping-compiler: - $(CABAL) configure --distpref dist-inplace \ - $(INPLACE_DIRS_CONFIGURE_FLAGS) \ - $(USE_BOOT_CONFIGURE_FLAGS) \ - $(COMMON_CONFIGURE_FLAGS) - $(CABAL) build --distpref dist-inplace $(BUILD_FLAGS) - $(CABAL) install --distpref dist-inplace $(INSTALL_FLAGS) +ENABLE_SHELL_WRAPPERS = YES -with-stage-1: - $(CABAL) configure --distpref dist-install \ - $(INSTALL_DIRS_CONFIGURE_FLAGS) \ - $(USE_STAGE1_CONFIGURE_FLAGS) \ - $(COMMON_CONFIGURE_FLAGS) - $(CABAL) build --distpref dist-install $(BUILD_FLAGS) - -install: - $(INSTALL_PACKAGE) install UNUSED UNUSED '$(DESTDIR)' '$(prefix)' \ - '$(prefix)' '$(bindir)' '$(libdir)' \ - '$(libexecdir)' '$(dynlibdir)' '$(datadir)' \ - '$(docdir)' '$(htmldir)' '$(haddockdir)' - --distpref dist-install \ - $(INSTALL_FLAGS) - -clean: distclean - -distclean: - -$(CABAL) clean --distpref dist-inplace - -$(CABAL) clean --distpref dist-install - -# XXX fix: -#binary-dist: -# $(INSTALL_DIR) $(BIN_DIST_DIR)/utils/hsc2hs -# $(INSTALL_DATA) Makefile $(BIN_DIST_DIR)/utils/hsc2hs/ -# $(INSTALL_DATA) hsc2hs.sh $(BIN_DIST_DIR)/utils/hsc2hs/ -# $(INSTALL_DATA) $(INSTALL_DATAS) $(BIN_DIST_DIR)/utils/hsc2hs/ -# $(INSTALL_PROGRAM) $(HS_PROG) $(BIN_DIST_DIR)/utils/hsc2hs/ +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/cabal.mk