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