This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gengtype-{lex,yacc}.c rules broken


The rules for gengtypt-{lex,yacc}.c don't work with a relative srcdir.
Tested on ia64-linux.

Andreas.

2003-01-13  Andreas Schwab  <schwab@suse.de>

	* Makefile.in ($(parsedir)/gengtype-lex.c): Fix for relative
	srcdir.
	($(parsedir)/gengtype-yacc.c): Likewise.

--- gcc/Makefile.in.~1.969.~	2003-01-13 10:08:03.000000000 +0100
+++ gcc/Makefile.in	2003-01-13 13:18:12.000000000 +0100
@@ -2111,8 +2111,9 @@ gengtype-yacc.o : $(parsedir)/gengtype-y
 
 # The sed command works around a bug in flex-2.5.4.
 $(parsedir)/gengtype-lex.c : $(srcdir)/gengtype-lex.l
+	s=`cd $(srcdir) && ${PWD}`; \
 	cd $(parsedir) && \
-	$(FLEX) $(FLEXFLAGS) -t -o$@ $(srcdir)/gengtype-lex.l | \
+	$(FLEX) $(FLEXFLAGS) -t -o- $$s/gengtype-lex.l | \
 	  sed 's/^\(char msg\[\];\)/yyconst \1/' > g-$$$$ ; \
 	if test $$? -eq 0 ; then \
 	  mv -f g-$$$$ gengtype-lex.c ; \
@@ -2122,9 +2123,10 @@ $(parsedir)/gengtype-lex.c : $(srcdir)/g
 	fi
 
 $(parsedir)/gengtype-yacc.c: $(srcdir)/gengtype-yacc.y
-	(cd $(parsedir) && \
-	 $(BISON) $(BISONFLAGS) -d -o gengtype-yacc.c $(srcdir)/gengtype-yacc.y || \
-	 ( rm -f $@ && false ) )
+	s=`cd $(srcdir) && ${PWD}`; \
+	cd $(parsedir) && \
+	$(BISON) $(BISONFLAGS) -d -o gengtype-yacc.c $$s/gengtype-yacc.y || \
+	{ rm -f gengtype-yacc.c && false; }
 
 genconditions$(build_exeext) : genconditions.o $(BUILD_EARLY_SUPPORT) \
   $(BUILD_RTL) $(BUILD_ERRORS) $(BUILD_LIBDEPS)

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]