2 define build-dependencies # args: $1 = dir, $2 = distdir
4 ifeq "$$($1_$2_ghc_ge_609)" "YES"
5 $1_$2_MKDEPENDHS_FLAGS = -include-pkg-deps -dep-makefile $$($1_$2_depfile) $$(foreach way,$$(filter-out v,$$($1_$2_WAYS)),-dep-suffix $$(way))
7 $1_$2_MKDEPENDHS_FLAGS = -optdep--include-pkg-deps -optdep-f -optdep$$($1_$2_depfile) $$(foreach way,$$(filter-out v,$$($1_$2_WAYS)),-optdep-s -optdep$$(way))
10 ifneq "$$($1_$2_NO_BUILD_DEPS)" "YES"
12 $$($1_$2_depfile) : $$(MKDIRHIER) $$(MKDEPENDC) $$($1_$2_HS_SRCS) $$($1_$2_HS_BOOT_SRCS) $$($1_$2_HC_MK_DEPEND_DEP) $$($1_$2_C_FILES) $$($1_$2_S_FILES)
13 $$(MKDIRHIER) $1/$2/build
16 ifneq "$$($1_$2_C_SRCS)$$($1_$2_S_SRCS)" ""
17 $$(MKDEPENDC) -f $$($1_$2_depfile).tmp $$($1_MKDEPENDC_OPTS) $$(foreach way,$$($1_WAYS),-s $$(way)) -- $$($1_$2_v_ALL_CC_OPTS) -- $$($1_$2_C_FILES) $$($1_$2_S_FILES) || ( $$(RM) $$@; exit 1 )
18 sed -e "s|$1/\([^ :]*o[ :]\)|$1/$2/build/\1|g" -e "s|$(TOP)/||" <$$($1_$2_depfile).tmp >$$($1_$2_depfile)
20 ifneq "$$($1_$2_HS_SRCS)" ""
21 $$($1_$2_HC_MK_DEPEND) -M $$($1_$2_MKDEPENDHS_FLAGS) \
22 $$(filter-out -split-objs, $$($1_$2_v_ALL_HC_OPTS)) \
23 $$($1_$2_HS_SRCS) || ( $$(RM) $$@; exit 1 )
25 echo "$1_$2_depfile_EXISTS = YES" >> $$@
26 ifneq "$$($1_$2_SLASH_MODS)" ""
27 for dir in $$(sort $$(foreach mod,$$($1_$2_SLASH_MODS),$1/$2/build/$$(dir $$(mod)))); do \
28 if test ! -d $$$$dir; then mkdir -p $$$$dir; fi \
32 endif # $1_$2_NO_BUILD_DEPS
34 # Note sed magic above: mkdependC can't do -odir stuff, so we have to
35 # munge the dependencies it generates to refer to the correct targets.
37 # Seems as good a place as any to attach the unlit dependency
38 $$($1_$2_depfile) : $$(UNLIT)
40 ifneq "$$(NO_INCLUDE_DEPS)" "YES"
41 include $$($1_$2_depfile)
43 ifeq "$$(DEBUG)" "YES"
44 $$(warning not building dependencies in $1)