]> git.proxmox.com Git - ovs.git/blob - Makefile.am
FAQ.md: Fix typo
[ovs.git] / Makefile.am
1 # Copyright (C) 2007-2015 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 AUTOMAKE_OPTIONS = foreign subdir-objects
9 ACLOCAL_AMFLAGS = -I m4
10 SUBDIRS = datapath
11
12 AM_CPPFLAGS = $(SSL_CFLAGS)
13 AM_LDFLAGS = $(SSL_LDFLAGS)
14 AM_LDFLAGS += $(OVS_LDFLAGS)
15
16 if WIN32
17 AM_CPPFLAGS += -I $(top_srcdir)/include/windows
18 AM_CPPFLAGS += -I $(top_srcdir)/datapath-windows/include
19 AM_CPPFLAGS += $(PTHREAD_INCLUDES)
20 AM_CPPFLAGS += $(MSVC_CFLAGS)
21 AM_LDFLAGS += $(PTHREAD_LDFLAGS)
22 AM_LDFLAGS += $(MSVC64_LDFLAGS)
23 endif
24
25 AM_CPPFLAGS += -I $(top_srcdir)/include
26 AM_CPPFLAGS += -I $(top_builddir)/include
27 AM_CPPFLAGS += -I $(top_srcdir)/lib
28 AM_CPPFLAGS += -I $(top_builddir)/lib
29
30 AM_CPPFLAGS += $(SSL_INCLUDES)
31
32 AM_CFLAGS = -Wstrict-prototypes
33 AM_CFLAGS += $(WARNING_FLAGS)
34 AM_CFLAGS += $(OVS_CFLAGS)
35
36 if DPDK_NETDEV
37 AM_CFLAGS += -D_FILE_OFFSET_BITS=64
38 endif
39
40 if NDEBUG
41 AM_CPPFLAGS += -DNDEBUG
42 AM_CFLAGS += -fomit-frame-pointer
43 endif
44
45 if WIN32
46 psep=";"
47 else
48 psep=":"
49 endif
50 # PYTHONDONTWRITEBYTECODE=yes keeps Python from creating .pyc and .pyo
51 # files. Creating .py[co] works OK for any given version of Open
52 # vSwitch, but it causes trouble if you switch from a version with
53 # foo/__init__.py into an (older) version with plain foo.py, since
54 # foo/__init__.pyc will cause Python to ignore foo.py.
55 run_python = \
56 PYTHONPATH=$(top_srcdir)/python$(psep)$$PYTHONPATH \
57 PYTHONDONTWRITEBYTECODE=yes $(PYTHON)
58
59 ALL_LOCAL =
60 BUILT_SOURCES =
61 CLEANFILES =
62 CLEAN_LOCAL =
63 DISTCLEANFILES =
64 PYCOV_CLEAN_FILES = build-aux/check-structs,cover
65
66 # A list of Markdown-formatted documentation that will automatically be
67 # included in the "make dist-docs" output.
68 docs = \
69 CONTRIBUTING.md \
70 CodingStyle.md \
71 DESIGN.md \
72 FAQ.md \
73 INSTALL.md \
74 INSTALL.Debian.md \
75 INSTALL.Docker.md \
76 INSTALL.DPDK.md \
77 INSTALL.Fedora.md \
78 INSTALL.KVM.md \
79 INSTALL.Libvirt.md \
80 INSTALL.NetBSD.md \
81 INSTALL.RHEL.md \
82 INSTALL.SSL.md \
83 INSTALL.XenServer.md \
84 INSTALL.userspace.md \
85 INSTALL.Windows.md \
86 IntegrationGuide.md \
87 OPENFLOW-1.1+.md \
88 PORTING.md \
89 README.md \
90 README-lisp.md \
91 README-native-tunneling.md \
92 REPORTING-BUGS.md \
93 SECURITY.md \
94 TODO.md \
95 WHY-OVS.md
96 EXTRA_DIST = \
97 $(docs) \
98 NOTICE \
99 .travis.yml \
100 .travis/build.sh \
101 .travis/prepare.sh \
102 appveyor.yml \
103 boot.sh \
104 build-aux/cccl \
105 build-aux/cksum-schema-check \
106 build-aux/dist-docs \
107 build-aux/sodepends.pl \
108 build-aux/soexpand.pl \
109 build-aux/xml2nroff \
110 $(MAN_FRAGMENTS) \
111 $(MAN_ROOTS) \
112 Vagrantfile
113 bin_PROGRAMS =
114 sbin_PROGRAMS =
115 bin_SCRIPTS =
116 DIST_HOOKS =
117 dist_man_MANS =
118 dist_pkgdata_DATA =
119 dist_pkgdata_SCRIPTS =
120 dist_sbin_SCRIPTS =
121 dist_scripts_SCRIPTS =
122 dist_scripts_DATA =
123 INSTALL_DATA_LOCAL =
124 UNINSTALL_LOCAL =
125 man_MANS =
126 MAN_FRAGMENTS =
127 MAN_ROOTS =
128 noinst_DATA =
129 noinst_HEADERS =
130 lib_LTLIBRARIES =
131 noinst_man_MANS =
132 noinst_PROGRAMS =
133 noinst_SCRIPTS =
134 OVSIDL_BUILT =
135 pkgdata_DATA =
136 sbin_SCRIPTS =
137 scripts_SCRIPTS =
138 completion_SCRIPTS =
139 scripts_DATA =
140 SUFFIXES =
141 check_DATA =
142 check_SCRIPTS =
143 pkgconfig_DATA =
144
145 scriptsdir = $(pkgdatadir)/scripts
146 completiondir = $(sysconfdir)/bash_completion.d
147 pkgconfigdir = $(libdir)/pkgconfig
148
149 # This ensures that files added to EXTRA_DIST are always distributed,
150 # even if they are inside an Automake if...endif conditional block that is
151 # disabled by some particular "configure" run. For more information, see:
152 # http://article.gmane.org/gmane.comp.sysutils.automake.general/10891
153 noinst_HEADERS += $(EXTRA_DIST)
154
155 ro_c = echo '/* -*- mode: c; buffer-read-only: t -*- */'
156 ro_shell = printf '\043 Generated automatically -- do not modify! -*- buffer-read-only: t -*-\n'
157
158 SUFFIXES += .in
159 .in:
160 $(AM_V_GEN)$(PERL) $(srcdir)/build-aux/soexpand.pl -I$(srcdir) < $< | \
161 sed \
162 -e 's,[@]PKIDIR[@],$(PKIDIR),g' \
163 -e 's,[@]LOGDIR[@],$(LOGDIR),g' \
164 -e 's,[@]DBDIR[@],$(DBDIR),g' \
165 -e 's,[@]PERL[@],$(PERL),g' \
166 -e 's,[@]PYTHON[@],$(PYTHON),g' \
167 -e 's,[@]RUNDIR[@],$(RUNDIR),g' \
168 -e 's,[@]VERSION[@],$(VERSION),g' \
169 -e 's,[@]localstatedir[@],$(localstatedir),g' \
170 -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \
171 -e 's,[@]sysconfdir[@],$(sysconfdir),g' \
172 -e 's,[@]bindir[@],$(bindir),g' \
173 -e 's,[@]sbindir[@],$(sbindir),g' \
174 -e 's,[@]abs_builddir[@],$(abs_builddir),g' \
175 -e 's,[@]abs_top_srcdir[@],$(abs_top_srcdir),g' \
176 > $@.tmp
177 @if head -n 1 $@.tmp | grep '#!' > /dev/null; then \
178 chmod +x $@.tmp; \
179 fi
180 $(AM_V_at) mv $@.tmp $@
181
182 SUFFIXES += .xml
183 %: %.xml
184 $(AM_V_GEN)$(run_python) $(srcdir)/build-aux/xml2nroff $< > $@.tmp \
185 --version=$(VERSION) \
186 PKIDIR='$(PKIDIR)' \
187 LOGDIR='$(LOGDIR)' \
188 DBDIR='$(DBDIR)' \
189 PERL='$(PERL)' \
190 PYTHON='$(PYTHON)' \
191 RUNDIR='$(RUNDIR)' \
192 VERSION='$(VERSION)' \
193 localstatedir='$(localstatedir)' \
194 pkgdatadir='$(pkgdatadir)' \
195 sysconfdir='$(sysconfdir)' \
196 bindir='$(bindir)' \
197 sbindir='$(sbindir)'
198 $(AM_v_at)mv $@.tmp $@
199
200 .PHONY: clean-pycov
201 clean-pycov:
202 cd $(srcdir) && rm -f $(PYCOV_CLEAN_FILES)
203 CLEAN_LOCAL += clean-pycov
204
205 # If we're checked out from a Git repository, make sure that every
206 # file that is in Git is distributed.
207 #
208 # We only enable this check when GNU make is in use because the
209 # Makefile in datapath/linux, needed to get the list of files to
210 # distribute, requires GNU make extensions.
211 if GNU_MAKE
212 ALL_LOCAL += dist-hook-git
213 dist-hook-git: distfiles
214 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \
215 (cd datapath && $(MAKE) distfiles); \
216 (cat distfiles; sed 's|^|datapath/|' datapath/distfiles) | \
217 LC_ALL=C sort -u > all-distfiles; \
218 (cd $(srcdir) && git ls-files) | grep -v '\.gitignore$$' | \
219 LC_ALL=C sort -u > all-gitfiles; \
220 LC_ALL=C comm -1 -3 all-distfiles all-gitfiles > missing-distfiles; \
221 if test -s missing-distfiles; then \
222 echo "The following files are in git but not the distribution:"; \
223 cat missing-distfiles; \
224 exit 1; \
225 fi; \
226 fi
227 CLEANFILES += all-distfiles all-gitfiles missing-distfiles
228 # The following is based on commands for the Automake "distdir" target.
229 distfiles: Makefile
230 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
231 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
232 list='$(DISTFILES)'; \
233 for file in $$list; do echo $$file; done | \
234 sed -e "s|^$$srcdirstrip/||;t" \
235 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | \
236 LC_ALL=C sort -u > $@
237 CLEANFILES += distfiles
238 endif
239 .PHONY: dist-hook-git
240
241 # Check that every .c file includes <config.h>.
242 ALL_LOCAL += config-h-check
243 config-h-check:
244 @cd $(srcdir); \
245 if test -e .git && (git --version) >/dev/null 2>&1 && \
246 git --no-pager grep -L '#include <config\.h>' `git ls-files | grep '\.c$$' | \
247 grep -vE '^datapath|^lib/sflow|^third-party|^datapath-windows'`; \
248 then \
249 echo "See above for list of violations of the rule that"; \
250 echo "every C source file must #include <config.h>."; \
251 exit 1; \
252 fi
253 .PHONY: config-h-check
254
255 # Check for printf() type modifiers that MSVC doesn't support.
256 ALL_LOCAL += printf-check
257 printf-check:
258 @cd $(srcdir); \
259 if test -e .git && (git --version) >/dev/null 2>&1 && \
260 git --no-pager grep -n -E -e '%[-+ #0-9.*]*([ztj]|hh)' --and --not -e 'ovs_scan' `git ls-files | grep '\.[ch]$$' | \
261 grep -vE '^datapath|^lib/sflow|^third-party'`; \
262 then \
263 echo "See above for list of violations of the rule that"; \
264 echo "'z', 't', 'j', 'hh' printf() type modifiers are"; \
265 echo "forbidden. See CodingStyle.md for replacements."; \
266 exit 1; \
267 fi
268 .PHONY: printf-check
269
270 # Check that certain data structures are always declared "static".
271 ALL_LOCAL += static-check
272 static-check:
273 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
274 git --no-pager grep -n -E '^[ ]+(struct vlog_rate_limit|pthread_once_t|struct ovsthread_once).*=' $(srcdir); \
275 then \
276 echo "See above for list of violations of the rule that "; \
277 echo "certain data structures must always be 'static'"; \
278 exit 1; \
279 fi
280 .PHONY: static-check
281
282 # Check that assert.h is not used outside a whitelist of files.
283 ALL_LOCAL += check-assert-h-usage
284 check-assert-h-usage:
285 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
286 (cd $(srcdir) && git --no-pager grep -l -E '[<]assert.h[>]') | \
287 $(EGREP) -v '^lib/(sflow_receiver|vlog).c$$|^tests/'; \
288 then \
289 echo "Files listed above unexpectedly #include <""assert.h"">."; \
290 echo "Please use ovs_assert (from util.h) instead of assert."; \
291 exit 1; \
292 fi
293 .PHONY: check-assert-h-usage
294
295 # Check that LITTLE_ENDIAN and BIG_ENDIAN are not used unless BYTE_ORDER is
296 # also mentioned. (<endian.h> always defines the former two constants. They
297 # must be compared to BYTE_ORDER to get the machine's correct endianness. But
298 # it is better to use WORDS_BIGENDIAN.)
299 ALL_LOCAL += check-endian
300 check-endian:
301 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
302 (cd $(srcdir) && git --no-pager grep -l -E \
303 -e 'BIG_ENDIAN|LITTLE_ENDIAN' --and --not -e 'BYTE_ORDER' | \
304 $(EGREP) -v '^datapath/'); \
305 then \
306 echo "See above for list of files that misuse LITTLE""_ENDIAN"; \
307 echo "or BIG""_ENDIAN. Please use WORDS_BIGENDIAN instead."; \
308 exit 1; \
309 fi
310 .PHONY: check-endian
311
312 ALL_LOCAL += thread-safety-check
313 thread-safety-check:
314 @cd $(srcdir); \
315 if test -e .git && (git --version) >/dev/null 2>&1 && \
316 grep -n -f build-aux/thread-safety-blacklist \
317 `git ls-files | grep '\.[ch]$$' \
318 | $(EGREP) -v '^datapath|^lib/sflow|^third-party'` /dev/null \
319 | $(EGREP) -v ':[ ]*/?\*'; \
320 then \
321 echo "See above for list of calls to functions that are"; \
322 echo "blacklisted due to thread safety issues"; \
323 exit 1; \
324 fi
325 EXTRA_DIST += build-aux/thread-safety-blacklist
326
327 if HAVE_GROFF
328 ALL_LOCAL += manpage-check
329 manpage-check: $(man_MANS) $(dist_man_MANS) $(noinst_man_MANS)
330 @error=false; \
331 for manpage in $?; do \
332 LANG=en_US.UTF-8 groff -w mac -w delim -w escape -w input -w missing -w tab -T utf8 -man -p -z $$manpage >$@.tmp 2>&1; \
333 if grep warning: $@.tmp; then error=:; fi; \
334 rm -f $@.tmp; \
335 done; \
336 if $$error; then exit 1; else touch $@; fi
337 $(AM_V_GEN) touch -c $@
338 CLEANFILES += manpage-check
339 endif
340
341 include $(srcdir)/manpages.mk
342 $(srcdir)/manpages.mk: $(MAN_ROOTS) build-aux/sodepends.pl
343 @$(PERL) $(srcdir)/build-aux/sodepends.pl -I. -I$(srcdir) $(MAN_ROOTS) >$(@F).tmp
344 @if cmp -s $(@F).tmp $@; then \
345 touch $@; \
346 rm -f $(@F).tmp; \
347 else \
348 mv $(@F).tmp $@; \
349 fi
350 CLEANFILES += manpage-dep-check
351
352 if VSTUDIO_DDK
353 ALL_LOCAL += ovsext_make
354 ovsext_make: datapath-windows/ovsext.sln
355 MSBuild.exe datapath-windows/ovsext.sln /target:Build /property:Configuration="Win8$(VSTUDIO_CONFIG)"
356 MSBuild.exe datapath-windows/ovsext.sln /target:Build /property:Configuration="Win8.1$(VSTUDIO_CONFIG)"
357
358 CLEAN_LOCAL += ovsext_clean
359 ovsext_clean: datapath-windows/ovsext.sln
360 MSBuild.exe datapath-windows/ovsext.sln /target:Clean /property:Configuration="Win8$(VSTUDIO_CONFIG)"
361 MSBuild.exe datapath-windows/ovsext.sln /target:Clean /property:Configuration="Win8.1$(VSTUDIO_CONFIG)"
362 endif
363
364 dist-hook: $(DIST_HOOKS)
365 all-local: $(ALL_LOCAL)
366 clean-local: $(CLEAN_LOCAL)
367 install-data-local: $(INSTALL_DATA_LOCAL)
368 uninstall-local: $(UNINSTALL_LOCAL)
369 .PHONY: $(DIST_HOOKS) $(CLEAN_LOCAL) $(INSTALL_DATA_LOCAL) $(UNINSTALL_LOCAL)
370
371 modules_install:
372 if LINUX_ENABLED
373 cd datapath/linux && $(MAKE) modules_install
374 endif
375
376 dist-docs:
377 VERSION=$(VERSION) $(srcdir)/build-aux/dist-docs $(srcdir) $(docs)
378 .PHONY: dist-docs
379
380 include Documentation/automake.mk
381 include m4/automake.mk
382 include lib/automake.mk
383 include ofproto/automake.mk
384 include utilities/automake.mk
385 include tests/automake.mk
386 include include/automake.mk
387 include third-party/automake.mk
388 include debian/automake.mk
389 include vswitchd/automake.mk
390 include ovsdb/automake.mk
391 include rhel/automake.mk
392 include xenserver/automake.mk
393 include python/automake.mk
394 include tutorial/automake.mk
395 include vtep/automake.mk
396 include datapath-windows/automake.mk
397 include datapath-windows/include/automake.mk
398 include windows/automake.mk
399 include ovn/automake.mk