diff options
author | Ian Lynagh <ian@well-typed.com> | 2013-03-03 18:49:23 +0000 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2013-03-03 19:56:49 +0000 |
commit | 1da6975add0b333027f2b643933a4b60f0f66095 (patch) | |
tree | b0fb41e1be3d37acec65c2920e7555df804817d8 /rules | |
parent | 5d0801dac3503c242e874eb6334245943b2e7908 (diff) | |
download | haskell-1da6975add0b333027f2b643933a4b60f0f66095.tar.gz |
Define $(prog)_INPLACE variables automatically, and start using them
Diffstat (limited to 'rules')
-rw-r--r-- | rules/build-prog.mk | 16 | ||||
-rw-r--r-- | rules/hs-suffix-rules-srcdir.mk | 4 | ||||
-rw-r--r-- | rules/pretty_commands.mk | 2 |
3 files changed, 14 insertions, 8 deletions
diff --git a/rules/build-prog.mk b/rules/build-prog.mk index 7fbe7897cb..4bf9ab09e4 100644 --- a/rules/build-prog.mk +++ b/rules/build-prog.mk @@ -87,15 +87,21 @@ else $1_$2_INPLACE = endif else +ifeq "$(findstring clean,$(MAKECMDGOALS))" "" +ifneq "$$($$($1_$2_PROG)_INPLACE)" "" +$$(error $$($1_$2_PROG)_INPLACE defined twice) +endif +endif +ifeq "$$($1_$2_TOPDIR)" "YES" +$$($1_$2_PROG)_INPLACE = $$(INPLACE_TOPDIR)/$$($1_$2_PROG) +else +$$($1_$2_PROG)_INPLACE = $$(INPLACE_BIN)/$$($1_$2_PROG) +endif # Where do we install the inplace version? ifeq "$$($1_$2_WANT_INPLACE_WRAPPER)" "YES" $1_$2_INPLACE = $$(INPLACE_LIB)/bin/$$($1_$2_PROG) else -ifeq "$$($1_$2_TOPDIR)" "YES" -$1_$2_INPLACE = $$(INPLACE_TOPDIR)/$$($1_$2_PROG) -else -$1_$2_INPLACE = $$(INPLACE_BIN)/$$($1_$2_PROG) -endif +$1_$2_INPLACE = $$($$($1_$2_PROG)_INPLACE) endif endif diff --git a/rules/hs-suffix-rules-srcdir.mk b/rules/hs-suffix-rules-srcdir.mk index 8ed72af3be..d3c932f241 100644 --- a/rules/hs-suffix-rules-srcdir.mk +++ b/rules/hs-suffix-rules-srcdir.mk @@ -33,8 +33,8 @@ $1/$2/build/%.hs : $1/$2/build/%.y | $$$$(dir $$$$@)/. $1/$2/build/%.hs : $1/$3/%.x | $$$$(dir $$$$@)/. $$(call cmd,ALEX) $$($1_$2_ALL_ALEX_OPTS) $$< -o $$@ -$1/$2/build/%_hsc.c $1/$2/build/%_hsc.h $1/$2/build/%.hs : $1/$3/%.hsc $$(HSC2HS_INPLACE) | $$$$(dir $$$$@)/. - $$(call cmd,HSC2HS_INPLACE) $$($1_$2_ALL_HSC2HS_OPTS) $$< -o $$@ +$1/$2/build/%_hsc.c $1/$2/build/%_hsc.h $1/$2/build/%.hs : $1/$3/%.hsc $$$$(hsc2hs_INPLACE) | $$$$(dir $$$$@)/. + $$(call cmd,hsc2hs_INPLACE) $$($1_$2_ALL_HSC2HS_OPTS) $$< -o $$@ # Now the rules for hs-boot files. diff --git a/rules/pretty_commands.mk b/rules/pretty_commands.mk index cfd7fac2b6..f7576e171f 100644 --- a/rules/pretty_commands.mk +++ b/rules/pretty_commands.mk @@ -6,7 +6,7 @@ endif label_ALEX=ALEX label_HAPPY=HAPPY -label_HSC2HS_INPLACE=HSC2HS +label_hsc2hs_INPLACE=HSC2HS |