Update primary code license to Apache 2.0.
[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.h \
64         lib/pcap.c \
65         lib/pcap.h \
66         lib/poll-loop.c \
67         lib/poll-loop.h \
68         lib/port-array.c \
69         lib/port-array.h \
70         lib/process.c \
71         lib/process.h \
72         lib/queue.c \
73         lib/queue.h \
74         lib/random.c \
75         lib/random.h \
76         lib/rconn.c \
77         lib/rconn.h \
78         lib/sat-math.h \
79         lib/sha1.c \
80         lib/sha1.h \
81         lib/shash.c \
82         lib/shash.h \
83         lib/signals.c \
84         lib/signals.h \
85         lib/socket-util.c \
86         lib/socket-util.h \
87         lib/stp.c \
88         lib/stp.h \
89         lib/svec.c \
90         lib/svec.h \
91         lib/tag.c \
92         lib/tag.h \
93         lib/timeval.c \
94         lib/timeval.h \
95         lib/type-props.h \
96         lib/unixctl.c \
97         lib/unixctl.h \
98         lib/util.c \
99         lib/util.h \
100         lib/valgrind.h \
101         lib/vconn-provider.h \
102         lib/vconn-ssl.h \
103         lib/vconn-stream.c \
104         lib/vconn-stream.h \
105         lib/vconn-tcp.c \
106         lib/vconn-unix.c \
107         lib/vconn.c \
108         lib/vconn.h \
109         lib/vlog-modules.def \
110         lib/vlog.c \
111         lib/vlog.h \
112         lib/xtoxll.h
113 nodist_lib_libopenvswitch_a_SOURCES = \
114         lib/coverage-counters.c \
115         lib/dirs.c
116 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
117
118 if HAVE_NETLINK
119 lib_libopenvswitch_a_SOURCES += \
120         lib/dpif.c \
121         lib/dpif.h \
122         lib/netlink-protocol.h \
123         lib/netlink.c \
124         lib/netlink.h
125 endif
126
127 if HAVE_OPENSSL
128 lib_libopenvswitch_a_SOURCES += \
129         lib/vconn-ssl.c 
130 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
131 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
132         (echo '#include "lib/dhparams.h"' &&                            \
133          openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
134          openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
135          openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
136         | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
137         mv lib/dhparams.c.tmp lib/dhparams.c
138 endif
139
140 EXTRA_DIST += \
141         lib/dh1024.pem \
142         lib/dh2048.pem \
143         lib/dh4096.pem \
144         lib/dhparams.h
145
146 EXTRA_DIST += \
147         lib/common.man \
148         lib/daemon.man \
149         lib/dpif.man \
150         lib/leak-checker.man \
151         lib/vlog.man
152
153
154 lib/dirs.c: Makefile
155         ($(ro_c) && \
156          echo 'const char ovs_pkgdatadir[] = "$(pkgdatadir)";' && \
157          echo 'const char ovs_rundir[] = "@RUNDIR@";' && \
158          echo 'const char ovs_logdir[] = "@LOGDIR@";' && \
159          echo 'const char ovs_bindir[] = "$(bindir)";') > lib/dirs.c.tmp
160         mv lib/dirs.c.tmp lib/dirs.c
161
162 install-data-local:
163         $(MKDIR_P) $(DESTDIR)$(RUNDIR)
164         $(MKDIR_P) $(DESTDIR)$(PKIDIR)
165         $(MKDIR_P) $(DESTDIR)$(LOGDIR)
166
167 # All the source files that have coverage counters.
168 COVERAGE_FILES = \
169         lib/cfg.c \
170         lib/dpif.c \
171         lib/flow.c \
172         lib/hmap.c \
173         lib/mac-learning.c \
174         lib/netdev.c \
175         lib/netlink.c \
176         lib/odp-util.c \
177         lib/poll-loop.c \
178         lib/process.c \
179         lib/rconn.c \
180         lib/timeval.c \
181         lib/unixctl.c \
182         lib/util.c \
183         lib/vconn.c \
184         secchan/ofproto.c \
185         secchan/pktbuf.c \
186         vswitchd/bridge.c \
187         vswitchd/mgmt.c \
188         vswitchd/ovs-brcompatd.c
189 lib/coverage-counters.c: $(COVERAGE_FILES) lib/coverage-scan.pl
190         (cd $(srcdir) && $(PERL) lib/coverage-scan.pl $(COVERAGE_FILES)) > $@.tmp
191         mv $@.tmp $@
192 EXTRA_DIST += lib/coverage-scan.pl