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