[project @ 1997-07-27 01:26:25 by sof]
[ghc-hetmet.git] / ghc / lib / Makefile
1 #################################################################################
2 #
3 #                           ghc/lib/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 ifeq "$(way)" ""
14 SUBDIRS = cbits
15 ifeq ($(IncludeTestDirsInBuild),YES)
16   SUBDIRS += tests
17 endif
18 else
19 SUBDIRS=
20 endif
21
22 #-----------------------------------------------------------------------------
23 #       Setting the standard variables
24 #
25
26 LIB_DIRS = ghc required glaExts concurrent
27
28 LIBRARY = libHS$(_way).a
29 HS_SRCS = $(foreach d, $(LIB_DIRS), $(wildcard $(d)/*.lhs))
30 HS_OBJS = $(HS_SRCS:.lhs=.$(way_)o)
31 LIBOBJS = $(HS_OBJS)
32 HS_IFACES= $(HS_SRCS:.lhs=.$(way_)hi) ghc/GHC.$(way_)hi
33
34 #-----------------------------------------------------------------------------
35 #       Setting the GHC compile options
36
37 SRC_HC_OPTS += -recomp -cpp -fglasgow-exts -fvia-C -Rghc-timing $(GhcLibHcOpts)
38
39 #
40 # Profiling options
41 WAY_p_HC_OPTS += -prof -GPrelude
42 WAY_mr_HC_OPTS += -prof -GPrelude
43
44 #
45 # Object and interface files have suffixes tagged with their ways
46 #
47 ifneq "$(way)" ""
48 SRC_HC_OPTS += -hisuf $(way_)hi
49 endif
50
51 # per-module flags
52
53 glaExts/PackedString_HC_OPTS += -monly-3-regs
54 required/Directory_HC_OPTS   += -monly-3-regs 
55 concurrent/Parallel_HC_OPTS  += -fglasgow-exts
56 required/Time_HC_OPTS        += -monly-3-regs -H10m
57
58 # Far too much heap is needed to compile PrelNum with -O at the
59 # moment, but there you go..
60 ghc/PrelNum_HC_OPTS          += -H30m
61 # Note: this option has to go in the Makefile rather than in an
62 # OPTIONS line in the source file. The reason being that we want
63 # to override the SRC_HC_OPTS of -O, and anything option coming
64 # from the Makefile overrides what's in OPTIONS lines. (mumble_HC_OPTS
65 # does override SRC_HC_OPTS settings)
66 ghc/UnsafeST_HC_OPTS         += -Onot
67
68 ghc/PrelBase_HC_OPTS         += -H8m
69 ghc/PrelRead_HC_OPTS         += -H8m
70 ghc/IOHandle_HC_OPTS         += -H8m
71
72 #-----------------------------------------------------------------------------
73 #       Dependency generation
74
75 SRC_MKDEPENDHS_OPTS += -ighc:required:glaExts:concurrent -I$(GHC_INCLUDE_DIR)
76
77 #-----------------------------------------------------------------------------
78 #       Rules
79
80 GHC.$(way_)hi   : GHC.hi-boot
81         cp GHC.hi-boot GHC.$(way_)hi
82
83
84
85 #-----------------------------------------------------------------------------
86 #       Installation; need to install .hi files as well as libraries
87 #
88 # The interface files are put inside the $(libdir), since they
89 # might (potentially) be platform specific..
90 #
91 # Note: we use `override' here to ignore the setting of datadir
92 # which may have been set on the command-line..naughty, as it
93 # prevents `datadir' from being used from the command-line.
94 # This only applies to binary-distributions, though.n
95
96 ifeq "$(BIN_DIST)" "1"
97 override datadir:=$(libdir)/imports
98 else
99 datadir:=$(libdir)/imports
100 endif
101
102 #
103 # Files to install from here
104
105 INSTALL_LIBS  += $(LIBRARY)
106 INSTALL_DATAS += $(HS_IFACES)
107
108 include $(TOP)/mk/target.mk
109
110