bindists are now some way towards working
[ghc-hetmet.git] / mk / cabal.mk
1
2 include $(TOP)/mk/cabal-flags.mk
3 include $(TOP)/mk/bindist.mk
4
5 # XXX We would like to turn this on, but Cabal generates paths files
6 #     that are not -Wall clean!
7 # SRC_HC_OPTS      += -Wall
8
9 ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
10 INSTALL_FLAGS =
11 else
12 ifeq "$(ENABLE_SHELL_WRAPPERS)" "YES"
13 INSTALL_FLAGS = --enable-shell-wrappers
14 else
15 INSTALL_FLAGS =
16 endif
17 endif
18
19 # Tell stage1 to make a dynamically-linked binary, but no wrapper.  We assume
20 # that in an installation the shared libs will be installed somewhere that
21 # the system can find them.
22 ifeq "$(BuildSharedLibs)" "YES"
23 DYN_FLAGS = --ghc-option=-dynamic --ghc-option=-dynload --ghc-option=deploy
24 endif
25
26 .PHONY: default all with-bootstrapping-compiler with-stage-1 clean distclean
27
28 default all: with-bootstrapping-compiler
29
30 with-bootstrapping-compiler:
31         $(CABAL) configure --distpref dist-inplace          \
32                            $(INPLACE_DIRS_CONFIGURE_FLAGS)  \
33                            $(USE_BOOT_CONFIGURE_FLAGS)      \
34                            $(COMMON_CONFIGURE_FLAGS)        \
35                            $(EXTRA_INPLACE_CONFIGURE_FLAGS)
36         $(CABAL) build     --distpref dist-inplace $(BUILD_FLAGS)
37         $(CABAL) install   --distpref dist-inplace $(INSTALL_FLAGS)
38
39 with-stage-1:
40         $(CABAL) configure --distpref dist-install         \
41                            $(INSTALL_DIRS_CONFIGURE_FLAGS) \
42                            $(USE_STAGE1_CONFIGURE_FLAGS)   \
43                            $(COMMON_CONFIGURE_FLAGS)       \
44                            $(EXTRA_STAGE1_CONFIGURE_FLAGS)
45         $(CABAL) build     --distpref dist-install $(DYN_FLAGS) $(BUILD_FLAGS)
46
47 install:
48         $(INSTALL_PACKAGE) install UNUSED UNUSED '$(DESTDIR)' '$(prefix)' \
49                            '$(prefix)' '$(bindir)' '$(libdir)'            \
50                        '$(libexecdir)' '$(dynlibdir)' '$(datadir)'    \
51                        '$(docdir)' '$(htmldir)' '$(haddockdir)'       \
52                            --distpref dist-install                        \
53                            $(INSTALL_FLAGS)
54
55 clean: distclean
56
57 distclean:
58         -$(CABAL) clean --distpref dist-inplace
59         -$(CABAL) clean --distpref dist-install
60 ifneq "$(EXTRA_CLEAN)" ""
61         $(RM) -f $(EXTRA_CLEAN)
62 endif
63