]> git.proxmox.com Git - mirror_ovs.git/blob - datapath/Makefile.am
datapath: check for backported ip_is_fragment
[mirror_ovs.git] / datapath / Makefile.am
1 SUBDIRS =
2 if LINUX_ENABLED
3 SUBDIRS += linux
4 endif
5
6 EXTRA_DIST = $(dist_headers) $(dist_sources) $(dist_extras)
7
8 # Suppress warnings about GNU extensions in Modules.mk files.
9 AUTOMAKE_OPTIONS = -Wno-portability
10
11 include Modules.mk
12 include linux/Modules.mk
13
14 # The following is based on commands for the Automake "distdir" target.
15 distfiles: 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 > $@
22 CLEANFILES = distfiles
23
24 # Print name of all modules.
25 print-build-modules:
26 @if test -z "$(build_modules)"; \
27 then \
28 echo "Could not find any kernel module."; \
29 exit 1; \
30 fi
31 @echo "$(build_modules)" | tr '_' '-';
32
33 COMPAT_GET_FUNCTIONS := find $(top_srcdir)/datapath/linux/compat -name "*.h" \
34 -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
35 COMPAT_GET_EXPORTS := find $(top_srcdir)/datapath/linux/compat -name "*.c" \
36 -exec sed -n 's/^EXPORT_SYMBOL[A-Z_]*(\([a-z_][a-z_]*\));$$/\1/p' {} \;
37 COMPAT_FUNCTIONS := $(shell $(COMPAT_GET_FUNCTIONS))
38 COMPAT_EXPORTS := $(shell $(COMPAT_GET_EXPORTS))
39
40 # Checks that all public functions are 'rpl_' or 'ovs_' prefixed.
41 # Checks that all EXPORT_SYMBOL_GPL() export 'rpl_' or 'ovs_' prefixed functions.
42 check-export-symbol:
43 @for fun_ in $(COMPAT_FUNCTIONS); do \
44 if ! grep -- $${fun_} $(top_srcdir)/datapath/linux/compat/build-aux/export-check-whitelist > /dev/null; then \
45 if ! echo $${fun_} | grep -q -E '^(rpl|ovs)_'; then \
46 echo "error: $${fun_}() needs to be prefixed with 'rpl_' or 'ovs_'."; \
47 exit 1; \
48 fi; \
49 fi; \
50 done
51 @for fun_ in $(COMPAT_EXPORTS); do \
52 if ! echo $${fun_} | grep -q -E '^(rpl|ovs)_'; then \
53 echo "error: $${fun_}() needs to be prefixed with 'rpl_' or 'ovs_'."; \
54 exit 1; \
55 fi; \
56 done
57
58 all-local: check-export-symbol