6f62b6398ee97c77d04bc40bedc5659f6b4d772d
[ghc-hetmet.git] / utils / ghc-pkg / Makefile
1
2 TOP=../..
3 include $(TOP)/mk/boilerplate.mk
4 include $(TOP)/mk/cabal-flags.mk
5
6 SRC_HC_OPTS += -Wall
7
8 ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
9 INSTALL_FLAGS =
10 else
11 INSTALL_FLAGS = --enable-shell-wrappers
12 endif
13
14 default all: with-bootstrapping-compiler
15
16 with-bootstrapping-compiler: Version.hs
17         $(CABAL) configure --distpref dist-inplace         \
18                            $(INPLACE_DIRS_CONFIGURE_FLAGS) \
19                            $(USE_BOOT_CONFIGURE_FLAGS)     \
20                            $(COMMON_CONFIGURE_FLAGS)
21         $(CABAL) build     --distpref dist-inplace $(BUILD_FLAGS)
22         $(CABAL) install   --distpref dist-inplace $(INSTALL_FLAGS)
23
24 with-stage-1: Version.hs
25         $(CABAL) configure --distpref dist-install         \
26                            $(INSTALL_DIRS_CONFIGURE_FLAGS) \
27                            $(USE_STAGE1_CONFIGURE_FLAGS)   \
28                            $(COMMON_CONFIGURE_FLAGS)
29         $(CABAL) build     --distpref dist-install $(BUILD_FLAGS)
30
31 install:
32         $(INSTALL_PACKAGE) install UNUSED UNUSED '$(DESTDIR)' '$(prefix)' \
33                            '$(prefix)' '$(bindir)' '$(libdir)'            \
34                        '$(libexecdir)' '$(dynlibdir)' '$(datadir)'    \
35                        '$(docdir)' '$(htmldir)' '$(haddockdir)'
36                            --distpref dist-install                        \
37                            $(INSTALL_FLAGS)
38
39 clean: distclean
40
41 distclean:
42         -$(CABAL) clean --distpref dist-inplace
43         -$(CABAL) clean --distpref dist-install
44         $(RM) -f Version.hs
45
46 # XXX fix binary-dist
47
48 ##### Here down is unique to ghc-pkg
49
50 Version.hs: Makefile $(TOP)/mk/config.mk
51         $(RM) -f Version.hs
52         echo "module Version where"                    >> Version.hs
53         echo "version, targetOS, targetARCH :: String" >> Version.hs
54         echo "version    = \"$(ProjectVersion)\""      >> Version.hs
55         echo "targetOS   = \"$(TargetOS_CPP)\""        >> Version.hs
56         echo "targetARCH = \"$(TargetArch_CPP)\""      >> Version.hs
57