[commit: ghc] master: Put the generated Parser.y under compiler/stage<n>/build; fixes #7195 (80fcdd6)

Ian Lynagh <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/80fcdd69172f2e9d50b2d058c48dbc6074b7a65c

>---------------------------------------------------------------

commit 80fcdd69172f2e9d50b2d058c48dbc6074b7a65c
Author: Ian Lynagh <[email protected]>
Date:   Wed Oct 10 02:12:56 2012 +0100

    Put the generated Parser.y under compiler/stage<n>/build; fixes #7195

>---------------------------------------------------------------

 compiler/ghc.mk                 |   13 ++++++++++++-
 rules/hs-suffix-rules-srcdir.mk |    6 ++++++
 2 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index a0754af..7556ace 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -247,7 +247,18 @@ PRIMOP_BITS = compiler/primop-data-decl.hs-incl        \
 compiler_CPP_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS))
 compiler_CPP_OPTS += ${GhcCppOpts}
 
-$(PRIMOPS_TXT) compiler/parser/Parser.y: %: %.pp compiler/stage1/$(PLATFORM_H)
+define preprocessCompilerFiles
+# $0 = stage
+compiler/stage$1/build/Parser.y: compiler/parser/Parser.y.pp
+	$$(CPP) $$(RAWCPP_FLAGS) -P $$(compiler_CPP_OPTS) -x c $$< | grep -v '^#pragma GCC' > $$@
+endef
+
+$(eval $(call preprocessCompilerFiles,1))
+$(eval $(call preprocessCompilerFiles,2))
+$(eval $(call preprocessCompilerFiles,3))
+
+
+$(PRIMOPS_TXT): %: %.pp compiler/stage1/$(PLATFORM_H)
 	$(CPP) $(RAWCPP_FLAGS) -P $(compiler_CPP_OPTS) -x c $< | grep -v '^#pragma GCC' > $@
 
 $(eval $(call clean-target,compiler,primop, $(PRIMOPS_TXT) compiler/parser/Parser.y $(PRIMOP_BITS)))
diff --git a/rules/hs-suffix-rules-srcdir.mk b/rules/hs-suffix-rules-srcdir.mk
index b39b41a..94a41d5 100644
--- a/rules/hs-suffix-rules-srcdir.mk
+++ b/rules/hs-suffix-rules-srcdir.mk
@@ -26,6 +26,12 @@ $1/$2/build/%.hs : $1/$4/%.ly | $$$$(dir $$$$@)/.
 $1/$2/build/%.hs : $1/$4/%.y | $$$$(dir $$$$@)/.
 	$$(call cmd,HAPPY) $$($1_$2_$3_ALL_HAPPY_OPTS) $$< -o $$@
 
+$1/$2/build/%.hs : $1/$2/build/%.ly | $$$$(dir $$$$@)/.
+	$$(call cmd,HAPPY) $$($1_$2_$3_ALL_HAPPY_OPTS) $$< -o $$@
+
+$1/$2/build/%.hs : $1/$2/build/%.y | $$$$(dir $$$$@)/.
+	$$(call cmd,HAPPY) $$($1_$2_$3_ALL_HAPPY_OPTS) $$< -o $$@
+
 $1/$2/build/%.hs : $1/$4/%.x | $$$$(dir $$$$@)/.
 	$$(call cmd,ALEX) $$($1_$2_$3_ALL_ALEX_OPTS) $$< -o $$@
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.