More build system changes; hasktags is now built with Cabal
[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         $(CABAL) build     --distpref dist-inplace $(BUILD_FLAGS)
28         $(CABAL) install   --distpref dist-inplace $(INSTALL_FLAGS)
29
30 with-stage-1:
31         $(CABAL) configure --distpref dist-install         \
32                            $(INSTALL_DIRS_CONFIGURE_FLAGS) \
33                            $(USE_STAGE1_CONFIGURE_FLAGS)   \
34                            $(COMMON_CONFIGURE_FLAGS)
35         $(CABAL) build     --distpref dist-install $(BUILD_FLAGS)
36
37 install:
38         $(INSTALL_PACKAGE) install UNUSED UNUSED '$(DESTDIR)' '$(prefix)' \
39                            '$(prefix)' '$(bindir)' '$(libdir)'            \
40                        '$(libexecdir)' '$(dynlibdir)' '$(datadir)'    \
41                        '$(docdir)' '$(htmldir)' '$(haddockdir)'       \
42                            --distpref dist-install                        \
43                            $(INSTALL_FLAGS)
44
45 clean: distclean
46
47 distclean:
48         -$(CABAL) clean --distpref dist-inplace
49         -$(CABAL) clean --distpref dist-install
50 ifneq "$(EXTRA_CLEAN)" ""
51         $(RM) -f $(EXTRA_CLEAN)
52 endif
53
54 # XXX fix binary-dist
55