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