Makefile 1.68 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
44
endif

SRC_HC_OPTS += -DWANT_PRETTY
ken's avatar
ken committed
45
SRC_HC_OPTS += $(filter -D% -U%,$(GhcRtsCcOpts))
46

47
48
all :: package.conf package.conf.inplace

49
50
HS_OBJS = Package.o PackageSrc.o Utils.o
HS_PROG = pkgconf
51

52
53
package.conf.inplace : $(HS_PROG)
	./$(HS_PROG) in-place $(PKGCONF_OPTS) >$@
54
55

package.conf : pkgconf
56
	./$(HS_PROG) install $(PKGCONF_OPTS) >$@
57

58
59
Package.o : ../utils/ghc-pkg/Package.hs

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