2020-10-06 15:53:55 +02:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2021-01-13 17:21:36 +01:00
|
|
|
# Top level Makefile for bpf-examples
|
2020-10-06 15:53:55 +02:00
|
|
|
|
|
|
|
ifeq ("$(origin V)", "command line")
|
|
|
|
VERBOSE = $(V)
|
|
|
|
endif
|
|
|
|
ifndef VERBOSE
|
|
|
|
VERBOSE = 0
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(VERBOSE),0)
|
|
|
|
MAKEFLAGS += --no-print-directory
|
2021-01-13 17:32:30 +01:00
|
|
|
Q = @
|
2020-10-06 15:53:55 +02:00
|
|
|
endif
|
|
|
|
|
2022-09-02 14:34:04 +02:00
|
|
|
SUBDIRS := encap-forward
|
2022-09-02 14:38:06 +02:00
|
|
|
SUBDIRS += ktrace-CO-RE
|
2022-09-02 14:34:04 +02:00
|
|
|
SUBDIRS += lsm-nobpf
|
|
|
|
SUBDIRS += nat64-bpf
|
2022-09-02 15:57:07 +02:00
|
|
|
SUBDIRS += pkt-loop-filter
|
|
|
|
SUBDIRS += pping
|
2022-09-02 15:43:29 +02:00
|
|
|
SUBDIRS += preserve-dscp
|
2022-09-02 15:57:07 +02:00
|
|
|
SUBDIRS += tc-basic-classifier
|
|
|
|
SUBDIRS += tc-policy
|
2022-09-02 14:34:04 +02:00
|
|
|
SUBDIRS += traffic-pacing-edt
|
2022-08-19 09:09:20 +00:00
|
|
|
SUBDIRS += AF_XDP-forwarding
|
2022-08-19 09:20:58 +00:00
|
|
|
SUBDIRS += AF_XDP-example
|
2022-09-02 14:34:04 +02:00
|
|
|
|
2020-10-06 15:53:55 +02:00
|
|
|
.PHONY: check_submodule help clobber distclean clean $(SUBDIRS)
|
|
|
|
|
2020-10-06 15:59:44 +02:00
|
|
|
all: lib $(SUBDIRS)
|
2020-10-06 15:53:55 +02:00
|
|
|
|
|
|
|
lib: config.mk check_submodule
|
|
|
|
@echo; echo $@; $(MAKE) -C $@
|
|
|
|
|
2022-09-02 14:56:00 +02:00
|
|
|
$(SUBDIRS): lib
|
2020-10-06 15:53:55 +02:00
|
|
|
@echo; echo $@; $(MAKE) -C $@
|
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "Make Targets:"
|
|
|
|
@echo " all - build binaries"
|
|
|
|
@echo " clean - remove products of build"
|
|
|
|
@echo " distclean - remove configuration and build"
|
|
|
|
@echo " install - install binaries on local machine"
|
|
|
|
@echo " test - run test suite"
|
|
|
|
@echo " archive - create tarball of all sources"
|
|
|
|
@echo ""
|
|
|
|
@echo "Make Arguments:"
|
|
|
|
@echo " V=[0|1] - set build verbosity level"
|
|
|
|
|
2021-01-13 17:25:33 +01:00
|
|
|
config.mk: configure
|
2020-10-06 15:53:55 +02:00
|
|
|
sh configure
|
|
|
|
|
|
|
|
check_submodule:
|
|
|
|
@if [ -d .git ] && `git submodule status lib/libbpf | grep -q '^+'`; then \
|
|
|
|
echo "" ;\
|
|
|
|
echo "** WARNING **: git submodule SHA-1 out-of-sync" ;\
|
|
|
|
echo " consider running: git submodule update" ;\
|
|
|
|
echo "" ;\
|
|
|
|
fi\
|
|
|
|
|
|
|
|
clobber:
|
|
|
|
touch config.mk
|
|
|
|
$(MAKE) clean
|
|
|
|
rm -f config.mk cscope.* compile_commands.json
|
|
|
|
|
|
|
|
distclean: clobber
|
|
|
|
|
|
|
|
clean: check_submodule
|
2021-01-13 17:32:30 +01:00
|
|
|
$(Q)for i in $(SUBDIRS); \
|
2020-10-06 15:53:55 +02:00
|
|
|
do $(MAKE) -C $$i clean; done
|
2021-01-13 17:32:30 +01:00
|
|
|
$(Q)$(MAKE) -C lib clean
|
2020-10-06 15:53:55 +02:00
|
|
|
|
|
|
|
compile_commands.json: clean
|
|
|
|
compiledb make V=1
|