Enable -prof -threaded (#886)
[ghc-hetmet.git] / rts / Makefile
index 943f3fe..d88a823 100644 (file)
@@ -93,6 +93,15 @@ endif
 
 EXCLUDED_SRCS += parallel/SysMan.c
 
+EXCLUDED_SRCS += dyn-wrapper.c
+
+# compile generatic patchable dyn-wrapper
+
+DYNWRAPPER_SRC = dyn-wrapper.c
+DYNWRAPPER_PROG = dyn-wrapper$(exeext)
+$(DYNWRAPPER_PROG): $(DYNWRAPPER_SRC)
+       $(HC) -cpp -optc-include -optcdyn-wrapper-patchable-behaviour.h $(INPLACE_EXTRA_FLAGS) $< -o $@
+
 # The build system doesn't give us these
 CMM_SRCS = $(filter-out AutoApply%.cmm, $(wildcard *.cmm)) $(EXTRA_CMM_SRCS)
 CMM_OBJS = $(patsubst %.cmm,%.$(way_)o, $(CMM_SRCS))
@@ -148,6 +157,11 @@ SRC_CC_OPTS += -DNOSMP
 SRC_HC_OPTS += -optc-DNOSMP
 endif
 
+ifeq "$(UseLibFFI)" "YES"
+SRC_CC_OPTS += -DUSE_LIBFFI
+PACKAGE_CPP_OPTS += -DUSE_LIBFFI
+endif
+
 ifneq "$(DYNAMIC_RTS)" "YES"
 SRC_HC_OPTS += -static
 else
@@ -163,13 +177,13 @@ LIB_LD_OPTS = -L$(shell $(GHC_PKG_INPLACE) field base library-dirs | sed -e 's/l
 endif
 endif
 
-ifeq "$(Windows)" "YES"
-# On Windows GHC does its own commandline parsing, so we need extra
-# doublequote protection. Sigh.
-DQ = \\\"
-else
+# Mac OS X: make sure we compile for the right OS version
+SRC_CC_OPTS += $(MACOSX_DEPLOYMENT_CC_OPTS)
+SRC_HC_OPTS += $(addprefix -optc, $(MACOSX_DEPLOYMENT_CC_OPTS))
+LIB_LD_OPTS += $(addprefix -optl, $(MACOSX_DEPLOYMENT_LD_OPTS))
+
+# XXX DQ is now the same on all platforms, so get rid of it
 DQ = \"
-endif
 
 # If Main.c is built with optimisation then the SEH exception stuff on
 # Windows gets confused.