[project @ 2002-01-07 16:32:54 by sof]
[ghc-hetmet.git] / ghc / driver / Makefile
1 #-----------------------------------------------------------------------------
2 #
3
4 TOP=..
5 CURRENT_DIR=ghc/driver
6 include $(TOP)/mk/boilerplate.mk
7
8 # hack for ghci-inplace script, see below
9 INSTALLING=1
10
11 ifeq "$(INSTALLING)" "1"        
12 SUBDIRS = mangler split ghc ghci
13 endif
14
15 # -----------------------------------------------------------------------------
16 # package configuration files...
17
18 PKGCONF_OPTS = "$(TARGETPLATFORM)"              \
19                "$(CURRENT_DIR)"                 \
20                "$(HaveLibGmp)"                  \
21                "$(LibsReadline)"                \
22                "$(GHC_LIB_DIR)"                 \
23                "$(GHC_RUNTIME_DIR)"             \
24                "$(GHC_UTILS_DIR)"               \
25                "$(GHC_INCLUDE_DIR)"             \
26                "$(X_CFLAGS)"                    \
27                "$(X_LIBS)"
28
29 # the latter two are needed to setup the package details for hslibs/xlib
30
31 SRC_HC_OPTS += -fglasgow-exts -cpp 
32
33 ghc_407_at_least = $(shell if (test $(GhcCanonVersion) -ge 407); then echo YES; else echo NO; fi)
34
35 ifeq "$(ghc_407_at_least)" "YES"
36 SRC_HC_OPTS += -package concurrent -package text
37 ifneq "$(mingw32_TARGET_OS)" "1"
38 SRC_HC_OPTS += -package posix
39 endif
40 else
41 SRC_HC_OPTS += -syslib concurrent -syslib posix -syslib misc
42 endif
43
44 SRC_HC_OPTS += -DWANT_PRETTY
45 SRC_HC_OPTS += $(filter -D% -U%,$(GhcRtsCcOpts))
46
47 all :: package.conf package.conf.inplace
48
49 HS_OBJS = Package.o PackageSrc.o Utils.o
50 HS_PROG = pkgconf
51
52 package.conf.inplace : $(HS_PROG)
53         ./$(HS_PROG) in-place $(PKGCONF_OPTS) >$@
54
55 package.conf : pkgconf
56         ./$(HS_PROG) install $(PKGCONF_OPTS) >$@
57
58 Package.o : ../utils/ghc-pkg/Package.hs
59
60 override datadir = $(libdir)
61 INSTALL_DATAS += package.conf ghc-usage.txt
62
63 CLEAN_FILES += Main.hi pkgconf package.conf.inplace package.conf
64
65 # -----------------------------------------------------------------------------
66
67 include $(TOP)/mk/target.mk