1 # Local GHC-build-tree customization for Cabal makefiles. We want to build
2 # libraries using flags that the user has put in build.mk/validate.mk and
3 # appropriate flags for Mac OS X deployment targets.
5 # Careful here: including boilerplate.mk breaks things, because paths.mk and
6 # opts.mk overrides some of the variable settings in the Cabal Makefile, so
7 # we just include config.mk and custom-settings.mk.
12 include $(TOP)/mk/config.mk
13 include $(TOP)/mk/custom-settings.mk
18 # Now add flags from the GHC build system to the Cabal build:
19 GHC_CC_OPTS += $(addprefix -optc, $(MACOSX_DEPLOYMENT_CC_OPTS))
20 GHC_OPTS += $(SRC_HC_OPTS)
21 GHC_OPTS += $(GhcHcOpts)
22 GHC_OPTS += $(GhcStage$(stage)HcOpts)
23 GHC_OPTS += $(addprefix -optc, $(MACOSX_DEPLOYMENT_CC_OPTS))
24 LIB_LD_OPTS += $(addprefix -optl, $(MACOSX_DEPLOYMENT_LD_OPTS))
26 # XXX These didn't work in the old build system, according to the
27 # comment at least. We should actually handle them properly at some
30 # Some .hs files #include other source files, but since ghc -M doesn't spit out
31 # these dependencies we have to include them manually.
33 # We don't add dependencies on HsVersions.h, ghcautoconf.h, or ghc_boot_platform.h,
34 # because then modifying one of these files would force recompilation of everything,
35 # which is probably not what you want. However, it does mean you have to be
36 # careful to recompile stuff you need if you reconfigure or change HsVersions.h.
38 # Aargh, these don't work properly anyway, because GHC's recompilation checker
39 # just reports "compilation NOT required". Do we have to add -fforce-recomp for each
40 # of these .hs files? I haven't done anything about this yet.
42 # $(odir)/codeGen/Bitmap.$(way_)o : ../includes/MachDeps.h
43 # $(odir)/codeGen/CgCallConv.$(way_)o : ../includes/StgFun.h
44 # $(odir)/codeGen/CgProf.$(way_)o : ../includes/MachDeps.h
45 # $(odir)/codeGen/CgProf.$(way_)o : ../includes/Constants.h
46 # $(odir)/codeGen/CgProf.$(way_)o : ../includes/DerivedConstants.h
47 # $(odir)/codeGen/CgTicky.$(way_)o : ../includes/DerivedConstants.h
48 # $(odir)/codeGen/ClosureInfo.$(way_)o : ../includes/MachDeps.h
49 # $(odir)/codeGen/SMRep.$(way_)o : ../includes/MachDeps.h
50 # $(odir)/codeGen/SMRep.$(way_)o : ../includes/ClosureTypes.h
51 # $(odir)/ghci/ByteCodeAsm.$(way_)o : ../includes/Bytecodes.h
52 # $(odir)/ghci/ByteCodeFFI.$(way_)o : nativeGen/NCG.h
53 # $(odir)/ghci/ByteCodeInstr.$(way_)o : ../includes/MachDeps.h
54 # $(odir)/ghci/ByteCodeItbls.$(way_)o : ../includes/ClosureTypes.h
55 # $(odir)/ghci/ByteCodeItbls.$(way_)o : nativeGen/NCG.h
56 # $(odir)/main/Constants.$(way_)o : ../includes/MachRegs.h
57 # $(odir)/main/Constants.$(way_)o : ../includes/Constants.h
58 # $(odir)/main/Constants.$(way_)o : ../includes/MachDeps.h
59 # $(odir)/main/Constants.$(way_)o : ../includes/DerivedConstants.h
60 # $(odir)/main/Constants.$(way_)o : ../includes/GHCConstants.h
61 # $(odir)/nativeGen/AsmCodeGen.$(way_)o : nativeGen/NCG.h
62 # $(odir)/nativeGen/MachCodeGen.$(way_)o : nativeGen/NCG.h
63 # $(odir)/nativeGen/MachCodeGen.$(way_)o : ../includes/MachDeps.h
64 # $(odir)/nativeGen/MachInstrs.$(way_)o : nativeGen/NCG.h
65 # $(odir)/nativeGen/MachRegs.$(way_)o : nativeGen/NCG.h
66 # $(odir)/nativeGen/MachRegs.$(way_)o : ../includes/MachRegs.h
67 # $(odir)/nativeGen/PositionIndependentCode.$(way_)o : nativeGen/NCG.h
68 # $(odir)/nativeGen/PprMach.$(way_)o : nativeGen/NCG.h
69 # $(odir)/nativeGen/RegAllocInfo.$(way_)o : nativeGen/NCG.h
70 # $(odir)/typecheck/TcForeign.$(way_)o : nativeGen/NCG.h
71 # $(odir)/utils/Binary.$(way_)o : ../includes/MachDeps.h
72 # $(odir)/utils/FastMutInt.$(way_)o : ../includes/MachDeps.h
73 # $(PRIMOP_BITS) is defined in Makefile
74 # $(odir)/prelude/PrimOp.o: $(PRIMOP_BITS)