Since code generated by lex may trigger gcc warnings, we are now generating two
authorSebastien Tandel <sebastien@tandel.be>
Thu, 17 May 2007 18:02:22 +0000 (18:02 -0000)
committerSebastien Tandel <sebastien@tandel.be>
Thu, 17 May 2007 18:02:22 +0000 (18:02 -0000)
libraries.  A single library is generated with the lex code without the barrier
"stop on warning". An other library is generated from the remaining source
files with the "stop on warning" barrier.

svn path=/trunk/; revision=21817

wiretap/Makefile.am
wiretap/Makefile.common

index 08b465e64fbf4086cd93f8462c5b7d75f290c901..11d6a53c8c23615e4a90cbb6f33cef3c98f34b4b 100644 (file)
@@ -25,12 +25,19 @@ ACLOCAL_AMFLAGS = `../aclocal-flags`
 
 include Makefile.common
 
+noinst_LTLIBRARIES = libwiretap_generated.la
 lib_LTLIBRARIES = libwiretap.la
 libwiretap_la_LDFLAGS = -version-info 0:1:0 @LDFLAGS_SHAREDLIB@
 
+if HAVE_WARNINGS_AS_ERRORS
+AM_NON_GENERATED_CFLAGS = -Werror
+endif
+
 CLEANFILES = \
        libwiretap.a            \
        libwiretap.la           \
+       libwiretap_generated.a  \
+       libwiretap_generated.la \
        *~
 
 MAINTAINERCLEANFILES = \
@@ -40,10 +47,17 @@ MAINTAINERCLEANFILES = \
        config.h.in             \
        configure
 
+#Since code generated by lex may trigger gcc warnings, we are now generating two
+#libraries.  A single library is generated with the lex code without the barrier
+#"stop on warning". An other library is generated from the remaining source
+#files with the "stop on warning" barrier.
 libwiretap_la_SOURCES = \
        $(NONGENERATED_C_FILES) \
-       $(GENERATOR_SOURCES)    \
        $(NONGENERATED_HEADER_FILES)
+libwiretap_la_CFLAGS = $(AM_NON_GENERATED_CFLAGS)
+
+libwiretap_generated_la_SOURCES = \
+       $(GENERATED_C_FILES)
 
 EXTRA_DIST = \
        README.developer        \
@@ -54,8 +68,15 @@ EXTRA_DIST = \
        file_util.c             \
        $(GENERATED_FILES)
 
-# Any POSIX-compatible YACC should honor the -p flag
-AM_YFLAGS=-d -p ascend
+libwiretap_la_LIBADD = libwiretap_generated.la
+libwiretap_la_DEPENDENCIES = libwiretap_generated.la
+
+ascend-grammar.c : ascend-grammar.y
+       @if [ -z "$(YACC)" ]; then \
+               echo "Neither bison nor byacc has been found"; \
+               exit 1; \
+       fi
+       $(YACC) -d -p ascend -o ascend-grammar.c $(srcdir)/ascend-grammar.y
 
 ascend-scanner.c : ascend-scanner.l
        @if [ ! -x "$(LEX)" ]; then \
index 22a919aa32bf6e224f97723247fc98c5578958aa..a988d22af28c52078a7aee14e32edb47be37454b 100644 (file)
@@ -110,16 +110,10 @@ NONGENERATED_HEADER_FILES = \
        wtap-capture.h          \
        wtap-int.h
 
-# Files that generate compileable files
-GENERATOR_SOURCES = \
-       ascend-grammar.y        \
-       ascend-scanner.l \
-       k12text.l
-
 # The C source files they generate.
 GENERATED_C_FILES = \
        ascend-grammar.c        \
-       ascend-scanner.c \
+       ascend-scanner.c        \
        k12text.c
 
 # The header files that they generate.