Build system tweaks
[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 .PHONY: default all with-bootstrapping-compiler with-stage-1 clean distclean
19
20 default all: with-bootstrapping-compiler
21
22 with-bootstrapping-compiler:
23         $(CABAL) configure --distpref dist-inplace          \
24                            $(INPLACE_DIRS_CONFIGURE_FLAGS)  \
25                            $(USE_BOOT_CONFIGURE_FLAGS)      \
26                            $(COMMON_CONFIGURE_FLAGS)        \
27                            $(EXTRA_INPLACE_CONFIGURE_FLAGS)
28         $(CABAL) build     --distpref dist-inplace $(BUILD_FLAGS)
29         $(CABAL) install   --distpref dist-inplace $(INSTALL_FLAGS)
30
31 with-stage-1:
32         $(CABAL) configure --distpref dist-install         \
33                            $(INSTALL_DIRS_CONFIGURE_FLAGS) \
34                            $(USE_STAGE1_CONFIGURE_FLAGS)   \
35                            $(COMMON_CONFIGURE_FLAGS)       \
36                            $(EXTRA_STAGE1_CONFIGURE_FLAGS)
37         $(CABAL) build     --distpref dist-install $(BUILD_FLAGS)
38
39 install:
40         $(INSTALL_PACKAGE) install UNUSED UNUSED '$(DESTDIR)' '$(prefix)' \
41                            '$(prefix)' '$(bindir)' '$(libdir)'            \
42                        '$(libexecdir)' '$(dynlibdir)' '$(datadir)'    \
43                        '$(docdir)' '$(htmldir)' '$(haddockdir)'       \
44                            --distpref dist-install                        \
45                            $(INSTALL_FLAGS)
46
47 clean: distclean
48
49 distclean:
50         -$(CABAL) clean --distpref dist-inplace
51         -$(CABAL) clean --distpref dist-install
52 ifneq "$(EXTRA_CLEAN)" ""
53         $(RM) -f $(EXTRA_CLEAN)
54 endif
55
56 # XXX fix binary-dist
57