Imported Upstream version 0.4.8
[platform/upstream/libsmi.git] / lib / Makefile.am
1 #
2 # Makefile.am --
3 #
4 #      Template to generate libsmi Makefile.in using automake.
5 #
6 # Copyright (c) 1999 Frank Strauss, Technical University of Braunschweig.
7 #
8 # See the file "COPYING" for information on usage and redistribution
9 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
10 #
11 # @(#) $Id: Makefile.am 7735 2008-02-15 08:09:17Z schoenw $
12 #
13
14 EXTRA_DIST              = parser-sming.y parser-smi.y \
15                           scanner-sming.l scanner-smi.l \
16                           errormacros.h data.h check.h error.h util.h \
17                           snprintf.h \
18                           scanner-smi.h parser-smi.h parser-smi.tab.h \
19                           scanner-sming.h parser-sming.h parser-sming.tab.h \
20                           $(man_MANS)
21 include_HEADERS         = smi.h
22 CLEANFILES              = parser-smi.output parser-sming.output
23 MAINTAINERCLEANFILES    = parser-smi.c parser-sming.c \
24                           scanner-smi.c scanner-sming.c \
25                           parser-smi.tab.h parser-sming.tab.h \
26                           errormacros.h
27 man_MANS                = libsmi.3 smi_config.3 smi_module.3 smi_macro.3 \
28                           smi_node.3 smi_type.3 smi_render.3 smi_util.3 \
29                           smi_class.3 smi_attribute.3 smi_identity.3 \
30                           smi_event.3
31 lib_LTLIBRARIES         = libsmi.la
32 libsmi_la_SOURCES       = data.c check.c error.c util.c snprintf.c smi.c \
33                           parser-smi.c scanner-smi.c \
34                           parser-sming.c scanner-sming.c
35 libsmi_la_LDFLAGS       = -version-info @VERSION_LIBTOOL@
36
37 parser-smi.c parser-smi.tab.h: parser-smi.y scanner-smi.h parser-smi.h
38         $(BISON) --defines=parser-smi.tab.h -t -psmi -o parser-smi.c parser-smi.y
39
40 parser-sming.c: parser-sming.y scanner-sming.h parser-sming.h
41         $(BISON) --defines=parser-sming.tab.h -t -psming -o parser-sming.c parser-sming.y
42
43 scanner-smi.c: scanner-smi.l scanner-smi.h parser-smi.tab.h
44         $(FLEX) -Cfe -Psmi -t scanner-smi.l > scanner-smi.c
45
46 scanner-sming.c: scanner-sming.l scanner-sming.h parser-sming.tab.h
47         $(FLEX) -Cfe -Psming -t scanner-sming.l > scanner-sming.c
48
49 error.h data.lo: errormacros.h
50
51 errormacros.h: error.c
52         cat error.c | grep ERR_ | \
53         sed -e 's/^.*\(ERR_[a-zA-Z0-9_]*\).*$$/\1/' | \
54         awk '{printf "#define %-50s %d\n", $$1, NR-1}' > errormacros.h