d5a7a7cc9c55e281e42c3fcfbc4eb461f92dcbf3
[cascardo/ovs.git] / lib / automake.mk
1 noinst_LIBRARIES += lib/libopenvswitch.a
2
3 lib_libopenvswitch_a_SOURCES = \
4         lib/backtrace.c \
5         lib/backtrace.h \
6         lib/bitmap.c \
7         lib/bitmap.h \
8         lib/cfg.c \
9         lib/cfg.h \
10         lib/classifier.c \
11         lib/classifier.h \
12         lib/command-line.c \
13         lib/command-line.h \
14         lib/compiler.h \
15         lib/coverage.c \
16         lib/coverage.h \
17         lib/coverage-counters.h \
18         lib/csum.c \
19         lib/csum.h \
20         lib/daemon.c \
21         lib/daemon.h \
22         lib/dhcp-client.c \
23         lib/dhcp-client.h \
24         lib/dhcp.c \
25         lib/dhcp.h \
26         lib/dhparams.h \
27         lib/dirs.h \
28         lib/dynamic-string.c \
29         lib/dynamic-string.h \
30         lib/fatal-signal.c \
31         lib/fatal-signal.h \
32         lib/fault.c \
33         lib/fault.h \
34         lib/flow.c \
35         lib/flow.h \
36         lib/hash.c \
37         lib/hash.h \
38         lib/hmap.c \
39         lib/hmap.h \
40         lib/leak-checker.c \
41         lib/leak-checker.h \
42         lib/learning-switch.c \
43         lib/learning-switch.h \
44         lib/list.c \
45         lib/list.h \
46         lib/mac-learning.c \
47         lib/mac-learning.h \
48         lib/netdev.c \
49         lib/netdev.h \
50         lib/odp-util.c \
51         lib/odp-util.h \
52         lib/ofp-print.c \
53         lib/ofp-print.h \
54         lib/ofpbuf.c \
55         lib/ofpbuf.h \
56         lib/packets.h \
57         lib/pcap.c \
58         lib/pcap.h \
59         lib/poll-loop.c \
60         lib/poll-loop.h \
61         lib/port-array.c \
62         lib/port-array.h \
63         lib/process.c \
64         lib/process.h \
65         lib/queue.c \
66         lib/queue.h \
67         lib/random.c \
68         lib/random.h \
69         lib/rconn.c \
70         lib/rconn.h \
71         lib/sat-math.h \
72         lib/sha1.c \
73         lib/sha1.h \
74         lib/shash.c \
75         lib/shash.h \
76         lib/signals.c \
77         lib/signals.h \
78         lib/socket-util.c \
79         lib/socket-util.h \
80         lib/stp.c \
81         lib/stp.h \
82         lib/svec.c \
83         lib/svec.h \
84         lib/tag.c \
85         lib/tag.h \
86         lib/timeval.c \
87         lib/timeval.h \
88         lib/type-props.h \
89         lib/unixctl.c \
90         lib/unixctl.h \
91         lib/util.c \
92         lib/util.h \
93         lib/valgrind.h \
94         lib/vconn-provider.h \
95         lib/vconn-ssl.h \
96         lib/vconn-stream.c \
97         lib/vconn-stream.h \
98         lib/vconn-tcp.c \
99         lib/vconn-unix.c \
100         lib/vconn.c \
101         lib/vconn.h \
102         lib/vlog-modules.def \
103         lib/vlog.c \
104         lib/vlog.h \
105         lib/xtoxll.h
106 nodist_lib_libopenvswitch_a_SOURCES = \
107         lib/coverage-counters.c \
108         lib/dirs.c
109 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
110
111 if HAVE_NETLINK
112 lib_libopenvswitch_a_SOURCES += \
113         lib/dpif.c \
114         lib/dpif.h \
115         lib/netlink-protocol.h \
116         lib/netlink.c \
117         lib/netlink.h
118 endif
119
120 if HAVE_OPENSSL
121 lib_libopenvswitch_a_SOURCES += \
122         lib/vconn-ssl.c 
123 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
124 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
125         (echo '#include "lib/dhparams.h"' &&                            \
126          openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
127          openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
128          openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
129         | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
130         mv lib/dhparams.c.tmp lib/dhparams.c
131 endif
132
133 EXTRA_DIST += \
134         lib/dh1024.pem \
135         lib/dh2048.pem \
136         lib/dh4096.pem \
137         lib/dhparams.h
138
139 EXTRA_DIST += \
140         lib/common.man \
141         lib/daemon.man \
142         lib/dpif.man \
143         lib/leak-checker.man \
144         lib/vlog.man
145
146
147 lib/dirs.c: Makefile
148         ($(ro_c) && \
149          echo 'const char ovs_pkgdatadir[] = "$(pkgdatadir)";' && \
150          echo 'const char ovs_rundir[] = "@RUNDIR@";' && \
151          echo 'const char ovs_logdir[] = "@LOGDIR@";' && \
152          echo 'const char ovs_bindir[] = "$(bindir)";') > lib/dirs.c.tmp
153         mv lib/dirs.c.tmp lib/dirs.c
154
155 install-data-local:
156         $(MKDIR_P) $(DESTDIR)$(RUNDIR)
157         $(MKDIR_P) $(DESTDIR)$(PKIDIR)
158         $(MKDIR_P) $(DESTDIR)$(LOGDIR)
159
160 # All the source files that have coverage counters.
161 COVERAGE_FILES = \
162         lib/cfg.c \
163         lib/dpif.c \
164         lib/flow.c \
165         lib/hmap.c \
166         lib/mac-learning.c \
167         lib/netdev.c \
168         lib/netlink.c \
169         lib/odp-util.c \
170         lib/poll-loop.c \
171         lib/process.c \
172         lib/rconn.c \
173         lib/timeval.c \
174         lib/unixctl.c \
175         lib/util.c \
176         lib/vconn.c \
177         secchan/ofproto.c \
178         secchan/pktbuf.c \
179         vswitchd/bridge.c \
180         vswitchd/mgmt.c \
181         vswitchd/ovs-brcompatd.c
182 lib/coverage-counters.c: $(COVERAGE_FILES) lib/coverage-scan.pl
183         (cd $(srcdir) && $(PERL) lib/coverage-scan.pl $(COVERAGE_FILES)) > $@.tmp
184         mv $@.tmp $@
185 EXTRA_DIST += lib/coverage-scan.pl