| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 | #! /bin/sh# Copyright (C) 2011-2017 Free Software Foundation, Inc.## This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2, or (at your option)# any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program.  If not, see <http://www.gnu.org/licenses/>.# Check that .c files derived from non-distributed .l sources# are cleaned by "make clean", while .c files derived from# distributed .l sources are cleaned by "make maintainer-clean".# See also sister test 'lex-clean-cxx.sh'.required='cc lex'. test-init.shcat >> configure.ac << 'END'AC_PROG_CCAC_PROG_LEXAC_OUTPUTENDcat > Makefile.am << 'END'bin_PROGRAMS = foo bar baz quxfoo_SOURCES = main.c lexer.lbar_SOURCES = main.c lexer.lbar_LFLAGS = $(AM_LFLAGS)baz_SOURCES = main.cnodist_baz_SOURCES = baz.lqux_SOURCES = main.cnodist_qux_SOURCES = baz.lqux_LFLAGS = $(AM_LFLAGS)baz.l:	cp $(srcdir)/lexer.l $@CLEANFILES = baz.lLDADD = $(LEXLIB)ENDcat > lexer.l << 'END'%{#define YY_NO_UNISTD_H 1%}%%"GOOD"   return EOF;.ENDcat > main.c << 'END'int main (void){  return yylex ();}/* Avoid possible link errors. */int yywrap (void){  return 1;}END$ACLOCAL$AUTOCONF$AUTOMAKE -a./configurecp config.status config.sav$MAKEls -l# Sanity checks.test -f lexer.ltest -f lexer.ctest -f bar-lexer.ctest -f baz.ltest -f baz.ctest -f qux-baz.cfor target in clean distclean; do  $MAKE $target  ls -l  test -f lexer.l  test -f lexer.c  test -f bar-lexer.c  test ! -e baz.l  test ! -e baz.c  test ! -e qux-baz.cdonecp config.sav config.status./config.status # re-create Makefile$MAKE maintainer-cleanls -ltest -f lexer.ltest ! -e lexer.ctest ! -e bar-lexer.c:
 |