Makefiles: Clean lib/ofp-actions.inc1 and lib/ofp-actions.inc2.
[cascardo/ovs.git] / lib / automake.mk
1 # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
2 #
3 # Copying and distribution of this file, with or without modification,
4 # are permitted in any medium without royalty provided the copyright
5 # notice and this notice are preserved.  This file is offered as-is,
6 # without warranty of any kind.
7
8 lib_LTLIBRARIES += lib/libopenvswitch.la
9
10 lib_libopenvswitch_la_LIBADD = $(SSL_LIBS)
11
12 if WIN32
13 lib_libopenvswitch_la_LIBADD += ${PTHREAD_LIBS}
14 endif
15
16 lib_libopenvswitch_la_LDFLAGS = -release $(VERSION)
17
18 lib_libopenvswitch_la_SOURCES = \
19         lib/aes128.c \
20         lib/aes128.h \
21         lib/async-append.h \
22         lib/backtrace.c \
23         lib/backtrace.h \
24         lib/bfd.c \
25         lib/bfd.h \
26         lib/bitmap.c \
27         lib/bitmap.h \
28         lib/bundle.c \
29         lib/bundle.h \
30         lib/byte-order.h \
31         lib/byteq.c \
32         lib/byteq.h \
33         lib/cfm.c \
34         lib/cfm.h \
35         lib/classifier.c \
36         lib/classifier.h \
37         lib/cmap.c \
38         lib/cmap.h \
39         lib/command-line.c \
40         lib/command-line.h \
41         lib/compiler.h \
42         lib/connectivity.c \
43         lib/connectivity.h \
44         lib/coverage.c \
45         lib/coverage.h \
46         lib/crc32c.c \
47         lib/crc32c.h \
48         lib/csum.c \
49         lib/csum.h \
50         lib/daemon.c \
51         lib/daemon.h \
52         lib/daemon-private.h \
53         lib/dhcp.h \
54         lib/dummy.c \
55         lib/dummy.h \
56         lib/dhparams.h \
57         lib/dirs.h \
58         lib/dpctl.c \
59         lib/dpctl.h \
60         lib/dpif-netdev.c \
61         lib/dpif-netdev.h \
62         lib/dpif-provider.h \
63         lib/dpif.c \
64         lib/dpif.h \
65         lib/heap.c \
66         lib/heap.h \
67         lib/dynamic-string.c \
68         lib/dynamic-string.h \
69         lib/entropy.c \
70         lib/entropy.h \
71         lib/fat-rwlock.c \
72         lib/fat-rwlock.h \
73         lib/fatal-signal.c \
74         lib/fatal-signal.h \
75         lib/flow.c \
76         lib/flow.h \
77         lib/guarded-list.c \
78         lib/guarded-list.h \
79         lib/hash.c \
80         lib/hash.h \
81         lib/hindex.c \
82         lib/hindex.h \
83         lib/hmap.c \
84         lib/hmap.h \
85         lib/hmapx.c \
86         lib/hmapx.h \
87         lib/jhash.c \
88         lib/jhash.h \
89         lib/json.c \
90         lib/json.h \
91         lib/jsonrpc.c \
92         lib/jsonrpc.h \
93         lib/lacp.c \
94         lib/lacp.h \
95         lib/latch.h \
96         lib/learn.c \
97         lib/learn.h \
98         lib/learning-switch.c \
99         lib/learning-switch.h \
100         lib/list.c \
101         lib/list.h \
102         lib/lockfile.c \
103         lib/lockfile.h \
104         lib/mac-learning.c \
105         lib/mac-learning.h \
106         lib/match.c \
107         lib/match.h \
108         lib/mcast-snooping.c \
109         lib/mcast-snooping.h \
110         lib/memory.c \
111         lib/memory.h \
112         lib/meta-flow.c \
113         lib/meta-flow.h \
114         lib/multipath.c \
115         lib/multipath.h \
116         lib/netdev-dummy.c \
117         lib/netdev-provider.h \
118         lib/netdev-vport.c \
119         lib/netdev-vport.h \
120         lib/netdev.c \
121         lib/netdev.h \
122         lib/netflow.h \
123         lib/netlink.c \
124         lib/netlink.h \
125         lib/nx-match.c \
126         lib/nx-match.h \
127         lib/odp-execute.c \
128         lib/odp-execute.h \
129         lib/odp-util.c \
130         lib/odp-util.h \
131         lib/ofp-actions.c \
132         lib/ofp-actions.h \
133         lib/ofp-errors.c \
134         lib/ofp-errors.h \
135         lib/ofp-msgs.c \
136         lib/ofp-msgs.h \
137         lib/ofp-parse.c \
138         lib/ofp-parse.h \
139         lib/ofp-print.c \
140         lib/ofp-print.h \
141         lib/ofp-util.c \
142         lib/ofp-util.h \
143         lib/ofp-version-opt.h \
144         lib/ofp-version-opt.c \
145         lib/ofpbuf.c \
146         lib/ofpbuf.h \
147         lib/ovs-atomic-c11.h \
148         lib/ovs-atomic-clang.h \
149         lib/ovs-atomic-flag-gcc4.7+.h \
150         lib/ovs-atomic-gcc4+.h \
151         lib/ovs-atomic-gcc4.7+.h \
152         lib/ovs-atomic-i586.h \
153         lib/ovs-atomic-locked.c \
154         lib/ovs-atomic-locked.h \
155         lib/ovs-atomic-pthreads.h \
156         lib/ovs-atomic-x86_64.h \
157         lib/ovs-atomic.h \
158         lib/ovs-rcu.c \
159         lib/ovs-rcu.h \
160         lib/ovs-thread.c \
161         lib/ovs-thread.h \
162         lib/ovsdb-data.c \
163         lib/ovsdb-data.h \
164         lib/ovsdb-error.c \
165         lib/ovsdb-error.h \
166         lib/ovsdb-idl-provider.h \
167         lib/ovsdb-idl.c \
168         lib/ovsdb-idl.h \
169         lib/ovsdb-parser.c \
170         lib/ovsdb-parser.h \
171         lib/ovsdb-types.c \
172         lib/ovsdb-types.h \
173         lib/packet-dpif.c \
174         lib/packet-dpif.h \
175         lib/packets.c \
176         lib/packets.h \
177         lib/pcap-file.c \
178         lib/pcap-file.h \
179         lib/poll-loop.c \
180         lib/poll-loop.h \
181         lib/process.c \
182         lib/process.h \
183         lib/pvector.c \
184         lib/pvector.h \
185         lib/random.c \
186         lib/random.h \
187         lib/rconn.c \
188         lib/rconn.h \
189         lib/reconnect.c \
190         lib/reconnect.h \
191         lib/sat-math.h \
192         lib/seq.c \
193         lib/seq.h \
194         lib/sha1.c \
195         lib/sha1.h \
196         lib/shash.c \
197         lib/shash.h \
198         lib/simap.c \
199         lib/simap.h \
200         lib/smap.c \
201         lib/smap.h \
202         lib/socket-util.c \
203         lib/socket-util.h \
204         lib/sort.c \
205         lib/sort.h \
206         lib/sset.c \
207         lib/sset.h \
208         lib/stp.c \
209         lib/stp.h \
210         lib/stream-fd.h \
211         lib/stream-provider.h \
212         lib/stream-ssl.h \
213         lib/stream-tcp.c \
214         lib/stream.c \
215         lib/stream.h \
216         lib/stdio.c \
217         lib/string.c \
218         lib/svec.c \
219         lib/svec.h \
220         lib/table.c \
221         lib/table.h \
222         lib/tag.c \
223         lib/tag.h \
224         lib/timer.c \
225         lib/timer.h \
226         lib/timeval.c \
227         lib/timeval.h \
228         lib/token-bucket.c \
229         lib/token-bucket.h \
230         lib/type-props.h \
231         lib/unaligned.h \
232         lib/unicode.c \
233         lib/unicode.h \
234         lib/unixctl.c \
235         lib/unixctl.h \
236         lib/util.c \
237         lib/util.h \
238         lib/uuid.c \
239         lib/uuid.h \
240         lib/valgrind.h \
241         lib/vconn-provider.h \
242         lib/vconn-stream.c \
243         lib/vconn.c \
244         lib/vconn.h \
245         lib/vlan-bitmap.c \
246         lib/vlan-bitmap.h \
247         lib/vlandev.c \
248         lib/vlandev.h \
249         lib/vlog.c \
250         lib/vlog.h \
251         lib/vswitch-idl.c \
252         lib/vswitch-idl.h \
253         lib/vtep-idl.c \
254         lib/vtep-idl.h
255
256 if WIN32
257 lib_libopenvswitch_la_SOURCES += \
258         lib/daemon-windows.c \
259         lib/getopt_long.c \
260         lib/getrusage-windows.c \
261         lib/latch-windows.c \
262         lib/route-table-stub.c \
263         lib/strsep.c \
264         lib/stream-fd-windows.c
265 else
266 lib_libopenvswitch_la_SOURCES += \
267         lib/daemon-unix.c \
268         lib/latch-unix.c \
269         lib/signals.c \
270         lib/signals.h \
271         lib/socket-util-unix.c \
272         lib/stream-fd-unix.c \
273         lib/stream-unix.c
274 endif
275
276 EXTRA_DIST += \
277         lib/stdio.h.in \
278         lib/string.h.in
279
280 nodist_lib_libopenvswitch_la_SOURCES = \
281         lib/dirs.c
282 CLEANFILES += $(nodist_lib_libopenvswitch_la_SOURCES)
283
284 lib_LTLIBRARIES += lib/libsflow.la
285 lib_libsflow_la_LDFLAGS = -release $(VERSION)
286 lib_libsflow_la_SOURCES = \
287         lib/sflow_api.h \
288         lib/sflow.h \
289         lib/sflow_agent.c \
290         lib/sflow_sampler.c \
291         lib/sflow_poller.c \
292         lib/sflow_receiver.c
293 lib_libsflow_la_CPPFLAGS = $(AM_CPPFLAGS)
294 lib_libsflow_la_CFLAGS = $(AM_CFLAGS)
295 if HAVE_WNO_UNUSED
296 lib_libsflow_la_CFLAGS += -Wno-unused
297 endif
298 if HAVE_WNO_UNUSED_PARAMETER
299 lib_libsflow_la_CFLAGS += -Wno-unused-parameter
300 endif
301
302 if LINUX
303 lib_libopenvswitch_la_SOURCES += \
304         lib/dpif-linux.c \
305         lib/dpif-linux.h \
306         lib/netdev-linux.c \
307         lib/netdev-linux.h \
308         lib/netlink-notifier.c \
309         lib/netlink-notifier.h \
310         lib/netlink-protocol.h \
311         lib/netlink-socket.c \
312         lib/netlink-socket.h \
313         lib/rtnetlink-link.c \
314         lib/rtnetlink-link.h \
315         lib/route-table.c \
316         lib/route-table.h
317 endif
318
319 if DPDK_NETDEV
320 lib_libopenvswitch_la_SOURCES += \
321        lib/netdev-dpdk.c \
322        lib/netdev-dpdk.h
323 endif
324
325 if WIN32
326 lib_libopenvswitch_la_SOURCES += \
327         lib/netlink-notifier.c \
328         lib/netlink-notifier.h \
329         lib/netlink-protocol.h \
330         lib/netlink-socket.c \
331         lib/netlink-socket.h
332 endif
333
334 if HAVE_POSIX_AIO
335 lib_libopenvswitch_la_SOURCES += lib/async-append-aio.c
336 else
337 lib_libopenvswitch_la_SOURCES += lib/async-append-null.c
338 endif
339
340 if ESX
341 lib_libopenvswitch_la_SOURCES += \
342         lib/route-table-stub.c
343 endif
344
345 if HAVE_IF_DL
346 lib_libopenvswitch_la_SOURCES += \
347         lib/netdev-bsd.c \
348         lib/rtbsd.c \
349         lib/rtbsd.h \
350         lib/route-table-bsd.c
351 endif
352
353 if HAVE_OPENSSL
354 lib_libopenvswitch_la_SOURCES += lib/stream-ssl.c
355 nodist_lib_libopenvswitch_la_SOURCES += lib/dhparams.c
356 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
357         (echo '#include "lib/dhparams.h"' &&                            \
358          openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
359          openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
360          openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
361         | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
362         mv lib/dhparams.c.tmp lib/dhparams.c
363 else
364 lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c
365 endif
366
367 EXTRA_DIST += \
368         lib/dh1024.pem \
369         lib/dh2048.pem \
370         lib/dh4096.pem \
371         lib/dirs.c.in
372
373 MAN_FRAGMENTS += \
374         lib/common.man \
375         lib/common-syn.man \
376         lib/coverage-unixctl.man \
377         lib/daemon.man \
378         lib/daemon-syn.man \
379         lib/dpctl.man \
380         lib/memory-unixctl.man \
381         lib/ofp-version.man \
382         lib/ovs.tmac \
383         lib/service.man \
384         lib/service-syn.man \
385         lib/ssl-bootstrap.man \
386         lib/ssl-bootstrap-syn.man \
387         lib/ssl-peer-ca-cert.man \
388         lib/ssl.man \
389         lib/ssl-syn.man \
390         lib/table.man \
391         lib/unixctl.man \
392         lib/unixctl-syn.man \
393         lib/vconn-active.man \
394         lib/vconn-passive.man \
395         lib/vlog-unixctl.man \
396         lib/vlog-syn.man \
397         lib/vlog.man
398
399 # vswitch IDL
400 OVSIDL_BUILT += \
401         $(srcdir)/lib/vswitch-idl.c \
402         $(srcdir)/lib/vswitch-idl.h \
403         $(srcdir)/lib/vswitch-idl.ovsidl \
404         $(srcdir)/lib/vtep-idl.c \
405         $(srcdir)/lib/vtep-idl.h \
406         $(srcdir)/lib/vtep-idl.ovsidl
407
408 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
409 VSWITCH_IDL_FILES = \
410         $(srcdir)/vswitchd/vswitch.ovsschema \
411         $(srcdir)/lib/vswitch-idl.ann
412 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
413         $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
414         mv $@.tmp $@
415
416 EXTRA_DIST += $(srcdir)/lib/vtep-idl.ann
417 VTEP_IDL_FILES = \
418         $(srcdir)/vtep/vtep.ovsschema \
419         $(srcdir)/lib/vtep-idl.ann
420 $(srcdir)/lib/vtep-idl.ovsidl: $(VTEP_IDL_FILES)
421         $(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp
422         mv $@.tmp $@
423
424 lib/dirs.c: lib/dirs.c.in Makefile
425         ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
426                 -e 's,[@]srcdir[@],$(srcdir),g' \
427                 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
428                 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
429                 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
430                 -e 's,[@]bindir[@],"$(bindir)",g' \
431                 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
432                 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
433              > lib/dirs.c.tmp
434         mv lib/dirs.c.tmp lib/dirs.c
435
436 lib/ofp-actions.inc1: $(srcdir)/build-aux/extract-ofp-actions lib/ofp-actions.c
437         $(run_python) $^ --prototypes > $@.tmp && mv $@.tmp $@
438 lib/ofp-actions.inc2: $(srcdir)/build-aux/extract-ofp-actions lib/ofp-actions.c
439         $(run_python) $^ --definitions > $@.tmp && mv $@.tmp $@
440 lib/ofp-actions.lo: lib/ofp-actions.inc1 lib/ofp-actions.inc2
441 CLEANFILES += lib/ofp-actions.inc1 lib/ofp-actions.inc2
442 EXTRA_DIST += build-aux/extract-ofp-actions lib/ofp-errors.inc
443
444 $(srcdir)/lib/ofp-errors.inc: \
445         lib/ofp-errors.h include/openflow/openflow-common.h \
446         $(srcdir)/build-aux/extract-ofp-errors
447         $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
448                 $(srcdir)/lib/ofp-errors.h \
449                 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
450         mv $@.tmp $@
451 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
452 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
453
454 $(srcdir)/lib/ofp-msgs.inc: \
455         lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
456         $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
457                 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
458 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
459 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
460
461 INSTALL_DATA_LOCAL += lib-install-data-local
462 lib-install-data-local:
463         $(MKDIR_P) $(DESTDIR)$(RUNDIR)
464         $(MKDIR_P) $(DESTDIR)$(PKIDIR)
465         $(MKDIR_P) $(DESTDIR)$(LOGDIR)
466         $(MKDIR_P) $(DESTDIR)$(DBDIR)
467