]> git.proxmox.com Git - mirror_ovs.git/blame - Makefile.am
FAQ: Replace reference to OVS 2.2 with 2.3.
[mirror_ovs.git] / Makefile.am
CommitLineData
7868fbc6 1# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 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
BP
34
35if NDEBUG
36AM_CPPFLAGS += -DNDEBUG
37AM_CFLAGS += -fomit-frame-pointer
064af421
BP
38endif
39
b02e1154
GS
40if WIN32
41psep=";"
42else
43psep=":"
44endif
853d1083
BP
45# PYTHONDONTWRITEBYTECODE=yes keeps Python from creating .pyc and .pyo
46# files. Creating .py[co] works OK for any given version of Open
47# vSwitch, but it causes trouble if you switch from a version with
48# foo/__init__.py into an (older) version with plain foo.py, since
49# foo/__init__.pyc will cause Python to ignore foo.py.
9b4a5392 50if INCLUDE_PYTHON_COMPAT
b02e1154 51run_python = PYTHONPATH=$(top_srcdir)/python$(psep)$(top_srcdir)/python/compat$(psep)$$PYTHONPATH
9b4a5392 52else
b02e1154 53run_python = PYTHONPATH=$(top_srcdir)/python$(psep)$$PYTHONPATH
9b4a5392
AA
54endif
55run_python += PYTHONDONTWRITEBYTECODE=yes $(PYTHON)
56
853d1083 57
22c79496 58ALL_LOCAL =
d879a707 59BUILT_SOURCES =
064af421 60CLEANFILES =
15b619e2 61CLEAN_LOCAL =
064af421 62DISTCLEANFILES =
79982e90 63PYCOV_CLEAN_FILES = build-aux/check-structs,cover
4cdb08c0 64EXTRA_DIST = \
bee83872 65 CONTRIBUTING \
4cdb08c0 66 CodingStyle \
d31f1109 67 DESIGN \
c483d489 68 FAQ \
f6eb6b20 69 INSTALL \
6494ea4c 70 INSTALL.Debian \
8a9562d2 71 INSTALL.DPDK \
6dcf2bc3 72 INSTALL.Fedora \
6cdd6a87 73 INSTALL.KVM \
8a984481 74 INSTALL.Libvirt \
0f3df203 75 INSTALL.NetBSD \
c434706a 76 INSTALL.RHEL \
c2d1694f 77 INSTALL.SSL \
9678a9b6 78 INSTALL.XenServer \
4cdb08c0 79 INSTALL.userspace \
c803536e 80 INSTALL.Windows \
98f61d42 81 IntegrationGuide \
4cdb08c0 82 NOTICE \
bea97716 83 OPENFLOW-1.1+ \
bc34d060 84 PORTING \
a6ae068b 85 README-lisp \
4cdb08c0 86 REPORTING-BUGS \
84f7a527 87 TODO \
826bc7b6
TG
88 .travis.yml \
89 .travis/build.sh \
90 .travis/prepare.sh \
3c34dd48 91 WHY-OVS \
0027492d 92 boot.sh \
c9b94429 93 build-aux/cccl \
6ca37677 94 build-aux/sodepends.pl \
94512c4a 95 build-aux/soexpand.pl \
6ca37677
BP
96 $(MAN_FRAGMENTS) \
97 $(MAN_ROOTS)
064af421
BP
98bin_PROGRAMS =
99sbin_PROGRAMS =
100bin_SCRIPTS =
87103e1f 101DIST_HOOKS =
064af421 102dist_man_MANS =
3b12adda 103dist_pkgdata_DATA =
064af421
BP
104dist_pkgdata_SCRIPTS =
105dist_sbin_SCRIPTS =
b2df0225 106dist_scripts_SCRIPTS =
429ebf21 107dist_scripts_DATA =
b2df0225 108INSTALL_DATA_LOCAL =
44852fdf 109UNINSTALL_LOCAL =
064af421 110man_MANS =
0027492d 111MAN_FRAGMENTS =
6ca37677 112MAN_ROOTS =
c3bb4bd7 113noinst_DATA =
064af421 114noinst_HEADERS =
38b7a52b 115lib_LTLIBRARIES =
045b2e5c 116noinst_man_MANS =
064af421
BP
117noinst_PROGRAMS =
118noinst_SCRIPTS =
00732bf5 119OVSIDL_BUILT =
9c16ed64 120pkgdata_DATA =
b2df0225 121sbin_SCRIPTS =
43bb5f82 122scripts_SCRIPTS =
429ebf21 123scripts_DATA =
c3bb4bd7 124SUFFIXES =
15b619e2 125check_DATA =
064af421 126
43bb5f82
BP
127scriptsdir = $(pkgdatadir)/scripts
128
9741af79
BP
129# This ensures that files added to EXTRA_DIST are always distributed,
130# even if they are inside an Automake if...endif conditional block that is
131# disabled by some particular "configure" run. For more information, see:
132# http://article.gmane.org/gmane.comp.sysutils.automake.general/10891
133noinst_HEADERS += $(EXTRA_DIST)
134
064af421 135ro_c = echo '/* -*- mode: c; buffer-read-only: t -*- */'
cbaa4ffe 136ro_shell = printf '\043 Generated automatically -- do not modify! -*- buffer-read-only: t -*-\n'
064af421 137
c3bb4bd7 138SUFFIXES += .in
064af421 139.in:
94512c4a 140 $(PERL) $(srcdir)/build-aux/soexpand.pl -I$(srcdir) < $< | \
3b135da3 141 sed \
064af421 142 -e 's,[@]PKIDIR[@],$(PKIDIR),g' \
3b135da3 143 -e 's,[@]LOGDIR[@],$(LOGDIR),g' \
f973f2af 144 -e 's,[@]DBDIR[@],$(DBDIR),g' \
3b135da3
BP
145 -e 's,[@]PERL[@],$(PERL),g' \
146 -e 's,[@]PYTHON[@],$(PYTHON),g' \
064af421 147 -e 's,[@]RUNDIR[@],$(RUNDIR),g' \
3b135da3
BP
148 -e 's,[@]VERSION[@],$(VERSION),g' \
149 -e 's,[@]localstatedir[@],$(localstatedir),g' \
064af421 150 -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \
3b135da3 151 -e 's,[@]sysconfdir[@],$(sysconfdir),g' \
43bb5f82
BP
152 -e 's,[@]bindir[@],$(bindir),g' \
153 -e 's,[@]sbindir[@],$(sbindir),g' \
d879a707 154 -e 's,[@]abs_top_srcdir[@],$(abs_top_srcdir),g' \
3b135da3 155 > $@.tmp
00961f7c 156 @if head -n 1 $@.tmp | grep '#!' > /dev/null; then \
3b135da3
BP
157 chmod +x $@.tmp; \
158 fi
be09aa10 159 $(AM_V_GEN) mv $@.tmp $@
064af421 160
79982e90
EJ
161.PHONY: clean-pycov
162clean-pycov:
163 cd $(srcdir) && rm -f $(PYCOV_CLEAN_FILES)
164CLEAN_LOCAL += clean-pycov
165
87103e1f
BP
166# If we're checked out from a Git repository, make sure that every
167# file that is in Git is distributed.
b4e1bf8b
BP
168#
169# We only enable this check when GNU make is in use because the
170# Makefile in datapath/linux, needed to get the list of files to
171# distribute, requires GNU make extensions.
172if GNU_MAKE
39376d06
BP
173ALL_LOCAL += dist-hook-git
174dist-hook-git: distfiles
175 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \
176 (cd datapath && $(MAKE) distfiles); \
177 (cat distfiles; sed 's|^|datapath/|' datapath/distfiles) | \
a6da6967 178 LC_ALL=C sort -u > all-distfiles; \
39376d06 179 (cd $(srcdir) && git ls-files) | grep -v '\.gitignore$$' | \
a6da6967
BP
180 LC_ALL=C sort -u > all-gitfiles; \
181 LC_ALL=C comm -1 -3 all-distfiles all-gitfiles > missing-distfiles; \
39376d06
BP
182 if test -s missing-distfiles; then \
183 echo "The distribution is missing the following files:"; \
184 cat missing-distfiles; \
185 exit 1; \
186 fi; \
87103e1f 187 fi
39376d06
BP
188CLEANFILES += all-distfiles all-gitfiles missing-distfiles
189# The following is based on commands for the Automake "distdir" target.
190distfiles: Makefile
191 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
192 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
193 list='$(DISTFILES)'; \
194 for file in $$list; do echo $$file; done | \
195 sed -e "s|^$$srcdirstrip/||;t" \
a6da6967
BP
196 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | \
197 LC_ALL=C sort -u > $@
39376d06 198CLEANFILES += distfiles
b4e1bf8b
BP
199endif
200.PHONY: dist-hook-git
87103e1f 201
9e4ba008
BP
202# Check that every .c file includes <config.h>.
203ALL_LOCAL += config-h-check
204config-h-check:
205 @cd $(srcdir); \
206 if test -e .git && (git --version) >/dev/null 2>&1 && \
b411e5c3 207 git --no-pager grep -L '#include <config\.h>' `git ls-files | grep '\.c$$' | \
c803536e 208 grep -vE '^datapath|^lib/sflow|^third-party|^datapath-windows'`; \
9e4ba008
BP
209 then \
210 echo "See above for list of violations of the rule that"; \
211 echo "every C source file must #include <config.h>."; \
212 exit 1; \
213 fi
214.PHONY: config-h-check
215
34582733
AS
216# Check for printf() type modifiers that MSVC doesn't support.
217ALL_LOCAL += printf-check
218printf-check:
8faeab72
DDP
219 @cd $(srcdir); \
220 if test -e .git && (git --version) >/dev/null 2>&1 && \
221 git --no-pager grep -n -E -e '%[-+ #0-9.*]*([ztj]|hh)' --and --not -e 'ovs_scan' `git ls-files | grep '\.[ch]$$' | \
3b3f8857 222 grep -vE '^datapath|^lib/sflow|^third-party'`; \
34582733
AS
223 then \
224 echo "See above for list of violations of the rule that"; \
225 echo "'z', 't', 'j', 'hh' printf() type modifiers are"; \
226 echo "forbidden. See CodingStyle for replacements."; \
227 exit 1; \
228 fi
229.PHONY: printf-check
230
1514b275
BP
231# Check that certain data structures are always declared "static".
232ALL_LOCAL += static-check
233static-check:
db5ce514 234 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
1514b275 235 git --no-pager grep -n -E '^[ ]+(struct vlog_rate_limit|pthread_once_t|struct ovsthread_once).*=' $(srcdir); \
db5ce514
BP
236 then \
237 echo "See above for list of violations of the rule that "; \
1514b275 238 echo "certain data structures must always be 'static'"; \
db5ce514
BP
239 exit 1; \
240 fi
1514b275 241.PHONY: static-check
db5ce514 242
4958e3ee
BP
243# Check that assert.h is not used outside a whitelist of files.
244ALL_LOCAL += check-assert-h-usage
245check-assert-h-usage:
246 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
247 (cd $(srcdir) && git --no-pager grep -l -E '[<]assert.h[>]') | \
92fa2e92 248 $(EGREP) -v '^lib/(sflow_receiver|vlog).c$$|^tests/'; \
4958e3ee
BP
249 then \
250 echo "Files listed above unexpectedly #include <""assert.h"">."; \
251 echo "Please use ovs_assert (from util.h) instead of assert."; \
252 exit 1; \
253 fi
254.PHONY: check-assert-h-usage
255
6a3e30f3
BP
256ALL_LOCAL += thread-safety-check
257thread-safety-check:
8faeab72
DDP
258 @cd $(srcdir); \
259 if test -e .git && (git --version) >/dev/null 2>&1 && \
260 grep -n -f build-aux/thread-safety-blacklist \
261 `git ls-files | grep '\.[ch]$$' \
ca3d034b 262 | $(EGREP) -v '^datapath|^lib/sflow|^third-party'` /dev/null \
6a3e30f3
BP
263 | $(EGREP) -v ':[ ]*/?\*'; \
264 then \
265 echo "See above for list of calls to functions that are"; \
266 echo "blacklisted due to thread safety issues"; \
267 exit 1; \
268 fi
269EXTRA_DIST += build-aux/thread-safety-blacklist
270
0027492d
BP
271if HAVE_GROFF
272ALL_LOCAL += manpage-check
1261619f
BP
273manpage-check: $(man_MANS) $(dist_man_MANS) $(noinst_man_MANS)
274 @error=false; \
275 for manpage in $?; do \
186ef5c1 276 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
277 if grep warning: $@.tmp; then error=:; fi; \
278 rm -f $@.tmp; \
0027492d 279 done; \
be09aa10
EJ
280 if $$error; then exit 1; else touch $@; fi
281 $(AM_V_GEN) touch -c $@
0027492d
BP
282CLEANFILES += manpage-check
283endif
284
6ca37677
BP
285include $(srcdir)/manpages.mk
286$(srcdir)/manpages.mk: $(MAN_ROOTS) build-aux/sodepends.pl
287 @$(PERL) $(srcdir)/build-aux/sodepends.pl -I. -I$(srcdir) $(MAN_ROOTS) >$(@F).tmp
288 @if cmp -s $(@F).tmp $@; then \
289 touch $@; \
290 rm -f $(@F).tmp; \
291 else \
292 mv $(@F).tmp $@; \
293 fi
294CLEANFILES += manpage-dep-check
295
bd9d7025
AS
296if VSTUDIO_DDK
297ALL_LOCAL += ovsext_make
298ovsext_make: datapath-windows/ovsext.sln
299 MSBuild.exe datapath-windows/ovsext.sln /target:Build /property:Configuration="$(VSTUDIO_CONFIG)"
300
301CLEAN_LOCAL += ovsext_clean
302ovsext_clean: datapath-windows/ovsext.sln
303 MSBuild.exe datapath-windows/ovsext.sln /target:Clean /property:Configuration="$(VSTUDIO_CONFIG)"
304endif
305
87103e1f 306dist-hook: $(DIST_HOOKS)
22c79496 307all-local: $(ALL_LOCAL)
15b619e2 308clean-local: $(CLEAN_LOCAL)
b2df0225 309install-data-local: $(INSTALL_DATA_LOCAL)
44852fdf
BP
310uninstall-local: $(UNINSTALL_LOCAL)
311.PHONY: $(DIST_HOOKS) $(CLEAN_LOCAL) $(INSTALL_DATA_LOCAL) $(UNINSTALL_LOCAL)
87103e1f 312
3a14d239
BP
313modules_install:
314if LINUX_ENABLED
315 cd datapath/linux && $(MAKE) modules_install
316endif
317
ed1be787 318include m4/automake.mk
064af421 319include lib/automake.mk
8cd4882f 320include ofproto/automake.mk
064af421
BP
321include utilities/automake.mk
322include tests/automake.mk
323include include/automake.mk
324include third-party/automake.mk
325include debian/automake.mk
326include vswitchd/automake.mk
f85f8ebb 327include ovsdb/automake.mk
c434706a 328include rhel/automake.mk
064af421 329include xenserver/automake.mk
0be6140a 330include python/automake.mk
6c88547d 331include python/compat/automake.mk
eeecce05 332include tutorial/automake.mk
add17b69 333include vtep/automake.mk
c803536e 334include datapath-windows/automake.mk
c640e3ce 335include datapath-windows/include/automake.mk