]>
Commit | Line | Data |
---|---|---|
6455100f | 1 | SUBDIRS = |
e3438006 | 2 | if LINUX_ENABLED |
22bcc0e7 | 3 | SUBDIRS += linux |
064af421 BP |
4 | endif |
5 | ||
40a75177 | 6 | EXTRA_DIST = $(dist_headers) $(dist_sources) $(dist_extras) |
064af421 BP |
7 | |
8 | # Suppress warnings about GNU extensions in Modules.mk files. | |
9 | AUTOMAKE_OPTIONS = -Wno-portability | |
10 | ||
11 | include Modules.mk | |
22bcc0e7 | 12 | include linux/Modules.mk |
39376d06 BP |
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 | |
f315ae4f AW |
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 | |
b296b82a AW |
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 \ | |
46add523 JS |
45 | if ! echo $${fun_} | grep -q -E '^(rpl|ovs)_'; then \ |
46 | echo "error: $${fun_}() needs to be prefixed with 'rpl_' or 'ovs_'."; \ | |
b296b82a AW |
47 | exit 1; \ |
48 | fi; \ | |
49 | fi; \ | |
50 | done | |
51 | @for fun_ in $(COMPAT_EXPORTS); do \ | |
46add523 JS |
52 | if ! echo $${fun_} | grep -q -E '^(rpl|ovs)_'; then \ |
53 | echo "error: $${fun_}() needs to be prefixed with 'rpl_' or 'ovs_'."; \ | |
b296b82a AW |
54 | exit 1; \ |
55 | fi; \ | |
56 | done | |
57 | ||
d3de1af7 | 58 | all-local: check-export-symbol |