]> git.proxmox.com Git - mirror_ovs.git/blame - Makefile.am
debian: Remove old PKI directory migration code
[mirror_ovs.git] / Makefile.am
CommitLineData
f0664242 1# Copyright (C) 2007-2015 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)
1cb3649c 22AM_LDFLAGS += $(MSVC64_LDFLAGS)
e42dfc72
AS
23endif
24
064af421 25AM_CPPFLAGS += -I $(top_srcdir)/include
837eefc7 26AM_CPPFLAGS += -I $(top_builddir)/include
064af421 27AM_CPPFLAGS += -I $(top_srcdir)/lib
611d30ce 28AM_CPPFLAGS += -I $(top_builddir)/lib
064af421 29
8605a29b
PK
30AM_CPPFLAGS += $(SSL_INCLUDES)
31
064af421 32AM_CFLAGS = -Wstrict-prototypes
d161c099 33AM_CFLAGS += $(WARNING_FLAGS)
95626395 34AM_CFLAGS += $(OVS_CFLAGS)
064af421 35
58397e6c
KT
36if DPDK_NETDEV
37AM_CFLAGS += -D_FILE_OFFSET_BITS=64
38endif
39
064af421
BP
40if NDEBUG
41AM_CPPFLAGS += -DNDEBUG
42AM_CFLAGS += -fomit-frame-pointer
064af421
BP
43endif
44
b02e1154
GS
45if WIN32
46psep=";"
47else
48psep=":"
49endif
853d1083
BP
50# PYTHONDONTWRITEBYTECODE=yes keeps Python from creating .pyc and .pyo
51# files. Creating .py[co] works OK for any given version of Open
52# vSwitch, but it causes trouble if you switch from a version with
53# foo/__init__.py into an (older) version with plain foo.py, since
54# foo/__init__.pyc will cause Python to ignore foo.py.
e23812fc
BP
55run_python = \
56 PYTHONPATH=$(top_srcdir)/python$(psep)$$PYTHONPATH \
57 PYTHONDONTWRITEBYTECODE=yes $(PYTHON)
853d1083 58
22c79496 59ALL_LOCAL =
d879a707 60BUILT_SOURCES =
064af421 61CLEANFILES =
15b619e2 62CLEAN_LOCAL =
064af421 63DISTCLEANFILES =
79982e90 64PYCOV_CLEAN_FILES = build-aux/check-structs,cover
4441a01c
BP
65
66# A list of Markdown-formatted documentation that will automatically be
67# included in the "make dist-docs" output.
68docs = \
542cc9bb
TG
69 CONTRIBUTING.md \
70 CodingStyle.md \
71 DESIGN.md \
72 FAQ.md \
73 INSTALL.md \
74 INSTALL.Debian.md \
75 INSTALL.Docker.md \
76 INSTALL.DPDK.md \
77 INSTALL.Fedora.md \
78 INSTALL.KVM.md \
79 INSTALL.Libvirt.md \
80 INSTALL.NetBSD.md \
81 INSTALL.RHEL.md \
82 INSTALL.SSL.md \
83 INSTALL.XenServer.md \
84 INSTALL.userspace.md \
85 INSTALL.Windows.md \
86 IntegrationGuide.md \
542cc9bb
TG
87 OPENFLOW-1.1+.md \
88 PORTING.md \
d25e2f57 89 README.md \
542cc9bb 90 README-lisp.md \
a36de779 91 README-native-tunneling.md \
542cc9bb 92 REPORTING-BUGS.md \
f0664242 93 SECURITY.md \
542cc9bb 94 TODO.md \
4441a01c
BP
95 WHY-OVS.md
96EXTRA_DIST = \
97 $(docs) \
98 NOTICE \
826bc7b6
TG
99 .travis.yml \
100 .travis/build.sh \
101 .travis/prepare.sh \
12c96b8a 102 appveyor.yml \
0027492d 103 boot.sh \
c9b94429 104 build-aux/cccl \
abc67c1e 105 build-aux/cksum-schema-check \
4441a01c 106 build-aux/dist-docs \
6ca37677 107 build-aux/sodepends.pl \
94512c4a 108 build-aux/soexpand.pl \
a4e3c495 109 build-aux/xml2nroff \
6ca37677 110 $(MAN_FRAGMENTS) \
1ce96d2a 111 $(MAN_ROOTS) \
b56b2566 112 Vagrantfile
064af421
BP
113bin_PROGRAMS =
114sbin_PROGRAMS =
115bin_SCRIPTS =
87103e1f 116DIST_HOOKS =
064af421 117dist_man_MANS =
3b12adda 118dist_pkgdata_DATA =
064af421
BP
119dist_pkgdata_SCRIPTS =
120dist_sbin_SCRIPTS =
b2df0225 121dist_scripts_SCRIPTS =
429ebf21 122dist_scripts_DATA =
b2df0225 123INSTALL_DATA_LOCAL =
44852fdf 124UNINSTALL_LOCAL =
064af421 125man_MANS =
0027492d 126MAN_FRAGMENTS =
6ca37677 127MAN_ROOTS =
c3bb4bd7 128noinst_DATA =
064af421 129noinst_HEADERS =
38b7a52b 130lib_LTLIBRARIES =
045b2e5c 131noinst_man_MANS =
064af421
BP
132noinst_PROGRAMS =
133noinst_SCRIPTS =
00732bf5 134OVSIDL_BUILT =
9c16ed64 135pkgdata_DATA =
b2df0225 136sbin_SCRIPTS =
43bb5f82 137scripts_SCRIPTS =
2c9907cd 138completion_SCRIPTS =
429ebf21 139scripts_DATA =
c3bb4bd7 140SUFFIXES =
15b619e2 141check_DATA =
08d42548 142check_SCRIPTS =
81696de0 143pkgconfig_DATA =
064af421 144
43bb5f82 145scriptsdir = $(pkgdatadir)/scripts
2c9907cd 146completiondir = $(sysconfdir)/bash_completion.d
81696de0 147pkgconfigdir = $(libdir)/pkgconfig
43bb5f82 148
9741af79
BP
149# This ensures that files added to EXTRA_DIST are always distributed,
150# even if they are inside an Automake if...endif conditional block that is
151# disabled by some particular "configure" run. For more information, see:
152# http://article.gmane.org/gmane.comp.sysutils.automake.general/10891
153noinst_HEADERS += $(EXTRA_DIST)
154
064af421 155ro_c = echo '/* -*- mode: c; buffer-read-only: t -*- */'
cbaa4ffe 156ro_shell = printf '\043 Generated automatically -- do not modify! -*- buffer-read-only: t -*-\n'
064af421 157
c3bb4bd7 158SUFFIXES += .in
064af421 159.in:
ef44aa50 160 $(AM_V_GEN)$(PERL) $(srcdir)/build-aux/soexpand.pl -I$(srcdir) < $< | \
3b135da3 161 sed \
064af421 162 -e 's,[@]PKIDIR[@],$(PKIDIR),g' \
3b135da3 163 -e 's,[@]LOGDIR[@],$(LOGDIR),g' \
f973f2af 164 -e 's,[@]DBDIR[@],$(DBDIR),g' \
3b135da3
BP
165 -e 's,[@]PERL[@],$(PERL),g' \
166 -e 's,[@]PYTHON[@],$(PYTHON),g' \
064af421 167 -e 's,[@]RUNDIR[@],$(RUNDIR),g' \
3b135da3
BP
168 -e 's,[@]VERSION[@],$(VERSION),g' \
169 -e 's,[@]localstatedir[@],$(localstatedir),g' \
064af421 170 -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \
3b135da3 171 -e 's,[@]sysconfdir[@],$(sysconfdir),g' \
43bb5f82
BP
172 -e 's,[@]bindir[@],$(bindir),g' \
173 -e 's,[@]sbindir[@],$(sbindir),g' \
6901639b 174 -e 's,[@]abs_builddir[@],$(abs_builddir),g' \
d879a707 175 -e 's,[@]abs_top_srcdir[@],$(abs_top_srcdir),g' \
3b135da3 176 > $@.tmp
00961f7c 177 @if head -n 1 $@.tmp | grep '#!' > /dev/null; then \
3b135da3
BP
178 chmod +x $@.tmp; \
179 fi
ef44aa50 180 $(AM_V_at) mv $@.tmp $@
064af421 181
99635791
BP
182SUFFIXES += .xml
183%: %.xml
184 $(AM_V_GEN)$(run_python) $(srcdir)/build-aux/xml2nroff $< > $@.tmp \
185 --version=$(VERSION) \
186 PKIDIR='$(PKIDIR)' \
187 LOGDIR='$(LOGDIR)' \
188 DBDIR='$(DBDIR)' \
189 PERL='$(PERL)' \
190 PYTHON='$(PYTHON)' \
191 RUNDIR='$(RUNDIR)' \
192 VERSION='$(VERSION)' \
193 localstatedir='$(localstatedir)' \
194 pkgdatadir='$(pkgdatadir)' \
195 sysconfdir='$(sysconfdir)' \
196 bindir='$(bindir)' \
197 sbindir='$(sbindir)'
198 $(AM_v_at)mv $@.tmp $@
199
79982e90
EJ
200.PHONY: clean-pycov
201clean-pycov:
202 cd $(srcdir) && rm -f $(PYCOV_CLEAN_FILES)
203CLEAN_LOCAL += clean-pycov
204
87103e1f
BP
205# If we're checked out from a Git repository, make sure that every
206# file that is in Git is distributed.
b4e1bf8b
BP
207#
208# We only enable this check when GNU make is in use because the
209# Makefile in datapath/linux, needed to get the list of files to
210# distribute, requires GNU make extensions.
211if GNU_MAKE
39376d06
BP
212ALL_LOCAL += dist-hook-git
213dist-hook-git: distfiles
214 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \
215 (cd datapath && $(MAKE) distfiles); \
216 (cat distfiles; sed 's|^|datapath/|' datapath/distfiles) | \
a6da6967 217 LC_ALL=C sort -u > all-distfiles; \
39376d06 218 (cd $(srcdir) && git ls-files) | grep -v '\.gitignore$$' | \
a6da6967
BP
219 LC_ALL=C sort -u > all-gitfiles; \
220 LC_ALL=C comm -1 -3 all-distfiles all-gitfiles > missing-distfiles; \
39376d06 221 if test -s missing-distfiles; then \
4207d631 222 echo "The following files are in git but not the distribution:"; \
39376d06
BP
223 cat missing-distfiles; \
224 exit 1; \
225 fi; \
87103e1f 226 fi
39376d06
BP
227CLEANFILES += all-distfiles all-gitfiles missing-distfiles
228# The following is based on commands for the Automake "distdir" target.
229distfiles: Makefile
230 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
231 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
232 list='$(DISTFILES)'; \
233 for file in $$list; do echo $$file; done | \
234 sed -e "s|^$$srcdirstrip/||;t" \
a6da6967
BP
235 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | \
236 LC_ALL=C sort -u > $@
39376d06 237CLEANFILES += distfiles
b4e1bf8b
BP
238endif
239.PHONY: dist-hook-git
87103e1f 240
9e4ba008
BP
241# Check that every .c file includes <config.h>.
242ALL_LOCAL += config-h-check
243config-h-check:
244 @cd $(srcdir); \
245 if test -e .git && (git --version) >/dev/null 2>&1 && \
b411e5c3 246 git --no-pager grep -L '#include <config\.h>' `git ls-files | grep '\.c$$' | \
c803536e 247 grep -vE '^datapath|^lib/sflow|^third-party|^datapath-windows'`; \
9e4ba008
BP
248 then \
249 echo "See above for list of violations of the rule that"; \
250 echo "every C source file must #include <config.h>."; \
251 exit 1; \
252 fi
253.PHONY: config-h-check
254
34582733
AS
255# Check for printf() type modifiers that MSVC doesn't support.
256ALL_LOCAL += printf-check
257printf-check:
8faeab72
DDP
258 @cd $(srcdir); \
259 if test -e .git && (git --version) >/dev/null 2>&1 && \
260 git --no-pager grep -n -E -e '%[-+ #0-9.*]*([ztj]|hh)' --and --not -e 'ovs_scan' `git ls-files | grep '\.[ch]$$' | \
3b3f8857 261 grep -vE '^datapath|^lib/sflow|^third-party'`; \
34582733
AS
262 then \
263 echo "See above for list of violations of the rule that"; \
264 echo "'z', 't', 'j', 'hh' printf() type modifiers are"; \
542cc9bb 265 echo "forbidden. See CodingStyle.md for replacements."; \
34582733
AS
266 exit 1; \
267 fi
268.PHONY: printf-check
269
1514b275
BP
270# Check that certain data structures are always declared "static".
271ALL_LOCAL += static-check
272static-check:
db5ce514 273 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
1514b275 274 git --no-pager grep -n -E '^[ ]+(struct vlog_rate_limit|pthread_once_t|struct ovsthread_once).*=' $(srcdir); \
db5ce514
BP
275 then \
276 echo "See above for list of violations of the rule that "; \
1514b275 277 echo "certain data structures must always be 'static'"; \
db5ce514
BP
278 exit 1; \
279 fi
1514b275 280.PHONY: static-check
db5ce514 281
4958e3ee
BP
282# Check that assert.h is not used outside a whitelist of files.
283ALL_LOCAL += check-assert-h-usage
284check-assert-h-usage:
285 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
286 (cd $(srcdir) && git --no-pager grep -l -E '[<]assert.h[>]') | \
92fa2e92 287 $(EGREP) -v '^lib/(sflow_receiver|vlog).c$$|^tests/'; \
4958e3ee
BP
288 then \
289 echo "Files listed above unexpectedly #include <""assert.h"">."; \
290 echo "Please use ovs_assert (from util.h) instead of assert."; \
291 exit 1; \
292 fi
293.PHONY: check-assert-h-usage
294
64746850
BP
295# Check that LITTLE_ENDIAN and BIG_ENDIAN are not used unless BYTE_ORDER is
296# also mentioned. (<endian.h> always defines the former two constants. They
297# must be compared to BYTE_ORDER to get the machine's correct endianness. But
298# it is better to use WORDS_BIGENDIAN.)
299ALL_LOCAL += check-endian
300check-endian:
301 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
302 (cd $(srcdir) && git --no-pager grep -l -E \
303 -e 'BIG_ENDIAN|LITTLE_ENDIAN' --and --not -e 'BYTE_ORDER' | \
304 $(EGREP) -v '^datapath/'); \
305 then \
306 echo "See above for list of files that misuse LITTLE""_ENDIAN"; \
307 echo "or BIG""_ENDIAN. Please use WORDS_BIGENDIAN instead."; \
308 exit 1; \
309 fi
310.PHONY: check-endian
311
6a3e30f3
BP
312ALL_LOCAL += thread-safety-check
313thread-safety-check:
8faeab72
DDP
314 @cd $(srcdir); \
315 if test -e .git && (git --version) >/dev/null 2>&1 && \
316 grep -n -f build-aux/thread-safety-blacklist \
317 `git ls-files | grep '\.[ch]$$' \
ca3d034b 318 | $(EGREP) -v '^datapath|^lib/sflow|^third-party'` /dev/null \
6a3e30f3
BP
319 | $(EGREP) -v ':[ ]*/?\*'; \
320 then \
321 echo "See above for list of calls to functions that are"; \
322 echo "blacklisted due to thread safety issues"; \
323 exit 1; \
324 fi
325EXTRA_DIST += build-aux/thread-safety-blacklist
326
0027492d
BP
327if HAVE_GROFF
328ALL_LOCAL += manpage-check
1261619f
BP
329manpage-check: $(man_MANS) $(dist_man_MANS) $(noinst_man_MANS)
330 @error=false; \
331 for manpage in $?; do \
186ef5c1 332 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
333 if grep warning: $@.tmp; then error=:; fi; \
334 rm -f $@.tmp; \
0027492d 335 done; \
be09aa10
EJ
336 if $$error; then exit 1; else touch $@; fi
337 $(AM_V_GEN) touch -c $@
0027492d
BP
338CLEANFILES += manpage-check
339endif
340
6ca37677
BP
341include $(srcdir)/manpages.mk
342$(srcdir)/manpages.mk: $(MAN_ROOTS) build-aux/sodepends.pl
343 @$(PERL) $(srcdir)/build-aux/sodepends.pl -I. -I$(srcdir) $(MAN_ROOTS) >$(@F).tmp
344 @if cmp -s $(@F).tmp $@; then \
345 touch $@; \
346 rm -f $(@F).tmp; \
347 else \
348 mv $(@F).tmp $@; \
349 fi
350CLEANFILES += manpage-dep-check
351
bd9d7025
AS
352if VSTUDIO_DDK
353ALL_LOCAL += ovsext_make
354ovsext_make: datapath-windows/ovsext.sln
d183efc2
AS
355 MSBuild.exe datapath-windows/ovsext.sln /target:Build /property:Configuration="Win8$(VSTUDIO_CONFIG)"
356 MSBuild.exe datapath-windows/ovsext.sln /target:Build /property:Configuration="Win8.1$(VSTUDIO_CONFIG)"
bd9d7025
AS
357
358CLEAN_LOCAL += ovsext_clean
359ovsext_clean: datapath-windows/ovsext.sln
d183efc2
AS
360 MSBuild.exe datapath-windows/ovsext.sln /target:Clean /property:Configuration="Win8$(VSTUDIO_CONFIG)"
361 MSBuild.exe datapath-windows/ovsext.sln /target:Clean /property:Configuration="Win8.1$(VSTUDIO_CONFIG)"
bd9d7025
AS
362endif
363
87103e1f 364dist-hook: $(DIST_HOOKS)
22c79496 365all-local: $(ALL_LOCAL)
15b619e2 366clean-local: $(CLEAN_LOCAL)
b2df0225 367install-data-local: $(INSTALL_DATA_LOCAL)
44852fdf
BP
368uninstall-local: $(UNINSTALL_LOCAL)
369.PHONY: $(DIST_HOOKS) $(CLEAN_LOCAL) $(INSTALL_DATA_LOCAL) $(UNINSTALL_LOCAL)
87103e1f 370
3a14d239
BP
371modules_install:
372if LINUX_ENABLED
373 cd datapath/linux && $(MAKE) modules_install
374endif
375
4441a01c
BP
376dist-docs:
377 VERSION=$(VERSION) $(srcdir)/build-aux/dist-docs $(srcdir) $(docs)
378.PHONY: dist-docs
379
8c254406 380include Documentation/automake.mk
ed1be787 381include m4/automake.mk
064af421 382include lib/automake.mk
8cd4882f 383include ofproto/automake.mk
064af421
BP
384include utilities/automake.mk
385include tests/automake.mk
386include include/automake.mk
387include third-party/automake.mk
388include debian/automake.mk
389include vswitchd/automake.mk
f85f8ebb 390include ovsdb/automake.mk
c434706a 391include rhel/automake.mk
064af421 392include xenserver/automake.mk
0be6140a 393include python/automake.mk
eeecce05 394include tutorial/automake.mk
add17b69 395include vtep/automake.mk
c803536e 396include datapath-windows/automake.mk
c640e3ce 397include datapath-windows/include/automake.mk
d183efc2 398include windows/automake.mk
fe36184b 399include ovn/automake.mk