Makefile 1.75 KB
Newer Older
1
#-----------------------------------------------------------------------------
sof's avatar
sof committed
2
#
3

4
TOP=..
5
CURRENT_DIR=ghc/driver
6
7
include $(TOP)/mk/boilerplate.mk

8
9
10
11
# hack for ghci-inplace script, see below
INSTALLING=1

ifeq "$(INSTALLING)" "1"	
12
SUBDIRS = mangler split ghc ghci
13
endif
14
15
16
17

# -----------------------------------------------------------------------------
# package configuration files...

18
19
20
21
22
23
24
PKGCONF_OPTS = "$(TARGETPLATFORM)"		\
	       "$(CURRENT_DIR)"			\
	       "$(HaveLibGmp)"			\
	       "$(LibsReadline)"		\
	       "$(GHC_LIB_DIR)"			\
	       "$(GHC_RUNTIME_DIR)"		\
	       "$(GHC_UTILS_DIR)"		\
25
26
27
28
29
	       "$(GHC_INCLUDE_DIR)"		\
	       "$(X_CFLAGS)"			\
	       "$(X_LIBS)"

# the latter two are needed to setup the package details for hslibs/xlib
30

sof's avatar
sof committed
31
32
SRC_HC_OPTS += -fglasgow-exts -cpp 

sof's avatar
sof committed
33
ghc_407_at_least = $(shell if (test $(GhcCanonVersion) -ge 407); then echo YES; else echo NO; fi)
sof's avatar
sof committed
34
35
36

ifeq "$(ghc_407_at_least)" "YES"
SRC_HC_OPTS += -package concurrent -package text
37
ifneq "$(mingw32_TARGET_OS)" "1"
sof's avatar
sof committed
38
SRC_HC_OPTS += -package posix
39
40
endif
else
sof's avatar
sof committed
41
SRC_HC_OPTS += -syslib concurrent -syslib posix -syslib misc
42
43
endif

sof's avatar
sof committed
44
45
46
47
ifeq "$(GhcRtsThreaded)" "YES"
SRC_HC_OPTS +=-DTHREADED_RTS
endif

48
SRC_HC_OPTS += -DWANT_PRETTY
ken's avatar
ken committed
49
SRC_HC_OPTS += $(filter -D% -U%,$(GhcRtsCcOpts))
50

51
52
all :: package.conf package.conf.inplace

53
54
HS_OBJS = Package.o PackageSrc.o Utils.o
HS_PROG = pkgconf
55

56
57
package.conf.inplace : $(HS_PROG)
	./$(HS_PROG) in-place $(PKGCONF_OPTS) >$@
58
59

package.conf : pkgconf
60
	./$(HS_PROG) install $(PKGCONF_OPTS) >$@
61

62
63
Package.o : ../utils/ghc-pkg/Package.hs

64
override datadir = $(libdir)
65
INSTALL_DATAS += package.conf ghc-usage.txt
66

67
CLEAN_FILES += Main.hi pkgconf package.conf.inplace package.conf
68
69

# -----------------------------------------------------------------------------
70
71

include $(TOP)/mk/target.mk