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