Move the new files to the same places as in automake.
[obnox/wireshark/wip.git] / wiretap / Makefile.am
index 8a5616384f6a8a05dc0e4e01bd255ea82af0c5e5..1dabf1ee1ab1f2dc0d7d8718502a243c33d4b7a9 100644 (file)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+include ../Makefile.am.inc
+
 ACLOCAL_AMFLAGS = `../aclocal-flags`
 
 include Makefile.common
 
+noinst_LTLIBRARIES = libwiretap_generated.la
 lib_LTLIBRARIES = libwiretap.la
-libwiretap_la_LDFLAGS = -version-info 0:1:0
+# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
+libwiretap_la_LDFLAGS = -version-info 0:1:0 -export-symbols wtap.sym @LDFLAGS_SHAREDLIB@
+
+if HAVE_WARNINGS_AS_ERRORS
+AM_NON_GENERATED_CFLAGS = -Werror
+endif
+
+INCLUDES = -I$(srcdir)/..
 
 CLEANFILES = \
        libwiretap.a            \
        libwiretap.la           \
+       libwiretap_generated.a  \
+       libwiretap_generated.la \
+       wtap.sym                \
        *~
 
 MAINTAINERCLEANFILES = \
        $(GENERATED_FILES)      \
-       Makefile.in             \
-       aclocal.m4              \
-       config.h.in             \
-       configure
+       Makefile.in
 
+#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.airmagnet        \
        README.developer        \
-       config.h.win32          \
        Makefile.common         \
        Makefile.nmake          \
+       libwiretap.vcproj       \
        wtap.def                \
+       $(GENERATOR_FILES)      \
        $(GENERATED_FILES)
 
-# Any POSIX-compatible YACC should honor the -p flag
-AM_YFLAGS=-d -p ascend
+libwiretap_la_LIBADD = libwiretap_generated.la ${top_builddir}/wsutil/libwsutil.la $(GLIB_LIBS)
+libwiretap_la_DEPENDENCIES = libwiretap_generated.la ${top_builddir}/wsutil/libwsutil.la wtap.sym
+
+RUNLEX = $(top_srcdir)/tools/runlex.sh
 
-ascend-scanner.c : ascend-scanner.l
-       @if [ ! -x "$(LEX)" ]; then \
-               echo "Neither lex nor flex was found"; \
+ascend_scanner_lex.h : ascend_scanner.c
+
+k12text_lex.h : k12text.c
+
+ascend.c ascend.h: ascend.y
+       @if [ -z "$(YACC)" ]; then \
+               echo "Neither bison nor byacc has been found"; \
                exit 1; \
        fi
-       $(LEX) -Pascend -oascend-scanner.c $(srcdir)/ascend-scanner.l
+       $(YACC) -d -p ascend -o ascend.c $(srcdir)/ascend.y
+
+# ABI compliance checker can be obtained from
+# http://ispras.linux-foundation.org/index.php/ABI_compliance_checker
+# Checked using version 1.21.12
+dumpabi: all abi-descriptor.xml
+       rm -rf abi-check-headers abi_dumps .libs/*.abi.tar.gz; \
+       mkdir abi-check-headers; cp *.h abi-check-headers/; \
+       abi-compliance-checker -l libwiretap -v1 `ls  .libs/libwiretap.so.?.?.?|sed 's/.*\.so\.//'` \
+               -relpath $(abs_srcdir) -dump-abi abi-descriptor.xml && \
+       cp -f abi_dumps/libwiretap/libwiretap_* .libs/; \
+       cd .libs; ln -sf libwiretap_*.abi.tar.gz libwiretap.abi.tar.gz
+
+checkapi:
+## 'abort' checking disabled for now pending resolution of existing use of g_assert & g_error
+##     $(PERL) ../tools/checkAPIs.pl -g abort -g termoutput $(NONGENERATED_C_FILES) $(GENERATOR_FILES)
+       $(PERL) ../tools/checkAPIs.pl -g termoutput $(NONGENERATED_C_FILES) $(GENERATOR_FILES)