[project @ 1998-12-02 13:17:09 by simonm]
[ghc-hetmet.git] / ghc / lib / std / Makefile
1 #################################################################################
2 #
3 #                           ghc/lib/std/Makefile
4 #
5 #               Makefile for building the GHC Prelude libraries umpteen ways
6 #
7 #       
8 #################################################################################
9
10 TOP = ../..
11 include $(TOP)/mk/boilerplate.mk
12
13 WAYS=$(GhcLibWays)
14
15 ifeq "$(way)" ""
16 SUBDIRS = cbits
17 else
18 SUBDIRS=
19 endif
20
21 #-----------------------------------------------------------------------------
22 #       Setting the standard variables
23 #
24
25 LIBRARY = libHS$(_way).a
26 HS_SRCS = $(wildcard *.lhs)
27 HS_OBJS = $(HS_SRCS:.lhs=.$(way_)o)
28 LIBOBJS = $(HS_OBJS)
29 HS_IFACES= $(HS_SRCS:.lhs=.$(way_)hi) PrelGHC.$(way_)hi
30
31
32 #-----------------------------------------------------------------------------
33 #       Setting the GHC compile options
34
35 SRC_HC_OPTS += -recomp -cpp -fglasgow-exts -fvia-C -Rghc-timing $(GhcLibHcOpts)
36
37 #
38 # Profiling options
39 WAY_p_HC_OPTS += -GPrelude
40 WAY_mr_HC_OPTS += -GPrelude
41
42 #
43 # Object and interface files have suffixes tagged with their ways
44 #
45 ifneq "$(way)" ""
46 SRC_HC_OPTS += -hisuf $(way_)hi
47 endif
48
49 # per-module flags
50 PrelArrExtra_HC_OPTS     += -monly-2-regs
51 Directory_HC_OPTS        += -monly-3-regs 
52 Time_HC_OPTS             += -monly-3-regs
53
54 # Far too much heap is needed to compile PrelNumExtra with -O at the
55 # moment, but there you go..
56 PrelNumExtra_HC_OPTS     += -H30m -K2m
57
58 PrelBase_HC_OPTS         += -H10m
59 PrelRead_HC_OPTS         += -H16m
60 PrelTup_HC_OPTS          += -H12m
61 PrelNum_HC_OPTS          += -H12m
62 PrelArr_HC_OPTS          += -H8m
63 PrelHandle_HC_OPTS       += -H14m
64 Time_HC_OPTS             += -H18m
65 Complex_HC_OPTS          += -H10m
66 IO_HC_OPTS               += -H12m
67 PrelMain_HC_OPTS         += -fno-prune-tydecls # avoids an apparent bug; ToDo
68
69 #-----------------------------------------------------------------------------
70 #       Dependency generation
71
72 SRC_MKDEPENDHS_OPTS += -I$(GHC_INCLUDE_DIR)
73
74 #-----------------------------------------------------------------------------
75 #       Rules
76
77 PrelGHC.$(way_)hi       : PrelGHC.hi-boot
78         cp $< $@
79
80 boot :: PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi)
81
82 #-----------------------------------------------------------------------------
83 #       Installation; need to install .hi files as well as libraries
84 #
85 # The interface files are put inside the $(libdir), since they
86 # might (potentially) be platform specific..
87 #
88 # override is used here because for binary distributions, datadir is
89 # set on the command line. sigh.
90 #
91 override datadir:=$(libdir)/imports/std
92
93 #
94 # Files to install from here
95
96 INSTALL_LIBS  += $(LIBRARY)
97 INSTALL_DATAS += $(HS_IFACES)
98
99 include $(TOP)/mk/target.mk