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