rts_H_FILES = $(wildcard includes/*.h) $(wildcard rts/*.h)
+ifeq "$(HaveDtrace)" "YES"
+DTRACEPROBES_H = rts/dist/build/RtsProbes.h
+rts_H_FILES += $(DTRACEPROBES_H)
+endif
+
# collect the -l flags that we need to link the rts dyn lib.
rts/libs.depend : $(GHC_PKG_INPLACE)
"$(GHC_PKG_INPLACE)" field rts extra-libraries \
rts_dist_S_SRCS = $(rts_S_SRCS)
rts_dist_C_FILES = $(rts_C_SRCS) $(rts_thr_EXTRA_C_SRCS) $(rts_S_SRCS)
+# Hack: we define every way-related option here, so that we get (hopefully)
+# a superset of the dependencies. To do this properly, we should generate
+# a different set of dependencies for each way. Further hack: PROFILING an
+
+# TICKY_TICKY can't be used together, so we omit TICKY_TICKY for now.
+rts_dist_MKDEPENDC_OPTS += -DPROFILING -DTHREADED_RTS -DDEBUG
+
+ifeq "$(HaveDtrace)" "YES"
+
+rts_dist_MKDEPENDC_OPTS += -Irts/dist/build
+
+endif
+
$(eval $(call build-dependencies,rts,dist))
-$(rts_dist_depfile_c_asm) : libffi/dist-install/build/ffi.h
+$(rts_dist_depfile_c_asm) : libffi/dist-install/build/ffi.h $(DTRACEPROBES_H)
#-----------------------------------------------------------------------------
# libffi stuff
"$(HC)" -cpp -optc-include -optcdyn-wrapper-patchable-behaviour.h $(INPLACE_EXTRA_FLAGS) $< -o $@
# -----------------------------------------------------------------------------
+# compile dtrace probes if dtrace is supported
+
+ifeq "$(HaveDtrace)" "YES"
+
+rts_CC_OPTS += -DDTRACE
+rts_HC_OPTS += -DDTRACE
+
+DTRACEPROBES_SRC = rts/RtsProbes.d
+$(DTRACEPROBES_H): $(DTRACEPROBES_SRC) | $(dir $@)/.
+ "$(DTRACE)" $(filter -I%,$(rts_CC_OPTS)) -C -h -o $@ -s $<
+
+endif
+
+# -----------------------------------------------------------------------------
# build the static lib containing the C main symbol
rts/dist/build/libHSrtsmain.a : rts/dist/build/Main.o