Testsuite: mark T8089 expect_broken(#7325) on Windows
[ghc.git] / rules / hs-suffix-way-rules-srcdir.mk
1 # -----------------------------------------------------------------------------
2 #
3 # (c) 2009 The University of Glasgow
4 #
5 # This file is part of the GHC build system.
6 #
7 # To understand how the build system works and how to modify it, see
8 # http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
9 # http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
10 #
11 # -----------------------------------------------------------------------------
12
13
14 define hs-suffix-way-rules-srcdir
15 # args: $1 = dir, $2 = distdir, $3 = way, $4 = srcdir
16
17 ifneq "$$(BINDIST)" "YES"
18
19 # Compiling Haskell source
20
21 $1/$2/build/%.$$($3_osuf) : $1/$4/%.hs $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP) $$($1_$2_PKGDATA_DEP)
22 $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ $$(if $$(findstring YES,$$($1_$2_DYNAMIC_TOO)),-dyno $$(addsuffix .$$(dyn_osuf),$$(basename $$@)))
23 $$(call ohi-sanity-check,$1,$2,$3,$1/$2/build/$$*)
24
25 $1/$2/build/%.$$($3_osuf) : $1/$4/%.lhs $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP) $$($1_$2_PKGDATA_DEP)
26 $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ $$(if $$(findstring YES,$$($1_$2_DYNAMIC_TOO)),-dyno $$(addsuffix .$$(dyn_osuf),$$(basename $$@)))
27 $$(call ohi-sanity-check,$1,$2,$3,$1/$2/build/$$*)
28
29 $1/$2/build/%.$$($3_hcsuf) : $1/$4/%.hs $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP) $$($1_$2_PKGDATA_DEP)
30 $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -C $$< -o $$@
31
32 $1/$2/build/%.$$($3_hcsuf) : $1/$4/%.lhs $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP) $$($1_$2_PKGDATA_DEP)
33 $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -C $$< -o $$@
34
35 # XXX: for some reason these get used in preference to the direct
36 # .hs->.o rule, I don't know why --SDM
37
38 $1/$2/build/%.$$($3_osuf) : $1/$4/%.hc includes/ghcautoconf.h includes/ghcplatform.h | $$$$(dir $$$$@)/.
39 $$(call cmd,$1_$2_CC) $$($1_$2_$3_ALL_CC_OPTS) $$(addprefix -I,$$(GHC_INCLUDE_DIRS)) -x c -c $$< -o $$@ $$(if $$(findstring YES,$$($1_$2_DYNAMIC_TOO)),-dyno $$(addsuffix .$$(dyn_osuf),$$(basename $$@)))
40
41 $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.hc includes/ghcautoconf.h includes/ghcplatform.h
42 $$(call cmd,$1_$2_CC) $$($1_$2_$3_ALL_CC_OPTS) $$(addprefix -I,$$(GHC_INCLUDE_DIRS)) -x c -c $$< -o $$@ $$(if $$(findstring YES,$$($1_$2_DYNAMIC_TOO)),-dyno $$(addsuffix .$$(dyn_osuf),$$(basename $$@)))
43
44 # $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.$$($3_hcsuf)
45 # $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@
46 #
47 # $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.hc
48 # $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@
49 #
50 # $1/$2/build/%.$$($3_ssuf) : $1/$2/build/%.$$($3_hcsuf)
51 # $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -S $$< -o $$@
52
53 # Now the rules for hs-boot files.
54
55 $1/$2/build/%.$$($3_o-bootsuf) : $1/$4/%.hs-boot $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP) $$($1_$2_PKGDATA_DEP)
56 $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ $$(if $$(findstring YES,$$($1_$2_DYNAMIC_TOO)),-dyno $$(addsuffix .$$(dyn_osuf)-boot,$$(basename $$@)))
57
58 $1/$2/build/%.$$($3_o-bootsuf) : $1/$4/%.lhs-boot $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP) $$($1_$2_PKGDATA_DEP)
59 $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ $$(if $$(findstring YES,$$($1_$2_DYNAMIC_TOO)),-dyno $$(addsuffix .$$(dyn_osuf)-boot,$$(basename $$@)))
60
61 # stubs are automatically generated and compiled by GHC
62
63 $1/$2/build/%_stub.$$($3_osuf): $1/$2/build/%.$$($3_osuf)
64 @:
65
66 endif
67
68 endef
69
70 ifeq "$(ExtraMakefileSanityChecks)" "NO"
71 ohi-sanity-check =
72 else
73 # We don't look for the .hi file if this is for a program, as if the
74 # Main module is in foo.hs then we get foo.o but Main.hi
75 define ohi-sanity-check
76 @for f in $4.$($3_osuf) \
77 $(if $($1_$2_PROG),,$4.$($3_hisuf)) \
78 $(if $(findstring v,$3), \
79 $(if $(findstring YES,$($1_$2_DYNAMIC_TOO)), \
80 $4.$(dyn_osuf) $4.$(dyn_hisuf))); do \
81 if [ ! -f $$f ]; then \
82 echo "Panic! $$f not created."; \
83 exit 1; \
84 fi; \
85 done
86 endef
87 endif
88