TOP = ..
# Use GHC for compiling C bits (NB. must be before boilerplate include)
-# NB. this requires BootingFromHc to be set on the make command line!
#
-ifneq "$(BootingFromHc)" "YES"
UseGhcForCc = YES
-endif
include $(TOP)/mk/boilerplate.mk
ALL_DIRS = \
utils basicTypes types hsSyn prelude rename typecheck deSugar coreSyn \
specialise simplCore stranal stgSyn simplStg codeGen absCSyn main \
- profiling parser cprAnalysis compMan ndpFlatten
+ profiling parser cprAnalysis compMan ndpFlatten cbits
# Make sure we include Config.hs even if it doesn't exist yet...
ALL_SRCS += $(CONFIG_HS)
rename/RnMonad_HC_OPTS = -O2 -O2-for-C
endif
-utils/StringBuffer_HC_OPTS = -fvia-C -fno-prune-tydecls
utils/Digraph_HC_OPTS = -fglasgow-exts
ifeq "$(bootstrapped)" "YES"
CLEAN_FILES += prelude/primops.txt
CLEAN_FILES += $(PRIMOP_BITS)
-SRC_CPP_OPTS += -I$(GHC_INCLUDE_DIR) -traditional
+SRC_CPP_OPTS += -I$(GHC_INCLUDE_DIR)
SRC_CPP_OPTS += ${GhcCppOpts}
ifneq "$(BootingFromHc)" "YES"
# Must do this *after* including target.mk, because $(HS_SRCS) isn't set yet.
depend :: $(HS_SRCS) $(C_SRCS)
+ touch .depend-BASE
+ifneq "$(BootingFromHc)" "YES"
$(MKDEPENDHS) -M -optdep-f -optdep.depend-BASE $(foreach way,$(WAYS),-optdep-s -optdep$(way)) $(foreach obj,$(MKDEPENDHS_OBJ_SUFFICES),-osuf $(obj)) $(MKDEPENDHS_OPTS) $(filter-out -split-objs, $(MKDEPENDHS_HC_OPTS)) $(HS_SRCS)
+endif
$(MKDEPENDC) -f .depend-BASE $(MKDEPENDC_OPTS) $(foreach way,$(WAYS),-s $(way)) -- $(CC_OPTS) -- $(C_SRCS)
$(PERL) -pe 'binmode(stdin); binmode(stdout); s@^(\S*\.o)@stage$(stage)/$$1@g; s@(\S*\.hi)@stage$(stage)/$$1@g' <.depend-BASE >.depend-$(stage)
# The binmode stuff tells perl not to add stupid ^M's to the output