Makefile 2.98 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#################################################################################
#
#			    ghc/lib/std/Makefile
#
#		Makefile for building the GHC Prelude libraries umpteen ways
#
#	
#################################################################################

TOP = ../..
include $(TOP)/mk/boilerplate.mk

WAYS=$(GhcLibWays)

ifeq "$(way)" ""
SUBDIRS = cbits
else
SUBDIRS=
endif

#-----------------------------------------------------------------------------
# 	Setting the standard variables
#

LIBRARY = libHS$(_way).a
26
HS_SRCS = $(wildcard *.lhs)
27
28
29
30
31
32
33
34
HS_OBJS = $(HS_SRCS:.lhs=.$(way_)o)
LIBOBJS = $(HS_OBJS)
HS_IFACES= $(HS_SRCS:.lhs=.$(way_)hi) PrelGHC.$(way_)hi


#-----------------------------------------------------------------------------
# 	Setting the GHC compile options

sof's avatar
sof committed
35
36
37
38
SRC_HC_OPTS += -recomp -cpp -fglasgow-exts -fvia-C -Rghc-timing $(GhcLibHcOpts) -fcompiling-prelude
ifneq "$(way)" "dll"
SRC_HC_OPTS += -static
endif
39
40
41
42
43
44
45
46
47
48
49
50
51
52

#
# Profiling options
WAY_p_HC_OPTS += -GPrelude
WAY_mr_HC_OPTS += -GPrelude

#
# Object and interface files have suffixes tagged with their ways
#
ifneq "$(way)" ""
SRC_HC_OPTS += -hisuf $(way_)hi
endif

# per-module flags
53
54
55
PrelArrExtra_HC_OPTS     += -monly-2-regs
Directory_HC_OPTS   	 += -monly-3-regs 
Time_HC_OPTS        	 += -monly-3-regs
56

57
# Far too much heap is needed to compile PrelNumExtra with -O at the
58
# moment, but there you go..
59
PrelNumExtra_HC_OPTS     += -H34m -K2m
60

61
PrelPack_HC_OPTS	 += -K4m
62
63
64
PrelBase_HC_OPTS         += -H12m
PrelRead_HC_OPTS         += -H20m
PrelTup_HC_OPTS          += -H12m -K2m
65
PrelNum_HC_OPTS		 += -H12m -K4m
66
PrelArr_HC_OPTS          += -H8m
67
68
PrelHandle_HC_OPTS       += -H20m
Time_HC_OPTS             += -H24m -K2m
69
70
Complex_HC_OPTS          += -H10m
IO_HC_OPTS	         += -H12m
71
PrelMain_HC_OPTS	 += -fno-prune-tydecls # avoids an apparent bug; ToDo
72
73
List_HC_OPTS             += -H8m
Directory_HC_OPTS        += -H8m
74
75
76
77
78
79
80
81
82
83
84
85
86
87

#-----------------------------------------------------------------------------
# 	Dependency generation

SRC_MKDEPENDHS_OPTS += -I$(GHC_INCLUDE_DIR)

#-----------------------------------------------------------------------------
# 	Rules

PrelGHC.$(way_)hi	: PrelGHC.hi-boot
	cp $< $@

boot :: PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi)

sof's avatar
sof committed
88
89
90
91
92
93
94
95
96
97
98
DLL_NAME = HSprel.dll
DLL_IMPLIB_NAME = libHS_imp.a
SRC_BLD_DLL_OPTS += --export-all --output-def=HSprel.def
SRC_BLD_DLL_OPTS += -lwinmm -lHSrts_imp -lHS_cbits_imp -lgmp -L. -L../../rts/gmp -L../../rts -Lcbits


ifeq "$(way)" "dll"
HS_SRCS := $(filter-out PrelMain.lhs, $(HS_SRCS))
endif


99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#-----------------------------------------------------------------------------
# 	Installation; need to install .hi files as well as libraries
#
# The interface files are put inside the $(libdir), since they
# might (potentially) be platform specific..
#
# override is used here because for binary distributions, datadir is
# set on the command line. sigh.
#
override datadir:=$(libdir)/imports/std

#
# Files to install from here
# 
INSTALL_LIBS  += $(LIBRARY)
INSTALL_DATAS += $(HS_IFACES)

include $(TOP)/mk/target.mk