Commit 4d7ecf30 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

More build system changes; hasktags is now built with Cabal

parent 51cdf3e1
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
......@@ -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)
......
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
......
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
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
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
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