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