source: trunk/essentials/sys-devel/automake-1.9/lib/am/yacc.am

Last change on this file was 3086, checked in by bird, 18 years ago

automake 1.9.6

File size: 2.2 KB
Line 
1## automake - create Makefile.in from Makefile.am
2## Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004
3## Free Software Foundation, Inc.
4
5## This program is free software; you can redistribute it and/or modify
6## it under the terms of the GNU General Public License as published by
7## the Free Software Foundation; either version 2, or (at your option)
8## any later version.
9
10## This program is distributed in the hope that it will be useful,
11## but WITHOUT ANY WARRANTY; without even the implied warranty of
12## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13## GNU General Public License for more details.
14
15## You should have received a copy of the GNU General Public License
16## along with this program; if not, write to the Free Software
17## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18## 02110-1301, USA.
19
20?GENERIC?%EXT%%DERIVED-EXT%:
21?!GENERIC?%OBJ%: %SOURCE%
22if %?MORE-THAN-ONE%
23?GENERIC? $(SHELL) $(YLWRAP) %SOURCE% y.tab.c %OBJ% y.tab.h %BASE%.h y.output %BASE%.output -- %COMPILE%
24## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
25?!GENERIC? $(SHELL) $(YLWRAP) `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% y.tab.c %OBJ% y.tab.h %BASE%.h y.output %BASE%.output -- %COMPILE%
26else !%?MORE-THAN-ONE%
27?GENERIC? %COMPILE% %SOURCE%
28## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
29?!GENERIC? %COMPILE% `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
30## Edit out Bison multiple inclusion guards. It may be BISON_Y_TAB_H,
31## or Y_TAB_H depending upon the version, that's why the regexp is
32## so loose.
33 if test -f y.tab.h; then \
34 to=`echo "%BASE%_H" | sed \
35 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
36 -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \
37 sed -e "/^#/!b" -e "s/Y_TAB_H/$$to/g" -e "s|y\.tab\.h|%BASE%.h|" \
38 y.tab.h >%BASE%.ht; \
39 rm -f y.tab.h; \
40 if cmp -s %BASE%.ht %BASE%.h; then \
41 rm -f %BASE%.ht ;\
42 else \
43 mv %BASE%.ht %BASE%.h; \
44 fi; \
45 fi
46 if test -f y.output; then \
47 mv y.output %BASE%.output; \
48 fi
49## Edit out `#line' or `#' directives.
50 sed '/^#/ s|y\.tab\.c|%OBJ%|' y.tab.c >%OBJ%t && mv %OBJ%t %OBJ%
51 rm -f y.tab.c
52endif !%?MORE-THAN-ONE%
Note: See TracBrowser for help on using the repository browser.