]> git.proxmox.com Git - mirror_ovs.git/blame - datapath/Makefile.am
datapath: Fix linking without CONFIG_NF_CONNTRACK_LABELS
[mirror_ovs.git] / datapath / Makefile.am
CommitLineData
6455100f 1SUBDIRS =
e3438006 2if LINUX_ENABLED
22bcc0e7 3SUBDIRS += linux
064af421
BP
4endif
5
40a75177 6EXTRA_DIST = $(dist_headers) $(dist_sources) $(dist_extras)
064af421
BP
7
8# Suppress warnings about GNU extensions in Modules.mk files.
9AUTOMAKE_OPTIONS = -Wno-portability
10
11include Modules.mk
22bcc0e7 12include linux/Modules.mk
39376d06
BP
13
14# The following is based on commands for the Automake "distdir" target.
15distfiles: Makefile
16 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
17 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
18 list='$(DISTFILES)'; \
19 for file in $$list; do echo $$file; done | \
20 sed -e "s|^$$srcdirstrip/||;t" \
21 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | sort -u > $@
22CLEANFILES = distfiles
f315ae4f
AW
23
24# Print name of all modules.
25print-build-modules:
26 @if test -z "$(build_modules)"; \
27 then \
28 echo "Could not find any kernel module."; \
29 exit 1; \
30 fi
b296b82a
AW
31 @echo "$(build_modules)" | tr '_' '-';
32
4fe9aa64 33if !WIN32
b296b82a
AW
34COMPAT_GET_FUNCTIONS := find $(top_srcdir)/datapath/linux/compat -name "*.h" \
35 -exec sed -n '/^[a-z][a-z]* \*\?[A-Za-z0-9_][A-Za-z0-9_]*([a-z]/p; /^struct [a-z0-9_][a-z0-9_]* \*\?[A-Za-z0-9_][A-Za-z0-9_]*([a-z]/p' {} \; | tr -d '*' | cut -d '(' -f1 | rev | cut -d ' ' -f1 | rev
36COMPAT_GET_EXPORTS := find $(top_srcdir)/datapath/linux/compat -name "*.c" \
37 -exec sed -n 's/^EXPORT_SYMBOL[A-Z_]*(\([a-z_][a-z_]*\));$$/\1/p' {} \;
38COMPAT_FUNCTIONS := $(shell $(COMPAT_GET_FUNCTIONS))
39COMPAT_EXPORTS := $(shell $(COMPAT_GET_EXPORTS))
40
41# Checks that all public functions are 'rpl_' or 'ovs_' prefixed.
42# Checks that all EXPORT_SYMBOL_GPL() export 'rpl_' or 'ovs_' prefixed functions.
43check-export-symbol:
44 @for fun_ in $(COMPAT_FUNCTIONS); do \
45 if ! grep -- $${fun_} $(top_srcdir)/datapath/linux/compat/build-aux/export-check-whitelist > /dev/null; then \
46add523
JS
46 if ! echo $${fun_} | grep -q -E '^(rpl|ovs)_'; then \
47 echo "error: $${fun_}() needs to be prefixed with 'rpl_' or 'ovs_'."; \
b296b82a
AW
48 exit 1; \
49 fi; \
50 fi; \
51 done
52 @for fun_ in $(COMPAT_EXPORTS); do \
46add523
JS
53 if ! echo $${fun_} | grep -q -E '^(rpl|ovs)_'; then \
54 echo "error: $${fun_}() needs to be prefixed with 'rpl_' or 'ovs_'."; \
b296b82a
AW
55 exit 1; \
56 fi; \
57 done
58
d3de1af7 59all-local: check-export-symbol
4fe9aa64 60endif