[project @ 1998-12-02 13:17:09 by simonm]
[ghc-hetmet.git] / ghc / lib / exts / 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 WAYS=$(GhcLibWays)
14
15 #-----------------------------------------------------------------------------
16 #       Setting the standard variables
17 #
18
19 LIBRARY = libHSexts$(_way).a
20 HS_SRCS = $(wildcard *.lhs)
21 HS_OBJS = $(HS_SRCS:.lhs=.$(way_)o)
22 LIBOBJS = $(HS_OBJS)
23 HS_IFACES= $(HS_SRCS:.lhs=.$(way_)hi)
24
25 #-----------------------------------------------------------------------------
26 #       Setting the GHC compile options
27
28 SRC_HC_OPTS += -recomp -cpp -fglasgow-exts -fvia-C -Rghc-timing $(GhcLibHcOpts)
29
30 #
31 # Profiling options
32 WAY_p_HC_OPTS += -GPrelude
33 WAY_mr_HC_OPTS += -GPrelude
34
35 #
36 # Object and interface files have suffixes tagged with their ways
37 #
38 ifneq "$(way)" ""
39 SRC_HC_OPTS += -hisuf $(way_)hi
40 endif
41
42 Int_HC_OPTS          += -H14m -fno-prune-tydecls
43 Word_HC_OPTS         += -H12m
44 Foreign_HC_OPTS      += -fno-prune-tydecls
45 NativeInfo_HC_OPTS   += -fno-prune-tydecls
46 Dynamic_HC_OPTS      += $(MAGIC_HSCPP_OPTS)
47
48 MAGIC_HSCPP_OPTS=-DBEGIN_FOR_GHC='-}' -DEND_FOR_GHC='{-' -DBEGIN_FOR_HUGS='{-' -DEND_FOR_HUGS='-}'
49
50 #-----------------------------------------------------------------------------
51 #       Dependency generation
52
53 SRC_MKDEPENDHS_OPTS += -I$(GHC_INCLUDE_DIR) -optdep--include-prelude -optdep-w $(MAGIC_HSCPP_OPTS)
54
55 #-----------------------------------------------------------------------------
56 #       Installation; need to install .hi files as well as libraries
57 #
58 # The interface files are put inside the $(libdir), since they
59 # might (potentially) be platform specific..
60 #
61 # override is used here because for binary distributions, datadir is
62 # set on the command line. sigh.
63 #
64 override datadir:=$(libdir)/imports/exts
65
66 #
67 # Files to install from here
68
69 INSTALL_LIBS  += $(LIBRARY)
70 INSTALL_DATAS += $(HS_IFACES)
71
72 include $(TOP)/mk/target.mk