1 #################################################################################
5 # Makefile for building the GHC Prelude libraries umpteen ways
7 # $Id: Makefile,v 1.9 1997/05/18 04:27:38 sof Exp $
10 #################################################################################
13 include $(TOP)/mk/boilerplate.mk
17 ifeq ($(IncludeTestDirsInBuild),YES)
24 #-----------------------------------------------------------------------------
25 # Setting the standard variables
28 LIB_DIRS = ghc required glaExts concurrent
30 LIBRARY = libHS$(_way).a
31 HS_SRCS = $(foreach d, $(LIB_DIRS), $(wildcard $(d)/*.lhs))
32 HS_OBJS = $(HS_SRCS:.lhs=.$(way_)o)
34 HS_IFACES= $(HS_SRCS:.lhs=.$(way_)hi) ghc/GHC.$(way_)hi
36 #-----------------------------------------------------------------------------
37 # Setting the GHC compile options
39 SRC_HC_OPTS += -recomp -cpp -fglasgow-exts -fvia-C $(GhcLibHcOpts)
43 WAY_p_HC_OPTS += -prof -GPrelude
44 WAY_mr_HC_OPTS += -prof -GPrelude
47 # Object and interface files have suffixes tagged with their ways
50 SRC_HC_OPTS += -hisuf $(way_)hi
55 ghc/PackedString_HC_OPTS += -monly-3-regs
56 required/Directory_HC_OPTS += -monly-3-regs
57 concurrent/Parallel_HC_OPTS += -fglasgow-exts
58 required/Time_HC_OPTS += -monly-3-regs
60 #-----------------------------------------------------------------------------
61 # Dependency generation
63 SRC_MKDEPENDHS_OPTS += -ighc:required:glaExts:concurrent -I$(GHC_INCLUDE_DIR)
65 #-----------------------------------------------------------------------------
68 # In preparation for building the various libHS* libraries,
69 # we create the interface files needed to boot their build.
71 # Note that the creation of IOBase, Main and GHC interface
72 # files for umpteen ways is strictly not necessary, they're
73 # all the same, but having the redundant files prevents us
74 # from having to treat the said interface files specially
75 # when creating the dependencies.
77 # Note: if you change the *.hi-boot files, this will not be
78 # picked up by the Makefile, you'll have to `make hi-boot'
80 # Note2: hsc will only read from ghc/GHC.hi regardless of
81 # which `way' you're compiling, so the copies of the GHC
82 # interface file for the different ways are only there
85 HIBOOTS=GHC Main IOBase
87 # Use variable to control this, so that we can generate
88 # new boot interface files for new ways without having
89 # to re-generate the old lot (followed by complete recompile).
91 HIBOOT_WAYS = norm $(WAYS)
94 @for i in $(HIBOOT_WAYS); do \
95 echo "Booting interface files for way $$i "; \
96 if [ "$$i" != "norm" ]; then \
101 for ifile in $(HIBOOTS); do \
102 echo ".. ghc/$${ifile}.$$j "; \
103 cp ghc/$${ifile}.hi-boot ghc/$${ifile}.$${j}; \
106 @touch ghc/IOBase.lhs
110 #-----------------------------------------------------------------------------
111 # Installation; need to install .hi files as well as libraries
113 # The interface files are put inside the $(libdir), since they
114 # might (potentially) be platform specific..
116 # Note: we use `override' here to ignore the setting of datadir
117 # which may have been set on the command-line..naughty, as it
118 # prevents `datadir' from being used from the command-line.
119 # This only applies to binary-distributions, though.n
121 ifeq "$(BIN_DIST)" "1"
122 override datadir:=$(libdir)/imports
124 datadir:=$(libdir)/imports
128 # Files to install from here
130 INSTALL_LIBS += $(LIBRARY)
131 INSTALL_DATAS += $(HS_IFACES)
133 include $(TOP)/mk/target.mk