Makefile.local 1.46 KB
Newer Older
1
# Local GHC-build-tree customization for Cabal makefiles.  We want to build
2
3
# libraries using flags that the user has put in build.mk/validate.mk and
# appropriate flags for Mac OS X deployment targets.
4
5
6

# Careful here: including boilerplate.mk breaks things, because paths.mk and
# opts.mk overrides some of the variable settings in the Cabal Makefile, so
7
# we just include config.mk and custom-settings.mk.
8
9
10
11
12
TOP=../..
SAVE_GHC := $(GHC)
SAVE_AR  := $(AR)
SAVE_LD  := $(LD)
include $(TOP)/mk/config.mk
13
include $(TOP)/mk/custom-settings.mk
14
15
16
17
GHC := $(SAVE_GHC)
AR  := $(SAVE_AR)
LD  := $(SAVE_LD)

18
19
20
21
22
23
# We want all warnings on
GhcLibHcOpts += -Wall

# Cabal has problems with deprecated flag warnings, as it needs to pass
# deprecated flags in pragmas in order to support older GHCs. Thus for
# now at least we just disable them completely.
24
25
GhcLibHcOpts += -fno-warn-deprecated-flags

Ian Lynagh's avatar
Ian Lynagh committed
26
ifeq "$(filter-out array-% base-% editline-% filepath-% ghc-prim-% hpc-% pretty-% process-% unix-% Win32-%,$(package))" ""
27
28
29
30
31
32
# XXX We are one of the above list, i.e. we are a package that is not
# yet warning-clean. Thus turn warnings off for now so that validate
# goes through.
GhcLibHcOpts += -w
endif

33
# Now add flags from the GHC build system to the Cabal build:
34
35
36
37
38
GHC_CC_OPTS += $(addprefix -optc, $(MACOSX_DEPLOYMENT_CC_OPTS))
GHC_OPTS    += $(SRC_HC_OPTS)
GHC_OPTS    += $(GhcLibHcOpts)
GHC_OPTS    += $(addprefix -optc, $(MACOSX_DEPLOYMENT_CC_OPTS))
LIB_LD_OPTS += $(addprefix -optl, $(MACOSX_DEPLOYMENT_LD_OPTS))