[project @ 2001-09-23 20:45:55 by ken]
[ghc-hetmet.git] / ghc / driver / Makefile
1 #-----------------------------------------------------------------------------
2 # $Id: Makefile,v 1.68 2001/08/04 06:09:24 ken Exp $
3 #
4
5 TOP=..
6 CURRENT_DIR=ghc/driver
7 include $(TOP)/mk/boilerplate.mk
8
9 # hack for ghci-inplace script, see below
10 INSTALLING=1
11
12 ifeq "$(INSTALLING)" "1"        
13 SUBDIRS = mangler split ghc ghci
14 endif
15
16 # -----------------------------------------------------------------------------
17 # package configuration files...
18
19 PKGCONF_OPTS = "$(TARGETPLATFORM)"              \
20                "$(CURRENT_DIR)"                 \
21                "$(HaveLibGmp)"                  \
22                "$(LibsReadline)"                \
23                "$(GHC_LIB_DIR)"                 \
24                "$(GHC_RUNTIME_DIR)"             \
25                "$(GHC_UTILS_DIR)"               \
26                "$(GHC_INCLUDE_DIR)"
27
28 ghc_407_at_least = $(shell expr "$(GhcVersion)" \>= 4.07)
29 ifeq "$(ghc_407_at_least)" "1"
30 ifneq "$(mingw32_TARGET_OS)" "1"
31 SRC_HC_OPTS += -fglasgow-exts -cpp -package concurrent -package posix -package text
32 else
33 SRC_HC_OPTS += -fglasgow-exts -cpp -package concurrent -package text
34 endif
35 else
36 SRC_HC_OPTS += -fglasgow-exts -cpp -syslib concurrent -syslib posix -syslib misc
37 endif
38
39 SRC_HC_OPTS += -DWANT_PRETTY
40 SRC_HC_OPTS += $(filter -D% -U%,$(GhcRtsCcOpts))
41
42 all :: package.conf package.conf.inplace
43
44 HS_OBJS = Package.o PackageSrc.o Utils.o
45 HS_PROG = pkgconf
46
47 package.conf.inplace : $(HS_PROG)
48         ./$(HS_PROG) in-place $(PKGCONF_OPTS) >$@
49
50 package.conf : pkgconf
51         ./$(HS_PROG) install $(PKGCONF_OPTS) >$@
52
53 Package.o : ../utils/ghc-pkg/Package.hs
54
55 override datadir = $(libdir)
56 INSTALL_DATAS += package.conf ghc-usage.txt
57
58 CLEAN_FILES += Main.hi pkgconf package.conf.inplace package.conf
59
60 # -----------------------------------------------------------------------------
61
62 include $(TOP)/mk/target.mk