diff options
Diffstat (limited to 'lib/am/yacc.am')
-rw-r--r-- | lib/am/yacc.am | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/lib/am/yacc.am b/lib/am/yacc.am index 2b3f92aac..80c48d9d1 100644 --- a/lib/am/yacc.am +++ b/lib/am/yacc.am @@ -14,37 +14,15 @@ ## You should have received a copy of the GNU General Public License ## along with this program. If not, see <http://www.gnu.org/licenses/>. -## We want to disable the Yacc rebuild rule when -## 1. AM_MAINTAINER_MODE is used, and -## 2. --enable-maintainer-mode is not specified, and -## 3. parser.c already exist, and -## 4. parser.y and parser.c are distributed. -## Point #3 is because "make maintainer-clean" erases parser.c, yet -## the GNU Coding Standards require that ./configure; make works even -## after that. -## Point #4 is because parsers listed in nodist_*_SOURCES are always -## built on the user's side, so it makes no sense to disable them. -## -## Points #1, #2, #3 are solved by unconditionally prefixing the rule -## with $(am__skipyacc) defined below only when needed. -## -## Point #4 requires a condition on whether parser.y/parser.c are -## distributed or not. We cannot have a generic rule that works in -## both cases, so we ensure in automake that nodist_ parsers always -## use non-generic rules. if %?FIRST% -if %?MAINTAINER-MODE% -@MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ || -endif %?MAINTAINER-MODE% -## The 's/c$/h/' substitution *must* be the last one. -am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ - -e s/c++$$/h++/ -e s/c$$/h/ +am.yacc.c2h = $(basename $1)$(subst c,h,$(suffix $1)) endif %?FIRST% -?GENERIC?%EXT%%DERIVED-EXT%: +?GENERIC?%%DERIVED-EXT%: %%EXT% ?!GENERIC?%OBJ%: %SOURCE% -?GENERIC? %VERBOSE%$(am__skipyacc) $(SHELL) $(YLWRAP) %SOURCE% y.tab.c %OBJ% y.tab.h `echo %OBJ% | $(am__yacc_c2h)` y.output %BASE%.output -- %COMPILE% -?!GENERIC? %VERBOSE% \ -?!GENERIC??DIST_SOURCE? $(am__skipyacc) \ -## For non-suffix rules, we must emulate a VPATH search on %SOURCE%. -?!GENERIC? $(SHELL) $(YLWRAP) `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% y.tab.c %OBJ% y.tab.h `echo %OBJ% | $(am__yacc_c2h)` y.output %BASE%.output -- %COMPILE% + %SILENT%$(am.cmd.ensure-target-dir-exists) + %VERBOSE%$(SHELL) $(YLWRAP) $< \ + y.tab.c $@ \ + y.tab.h $(call am.yacc.c2h,$@) \ + y.output $(basename $@).output \ + -- %COMPILE% |