]> git.proxmox.com Git - ovs.git/blob - Makefile.am
netdev-dpdk: create queues on configured NUMA node
[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 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
212 git --no-pager grep -n -E -e '%[-+ #0-9.*]*([ztj]|hh)' --and --not -e 'ovs_scan' `git ls-files $(srcdir) | grep '\.[ch]$$' | \
213 grep -vE '^datapath|^lib/sflow|^third-party'`; \
214 then \
215 echo "See above for list of violations of the rule that"; \
216 echo "'z', 't', 'j', 'hh' printf() type modifiers are"; \
217 echo "forbidden. See CodingStyle for replacements."; \
218 exit 1; \
219 fi
220 .PHONY: printf-check
221
222 # Check that certain data structures are always declared "static".
223 ALL_LOCAL += static-check
224 static-check:
225 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
226 git --no-pager grep -n -E '^[ ]+(struct vlog_rate_limit|pthread_once_t|struct ovsthread_once).*=' $(srcdir); \
227 then \
228 echo "See above for list of violations of the rule that "; \
229 echo "certain data structures must always be 'static'"; \
230 exit 1; \
231 fi
232 .PHONY: static-check
233
234 # Check that assert.h is not used outside a whitelist of files.
235 ALL_LOCAL += check-assert-h-usage
236 check-assert-h-usage:
237 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
238 (cd $(srcdir) && git --no-pager grep -l -E '[<]assert.h[>]') | \
239 $(EGREP) -v '^lib/(sflow_receiver|vlog).c$$|^tests/'; \
240 then \
241 echo "Files listed above unexpectedly #include <""assert.h"">."; \
242 echo "Please use ovs_assert (from util.h) instead of assert."; \
243 exit 1; \
244 fi
245 .PHONY: check-assert-h-usage
246
247 ALL_LOCAL += thread-safety-check
248 thread-safety-check:
249 @if test -e '$(srcdir)'/.git && (git --version) >/dev/null 2>&1 && \
250 grep -n -f '$(srcdir)'/build-aux/thread-safety-blacklist \
251 `git ls-files '$(srcdir)' | grep '\.[ch]$$' \
252 | $(EGREP) -v '^datapath|^lib/sflow|^third-party'` /dev/null \
253 | $(EGREP) -v ':[ ]*/?\*'; \
254 then \
255 echo "See above for list of calls to functions that are"; \
256 echo "blacklisted due to thread safety issues"; \
257 exit 1; \
258 fi
259 EXTRA_DIST += build-aux/thread-safety-blacklist
260
261 if HAVE_GROFF
262 ALL_LOCAL += manpage-check
263 manpage-check: $(man_MANS) $(dist_man_MANS) $(noinst_man_MANS)
264 @error=false; \
265 for manpage in $?; do \
266 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; \
267 if grep warning: $@.tmp; then error=:; fi; \
268 rm -f $@.tmp; \
269 done; \
270 if $$error; then exit 1; else touch $@; fi
271 $(AM_V_GEN) touch -c $@
272 CLEANFILES += manpage-check
273 endif
274
275 include $(srcdir)/manpages.mk
276 $(srcdir)/manpages.mk: $(MAN_ROOTS) build-aux/sodepends.pl
277 @$(PERL) $(srcdir)/build-aux/sodepends.pl -I. -I$(srcdir) $(MAN_ROOTS) >$(@F).tmp
278 @if cmp -s $(@F).tmp $@; then \
279 touch $@; \
280 rm -f $(@F).tmp; \
281 else \
282 mv $(@F).tmp $@; \
283 fi
284 CLEANFILES += manpage-dep-check
285
286 dist-hook: $(DIST_HOOKS)
287 all-local: $(ALL_LOCAL)
288 clean-local: $(CLEAN_LOCAL)
289 install-data-local: $(INSTALL_DATA_LOCAL)
290 uninstall-local: $(UNINSTALL_LOCAL)
291 .PHONY: $(DIST_HOOKS) $(CLEAN_LOCAL) $(INSTALL_DATA_LOCAL) $(UNINSTALL_LOCAL)
292
293 modules_install:
294 if LINUX_ENABLED
295 cd datapath/linux && $(MAKE) modules_install
296 endif
297
298 include m4/automake.mk
299 include lib/automake.mk
300 include ofproto/automake.mk
301 include utilities/automake.mk
302 include tests/automake.mk
303 include include/automake.mk
304 include third-party/automake.mk
305 include debian/automake.mk
306 include vswitchd/automake.mk
307 include ovsdb/automake.mk
308 include rhel/automake.mk
309 include xenserver/automake.mk
310 include python/automake.mk
311 include python/compat/automake.mk
312 include tutorial/automake.mk
313 include vtep/automake.mk