Makefile 2.47 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 26 27 28 29
#################################################################################
#
#			    ghc/lib/Makefile
#
#		Makefile for building the GHC Prelude libraries umpteen ways
#
#	
#################################################################################

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

WAYS=$(GhcLibWays)

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

LIBRARY = libHSexts$(_way).a
HS_SRCS	= $(wildcard *.lhs)
HS_OBJS = $(HS_SRCS:.lhs=.$(way_)o)
LIBOBJS = $(HS_OBJS)
HS_IFACES= $(HS_SRCS:.lhs=.$(way_)hi)

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

SRC_HC_OPTS += -recomp -cpp -fglasgow-exts -fvia-C -Rghc-timing $(GhcLibHcOpts)

sof's avatar
sof committed
30 31 32 33
ifneq "$(way)" "dll"
SRC_HC_OPTS += -static
endif

34 35 36 37 38 39 40 41 42 43 44 45
#
# 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

46 47 48 49
# KSW 1998-12: had to increase some of the heap sizes by 2m to 6m for USP

Int_HC_OPTS          += -H20m -fno-prune-tydecls -monly-3-regs
Word_HC_OPTS         += -H20m -monly-3-regs
sof's avatar
sof committed
50
Foreign_HC_OPTS      += -fno-prune-tydecls
sof's avatar
sof committed
51
NativeInfo_HC_OPTS   += -fno-prune-tydecls
sof's avatar
sof committed
52 53 54
Dynamic_HC_OPTS	     += $(MAGIC_HSCPP_OPTS)

MAGIC_HSCPP_OPTS=-DBEGIN_FOR_GHC='-}' -DEND_FOR_GHC='{-' -DBEGIN_FOR_HUGS='{-' -DEND_FOR_HUGS='-}'
55 56 57 58

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

sof's avatar
sof committed
59
SRC_MKDEPENDHS_OPTS += -I$(GHC_INCLUDE_DIR) -optdep--include-prelude -optdep-w $(MAGIC_HSCPP_OPTS)
60

sof's avatar
sof committed
61 62 63 64 65 66 67 68
#-----------------------------------------------------------------------------
# 	Win32 DLL setup

DLL_NAME = HSexts.dll
DLL_IMPLIB_NAME = libHSexts_imp.a
SRC_BLD_DLL_OPTS += --export-all --output-def=HSexts.def
SRC_BLD_DLL_OPTS += -lwinmm -lHSrts_imp -lHS_cbits_imp -lHS_imp -lgmp -L. -L../../rts/gmp -L../../rts -L../std -L../std/cbits

69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
#-----------------------------------------------------------------------------
# 	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/exts

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

include $(TOP)/mk/target.mk