root/rts/ghc.mk

Revision 6582871e92a12d3e4ffc5cae1eea37f7d88cb558, 18.0 KB (checked in by Ian Lynagh <igloo@…>, 29 hours ago)

Test USE_MINIINTERPRETER rather than GhcUnregisterised?

  • Property mode set to 100644
Line 
1# -----------------------------------------------------------------------------
2#
3# (c) 2009 The University of Glasgow
4#
5# This file is part of the GHC build system.
6#
7# To understand how the build system works and how to modify it, see
8#      http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
9#      http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
10#
11# -----------------------------------------------------------------------------
12
13# -----------------------------------------------------------------------------
14# Building the RTS
15
16# We build the RTS with stage 1
17rts_dist_HC = $(GHC_STAGE1)
18
19# merge GhcLibWays and GhcRTSWays but strip out duplicates
20rts_WAYS = $(GhcLibWays) $(filter-out $(GhcLibWays),$(GhcRTSWays))
21rts_dist_WAYS = $(rts_WAYS)
22
23ALL_RTS_LIBS = $(foreach way,$(rts_WAYS),rts/dist/build/libHSrts$($(way)_libsuf))
24all_rts : $(ALL_RTS_LIBS)
25
26# -----------------------------------------------------------------------------
27# Defining the sources
28
29ALL_DIRS = hooks parallel sm eventlog
30
31ifeq "$(HostOS_CPP)" "mingw32"
32ALL_DIRS += win32
33else
34ALL_DIRS += posix
35endif
36
37EXCLUDED_SRCS :=
38EXCLUDED_SRCS += rts/parallel/SysMan.c
39EXCLUDED_SRCS += $(wildcard rts/Vis*.c)
40
41rts_C_SRCS := $(filter-out $(EXCLUDED_SRCS),$(wildcard rts/*.c $(foreach dir,$(ALL_DIRS),rts/$(dir)/*.c)))
42rts_CMM_SRCS := $(wildcard rts/*.cmm)
43
44# Don't compile .S files when bootstrapping a new arch
45ifneq "$(PORTING_HOST)" "YES"
46ifneq "$(findstring $(TargetArch_CPP), i386 powerpc powerpc64)" ""
47rts_S_SRCS += rts/AdjustorAsm.S
48endif
49endif
50
51ifeq "$(GhcUnregisterised)" "YES"
52GENAPPLY_OPTS = -u
53endif
54
55rts_AUTO_APPLY_CMM = rts/dist/build/AutoApply.cmm
56
57$(rts_AUTO_APPLY_CMM): $(GENAPPLY_INPLACE)
58        "$(GENAPPLY_INPLACE)" >$@
59
60rts/dist/build/sm/Evac_thr.c : rts/sm/Evac.c | $$(dir $$@)/.
61        cp $< $@
62rts/dist/build/sm/Scav_thr.c : rts/sm/Scav.c | $$(dir $$@)/.
63        cp $< $@
64
65rts_H_FILES := $(wildcard rts/*.h rts/*/*.h)
66
67ifeq "$(USE_DTRACE)" "YES"
68DTRACEPROBES_H = rts/dist/build/RtsProbes.h
69rts_H_FILES += $(DTRACEPROBES_H)
70endif
71
72# collect the -l flags that we need to link the rts dyn lib.
73rts/libs.depend : $(GHC_PKG_INPLACE)
74        "$(GHC_PKG_INPLACE)" field rts extra-libraries \
75          | sed -e 's/^extra-libraries: //' -e 's/\([a-z0-9]*\)[ ]*/-l\1 /g' > $@
76
77
78# ----------------------------------------------------------------------------
79# On Windows, as the RTS and base libraries have recursive imports,
80#       we have to break the loop with "import libraries".
81#       These are made from rts/win32/libHS*.def which contain lists of
82#       all the symbols in those libraries used by the RTS.
83#
84ifeq "$(HostOS_CPP)" "mingw32"
85
86ALL_RTS_DEF_LIBNAMES    = base ghc-prim
87ALL_RTS_DEF_LIBS        = \
88        rts/dist/build/win32/libHSbase.dll.a \
89        rts/dist/build/win32/libHSghc-prim.dll.a
90
91# -- import libs for the regular Haskell libraries
92define make-importlib-def # args $1 = lib name
93rts/dist/build/win32/libHS$1.def : rts/win32/libHS$1.def
94        cat rts/win32/libHS$1.def \
95                | sed "s/@LibVersion@/$$(libraries/$1_dist-install_VERSION)/" \
96                | sed "s/@ProjectVersion@/$$(ProjectVersion)/" \
97                > rts/dist/build/win32/libHS$1.def
98
99rts/dist/build/win32/libHS$1.dll.a : rts/dist/build/win32/libHS$1.def
100        "$$(DLLTOOL)"   -d rts/dist/build/win32/libHS$1.def \
101                        -l rts/dist/build/win32/libHS$1.dll.a
102endef
103$(foreach lib,$(ALL_RTS_DEF_LIBNAMES),$(eval $(call make-importlib-def,$(lib))))
104endif
105
106ifneq "$(BINDIST)" "YES"
107rts_ffi_objs_stamp = rts/dist/ffi/stamp
108rts_ffi_objs       = rts/dist/ffi/*.o
109$(rts_ffi_objs_stamp): $(libffi_STATIC_LIB) $(TOUCH_DEP) | $$(dir $$@)/.
110        cd rts/dist/ffi && $(AR) x ../../../$(libffi_STATIC_LIB)
111        "$(TOUCH_CMD)" $@
112
113# This is a little hacky. We don't know the SO version, so we only
114# depend on libffi.so, but copy libffi.so*
115rts/dist/build/libffi$(soext): libffi/build/inst/lib/libffi$(soext)
116        cp libffi/build/inst/lib/libffi$(soext)* rts/dist/build
117
118rts/dist/build/$(LIBFFI_DLL): libffi/build/inst/bin/$(LIBFFI_DLL)
119        cp $< $@
120endif
121
122#-----------------------------------------------------------------------------
123# Building one way
124define build-rts-way # args: $1 = way
125
126ifneq "$$(BINDIST)" "YES"
127
128# The per-way CC_OPTS
129ifneq "$$(findstring debug, $1)" ""
130rts_dist_$1_HC_OPTS =
131rts_dist_$1_CC_OPTS = -g -O0
132else
133rts_dist_$1_HC_OPTS = $$(GhcRtsHcOpts)
134rts_dist_$1_CC_OPTS = $$(GhcRtsCcOpts)
135endif
136
137ifneq "$$(findstring dyn, $1)" ""
138ifeq "$$(HostOS_CPP)" "mingw32"
139rts_dist_$1_CC_OPTS += -DCOMPILING_WINDOWS_DLL
140endif
141endif
142
143ifneq "$$(findstring thr, $1)" ""
144rts_$1_EXTRA_C_SRCS  =  rts/dist/build/sm/Evac_thr.c rts/dist/build/sm/Scav_thr.c
145endif
146
147$(call distdir-way-opts,rts,dist,$1)
148$(call c-suffix-rules,rts,dist,$1,YES)
149$(call cmm-suffix-rules,rts,dist,$1)
150$(call hs-suffix-rules-srcdir,rts,dist,$1,.)
151# hs-suffix-rules-srcdir is needed when BootingFromHc to get the .hc rules
152
153rts_$1_LIB_NAME = libHSrts$$($1_libsuf)
154rts_$1_LIB = rts/dist/build/$$(rts_$1_LIB_NAME)
155
156rts_$1_C_OBJS   = $$(patsubst rts/%.c,rts/dist/build/%.$$($1_osuf),$$(rts_C_SRCS)) $$(patsubst %.c,%.$$($1_osuf),$$(rts_$1_EXTRA_C_SRCS))
157rts_$1_S_OBJS   = $$(patsubst rts/%.S,rts/dist/build/%.$$($1_osuf),$$(rts_S_SRCS))
158rts_$1_CMM_OBJS = $$(patsubst rts/%.cmm,rts/dist/build/%.$$($1_osuf),$$(rts_CMM_SRCS)) $$(patsubst %.cmm,%.$$($1_osuf),$$(rts_AUTO_APPLY_CMM))
159
160rts_$1_OBJS = $$(rts_$1_C_OBJS) $$(rts_$1_S_OBJS) $$(rts_$1_CMM_OBJS)
161
162ifeq "$(USE_DTRACE)" "YES"
163ifeq "$(TargetOS_CPP)" "solaris2"
164# On Darwin we don't need to generate binary containing probes defined
165# in DTrace script, but DTrace on Solaris expects generation of binary
166# from the DTrace probes definitions
167rts_$1_DTRACE_OBJS = rts/dist/build/RtsProbes.$$($1_osuf)
168
169rts/dist/build/RtsProbes.$$($1_osuf) : $$(rts_$1_OBJS)
170        $(DTRACE) -G -C $$(addprefix -I,$$(GHC_INCLUDE_DIRS)) -DDTRACE -s rts/RtsProbes.d -o \
171                $$@ $$(rts_$1_OBJS)
172endif
173endif
174
175rts_dist_$1_CC_OPTS += -DRtsWay=\"rts_$1\"
176
177# Making a shared library for the RTS.
178ifneq "$$(findstring dyn, $1)" ""
179ifeq "$$(HostOS_CPP)" "mingw32"
180$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend rts/dist/build/$$(LIBFFI_DLL)
181        "$$(RM)" $$(RM_OPTS) $$@
182        "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \
183          -no-auto-link-packages -Lrts/dist/build -l$(LIBFFI_WINDOWS_LIB) `cat rts/libs.depend` $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) -o $$@
184else
185$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend rts/dist/build/libffi$$(soext)
186        "$$(RM)" $$(RM_OPTS) $$@
187        "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \
188          -no-auto-link-packages -Lrts/dist/build -lffi `cat rts/libs.depend` $$(rts_$1_OBJS) \
189          $$(rts_$1_DTRACE_OBJS) -o $$@
190ifeq "$$(darwin_HOST_OS)" "1"
191        # Ensure library's install name is correct before anyone links with it.
192        install_name_tool -id $$(ghclibdir)/$$(rts_$1_LIB_NAME) $$@
193endif
194endif
195else
196$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) $$(rts_ffi_objs_stamp)
197        "$$(RM)" $$(RM_OPTS) $$@
198        echo $$(rts_ffi_objs) $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR_STAGE1)" \
199                $$(AR_OPTS_STAGE1) $$(EXTRA_AR_ARGS_STAGE1) $$@
200endif
201
202endif
203
204endef
205
206# And expand the above for each way:
207$(foreach way,$(rts_WAYS),$(eval $(call build-rts-way,$(way))))
208
209#-----------------------------------------------------------------------------
210# Flags for compiling every file
211
212# We like plenty of warnings.
213WARNING_OPTS += -Wall
214ifeq "$(GccLT34)" "YES"
215WARNING_OPTS += -W
216else
217WARNING_OPTS += -Wextra
218endif
219WARNING_OPTS += -Wstrict-prototypes
220WARNING_OPTS += -Wmissing-prototypes
221WARNING_OPTS += -Wmissing-declarations
222WARNING_OPTS += -Winline
223WARNING_OPTS += -Waggregate-return
224WARNING_OPTS += -Wpointer-arith
225WARNING_OPTS += -Wmissing-noreturn
226WARNING_OPTS += -Wnested-externs
227WARNING_OPTS += -Wredundant-decls
228
229# These ones are hard to avoid:
230#WARNING_OPTS += -Wconversion
231#WARNING_OPTS += -Wbad-function-cast
232#WARNING_OPTS += -Wshadow
233#WARNING_OPTS += -Wcast-qual
234
235# This one seems buggy on GCC 4.1.2, which is the only GCC version we
236# have that can bootstrap the SPARC build. We end up with lots of supurious
237# warnings of the form "cast increases required alignment of target type".
238# Some legitimate warnings can be fixed by adding an intermediate cast to
239# (void*), but we get others in rts/sm/GCUtils.c concerning the gct var
240# that look innocuous to me. We could enable this again once we deprecate
241# support for registerised builds on this arch. -- BL 2010/02/03
242# WARNING_OPTS += -Wcast-align
243
244STANDARD_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS)) -Irts -Irts/dist/build
245# COMPILING_RTS is only used when building Win32 DLL support.
246STANDARD_OPTS += -DCOMPILING_RTS
247
248# HC_OPTS is included in both .c and .cmm compilations, whereas CC_OPTS is
249# only included in .c compilations.  HC_OPTS included the WAY_* opts, which
250# must be included in both types of compilations.
251
252rts_CC_OPTS += $(WARNING_OPTS)
253rts_CC_OPTS += $(STANDARD_OPTS)
254
255rts_HC_OPTS += $(STANDARD_OPTS) -package-name rts
256
257ifneq "$(GhcWithSMP)" "YES"
258rts_CC_OPTS += -DNOSMP
259rts_HC_OPTS += -optc-DNOSMP
260endif
261
262ifeq "$(UseLibFFIForAdjustors)" "YES"
263rts_CC_OPTS += -DUSE_LIBFFI_FOR_ADJUSTORS
264endif
265
266# Mac OS X: make sure we compile for the right OS version
267rts_CC_OPTS += $(MACOSX_DEPLOYMENT_CC_OPTS)
268rts_HC_OPTS += $(addprefix -optc, $(MACOSX_DEPLOYMENT_CC_OPTS))
269rts_LD_OPTS += $(addprefix -optl, $(MACOSX_DEPLOYMENT_LD_OPTS))
270
271# We *want* type-checking of hand-written cmm.
272rts_HC_OPTS += -dcmm-lint
273
274# -fno-strict-aliasing is required for the runtime, because we often
275# use a variety of types to represent closure pointers (StgPtr,
276# StgClosure, StgMVar, etc.), and without -fno-strict-aliasing gcc is
277# allowed to assume that these pointers do not alias.  eg. without
278# this flag we get problems in sm/Evac.c:copy() with gcc 3.4.3, the
279# upd_evacee() assigments get moved before the object copy.
280rts_CC_OPTS += -fno-strict-aliasing
281
282rts_CC_OPTS += -fno-common
283
284ifeq "$(BeConservative)" "YES"
285rts_CC_OPTS += -DBE_CONSERVATIVE
286endif
287
288#-----------------------------------------------------------------------------
289# Flags for compiling specific files
290
291# If RtsMain.c is built with optimisation then the SEH exception stuff on
292# Windows gets confused.
293# This has to be in HC rather than CC opts, as otherwise there's a
294# -optc-O2 that comes after it.
295rts/RtsMain_HC_OPTS += -optc-O0
296
297rts/RtsMessages_CC_OPTS += -DProjectVersion=\"$(ProjectVersion)\"
298rts/RtsUtils_CC_OPTS += -DProjectVersion=\"$(ProjectVersion)\"
299rts/Trace_CC_OPTS += -DProjectVersion=\"$(ProjectVersion)\"
300#
301rts/RtsUtils_CC_OPTS += -DHostPlatform=\"$(HOSTPLATFORM)\"
302rts/RtsUtils_CC_OPTS += -DHostArch=\"$(HostArch_CPP)\"
303rts/RtsUtils_CC_OPTS += -DHostOS=\"$(HostOS_CPP)\"
304rts/RtsUtils_CC_OPTS += -DHostVendor=\"$(HostVendor_CPP)\"
305#
306rts/RtsUtils_CC_OPTS += -DBuildPlatform=\"$(BUILDPLATFORM)\"
307rts/RtsUtils_CC_OPTS += -DBuildArch=\"$(BuildArch_CPP)\"
308rts/RtsUtils_CC_OPTS += -DBuildOS=\"$(BuildOS_CPP)\"
309rts/RtsUtils_CC_OPTS += -DBuildVendor=\"$(BuildVendor_CPP)\"
310#
311rts/RtsUtils_CC_OPTS += -DTargetPlatform=\"$(TARGETPLATFORM)\"
312rts/RtsUtils_CC_OPTS += -DTargetArch=\"$(TargetArch_CPP)\"
313rts/RtsUtils_CC_OPTS += -DTargetOS=\"$(TargetOS_CPP)\"
314rts/RtsUtils_CC_OPTS += -DTargetVendor=\"$(TargetVendor_CPP)\"
315#
316rts/RtsUtils_CC_OPTS += -DGhcUnregisterised=\"$(GhcUnregisterised)\"
317rts/RtsUtils_CC_OPTS += -DGhcEnableTablesNextToCode=\"$(GhcEnableTablesNextToCode)\"
318
319# Compile various performance-critical pieces *without* -fPIC -dynamic
320# even when building a shared library.  If we don't do this, then the
321# GC runs about 50% slower on x86 due to the overheads of PIC.  The
322# cost of doing this is a little runtime linking and less sharing, but
323# not much.
324#
325# On x86_64 this doesn't work, because all objects in a shared library
326# must be compiled with -fPIC (since the 32-bit relocations generated
327# by the default small memory can't be resolved at runtime).  So we
328# only do this on i386.
329#
330# This apparently doesn't work on OS X (Darwin) nor on Solaris.
331# On Darwin we get errors of the form
332#
333#  ld: absolute addressing (perhaps -mdynamic-no-pic) used in _stg_ap_0_fast from rts/dist/build/Apply.dyn_o not allowed in slidable image
334#
335# and lots of these warnings:
336#
337#  ld: warning codegen in _stg_ap_pppv_fast (offset 0x0000005E) prevents image from loading in dyld shared cache
338#
339# On Solaris we get errors like:
340#
341# Text relocation remains                         referenced
342#     against symbol                  offset      in file
343# .rodata (section)                   0x11        rts/dist/build/Apply.dyn_o
344#   ...
345# ld: fatal: relocations remain against allocatable but non-writable sections
346# collect2: ld returned 1 exit status
347
348ifeq "$(TargetArch_CPP)" "i386"
349i386_SPEED_HACK := "YES"
350ifeq "$(TargetOS_CPP)" "darwin"
351i386_SPEED_HACK := "NO"
352endif
353ifeq "$(TargetOS_CPP)" "solaris2"
354i386_SPEED_HACK := "NO"
355endif
356endif
357
358ifeq "$(TargetArch_CPP)" "i386"
359ifeq "$(i386_SPEED_HACK)" "YES"
360rts/sm/Evac_HC_OPTS           += -fno-PIC
361rts/sm/Evac_thr_HC_OPTS       += -fno-PIC
362rts/sm/Scav_HC_OPTS           += -fno-PIC
363rts/sm/Scav_thr_HC_OPTS       += -fno-PIC
364rts/sm/Compact_HC_OPTS        += -fno-PIC
365rts/sm/GC_HC_OPTS             += -fno-PIC
366
367# -static is also necessary for these bits, otherwise the NCG
368# -generates dynamic references:
369rts/Updates_HC_OPTS += -fno-PIC -static
370rts/StgMiscClosures_HC_OPTS += -fno-PIC -static
371rts/PrimOps_HC_OPTS += -fno-PIC -static
372rts/Apply_HC_OPTS += -fno-PIC -static
373rts/dist/build/AutoApply_HC_OPTS += -fno-PIC -static
374endif
375endif
376
377# ffi.h triggers prototype warnings, so disable them here:
378rts/Interpreter_CC_OPTS += -Wno-strict-prototypes
379rts/Adjustor_CC_OPTS    += -Wno-strict-prototypes
380rts/sm/Storage_CC_OPTS  += -Wno-strict-prototypes
381
382# inlining warnings happen in Compact
383rts/sm/Compact_CC_OPTS += -Wno-inline
384
385# emits warnings about call-clobbered registers on x86_64
386rts/StgCRun_CC_OPTS += -w
387
388rts/RetainerProfile_CC_OPTS += -w
389rts/RetainerSet_CC_OPTS += -Wno-format
390# On Windows:
391rts/win32/ConsoleHandler_CC_OPTS += -w
392rts/win32/ThrIOManager_CC_OPTS += -w
393# The above warning supression flags are a temporary kludge.
394# While working on this module you are encouraged to remove it and fix
395# any warnings in the module. See
396#     http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings
397# for details
398
399# Without this, thread_obj will not be inlined (at least on x86 with GCC 4.1.0)
400rts/sm/Compact_CC_OPTS += -finline-limit=2500
401
402# -O3 helps unroll some loops (especially in copy() with a constant argument).
403rts/sm/Evac_CC_OPTS += -funroll-loops
404rts/dist/build/sm/Evac_thr_HC_OPTS += -optc-funroll-loops
405
406# These files are just copies of sm/Evac.c and sm/Scav.c respectively,
407# but compiled with -DPARALLEL_GC.
408rts/dist/build/sm/Evac_thr_CC_OPTS += -DPARALLEL_GC -Irts/sm
409rts/dist/build/sm/Scav_thr_CC_OPTS += -DPARALLEL_GC -Irts/sm
410
411#-----------------------------------------------------------------------------
412# Add PAPI library if needed
413
414ifeq "$(GhcRtsWithPapi)" "YES"
415
416rts_CC_OPTS             += -DUSE_PAPI
417
418rts_PACKAGE_CPP_OPTS    += -DUSE_PAPI
419rts_PACKAGE_CPP_OPTS    += -DPAPI_INCLUDE_DIR=$(PapiIncludeDir)
420rts_PACKAGE_CPP_OPTS    += -DPAPI_LIB_DIR=$(PapiLibDir)
421
422ifneq "$(PapiIncludeDir)" ""
423rts_HC_OPTS     += -I$(PapiIncludeDir)
424rts_CC_OPTS     += -I$(PapiIncludeDir)
425rts_HSC2HS_OPTS += -I$(PapiIncludeDir)
426endif
427ifneq "$(PapiLibDirs)" ""
428rts_LD_OPTS     += -L$(PapiLibDirs)
429endif
430
431else # GhcRtsWithPapi==YES
432
433rts_PACKAGE_CPP_OPTS += -DPAPI_INCLUDE_DIR=""
434rts_PACKAGE_CPP_OPTS += -DPAPI_LIB_DIR=""
435
436endif
437
438# -----------------------------------------------------------------------------
439# dependencies
440
441rts_WAYS_DASHED = $(subst $(space),,$(patsubst %,-%,$(strip $(rts_WAYS))))
442rts_dist_depfile_base = rts/dist/build/.depend$(rts_WAYS_DASHED)
443
444rts_dist_C_SRCS  = $(rts_C_SRCS) $(rts_thr_EXTRA_C_SRCS)
445rts_dist_S_SRCS =  $(rts_S_SRCS)
446rts_dist_C_FILES = $(rts_C_SRCS) $(rts_thr_EXTRA_C_SRCS) $(rts_S_SRCS)
447
448# Hack: we define every way-related option here, so that we get (hopefully)
449# a superset of the dependencies.  To do this properly, we should generate
450# a different set of dependencies for each way.  Further hack: PROFILING an
451
452# TICKY_TICKY can't be used together, so we omit TICKY_TICKY for now.
453rts_dist_MKDEPENDC_OPTS += -DPROFILING -DTHREADED_RTS -DDEBUG
454
455ifeq "$(USE_DTRACE)" "YES"
456
457rts_dist_MKDEPENDC_OPTS += -Irts/dist/build
458
459endif
460
461$(eval $(call dependencies,rts,dist,1))
462
463$(rts_dist_depfile_c_asm) : $(libffi_HEADERS) $(DTRACEPROBES_H)
464
465# -----------------------------------------------------------------------------
466# compile dtrace probes if dtrace is supported
467
468ifeq "$(USE_DTRACE)" "YES"
469
470rts_CC_OPTS             += -DDTRACE
471rts_HC_OPTS             += -DDTRACE
472
473# Apple's dtrace (the only one supported by ghc at the moment) uses
474# gcc as its preprocessor. If gcc isn't at /usr/bin/gcc, or we need
475# to force it to use a different gcc, we need to give the path in
476# the option cpppath.
477
478ifeq "$(TargetOS_CPP)" "darwin"
479# Darwin has a flag to tell dtrace which cpp to use.
480# Unfortunately, this isn't supported on Solaris (See Solaris Dynamic Tracing
481# Guide, Chapter 16, for the configuration variables available on Solaris)
482DTRACE_FLAGS = -x cpppath=$(WhatGccIsCalled)
483endif
484
485DTRACEPROBES_SRC = rts/RtsProbes.d
486$(DTRACEPROBES_H): $(DTRACEPROBES_SRC) includes/ghcplatform.h | $$(dir $$@)/.
487        "$(DTRACE)" $(filter -I%,$(rts_CC_OPTS)) -C $(DTRACE_FLAGS) -h -o $@ -s $<
488endif
489
490# -----------------------------------------------------------------------------
491# The RTS package config
492
493# If -DDEBUG is in effect, adjust package conf accordingly..
494ifneq "$(strip $(filter -optc-DDEBUG,$(GhcRtsHcOpts)))" ""
495rts_PACKAGE_CPP_OPTS += -DDEBUG
496endif
497
498ifeq "$(HaveLibMingwEx)" "YES"
499rts_PACKAGE_CPP_OPTS += -DHAVE_LIBMINGWEX
500endif
501
502$(eval $(call manual-package-config,rts))
503
504ifneq "$(BootingFromHc)" "YES"
505rts/package.conf.inplace : $(includes_H_CONFIG) $(includes_H_PLATFORM)
506endif
507
508# -----------------------------------------------------------------------------
509# installing
510
511INSTALL_LIBS += $(ALL_RTS_LIBS)
512INSTALL_LIBS += $(wildcard rts/dist/build/libffi$(soext)*)
513INSTALL_LIBS += $(wildcard rts/dist/build/$(LIBFFI_DLL))
514
515install: install_libffi_headers
516
517.PHONY: install_libffi_headers
518install_libffi_headers :
519        $(call INSTALL_DIR,"$(DESTDIR)$(ghcheaderdir)")
520        $(call INSTALL_HEADER,$(INSTALL_OPTS),$(libffi_HEADERS),"$(DESTDIR)$(ghcheaderdir)/")
521
522# -----------------------------------------------------------------------------
523# cleaning
524
525$(eval $(call clean-target,rts,dist,rts/dist))
526
527BINDIST_EXTRAS += rts/package.conf.in
Note: See TracBrowser for help on using the browser.