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