Makefile (a108772d03d8bdb43258218b00bfe43bbe1e8800) Makefile (c8bc5e0509767e51b35ae2f4af6ff90fa6a5f27f)
1# SPDX-License-Identifier: GPL-2.0
2include ../../../build/Build.include
3include ../../../scripts/Makefile.arch
4include ../../../scripts/Makefile.include
5
6CXX ?= $(CROSS_COMPILE)g++
7
8CURDIR := $(abspath .)

--- 31 unchanged lines hidden (view full) ---

40 test_tcpnotify_user test_sysctl \
41 test_progs-no_alu32
42
43# Also test bpf-gcc, if present
44ifneq ($(BPF_GCC),)
45TEST_GEN_PROGS += test_progs-bpf_gcc
46endif
47
1# SPDX-License-Identifier: GPL-2.0
2include ../../../build/Build.include
3include ../../../scripts/Makefile.arch
4include ../../../scripts/Makefile.include
5
6CXX ?= $(CROSS_COMPILE)g++
7
8CURDIR := $(abspath .)

--- 31 unchanged lines hidden (view full) ---

40 test_tcpnotify_user test_sysctl \
41 test_progs-no_alu32
42
43# Also test bpf-gcc, if present
44ifneq ($(BPF_GCC),)
45TEST_GEN_PROGS += test_progs-bpf_gcc
46endif
47
48TEST_GEN_FILES = test_lwt_ip_encap.o test_tc_edt.o
48TEST_GEN_FILES = test_lwt_ip_encap.bpf.o test_tc_edt.bpf.o
49TEST_FILES = xsk_prereqs.sh $(wildcard progs/btf_dump_test_case_*.c)
50
51# Order correspond to 'make run_tests' order
52TEST_PROGS := test_kmod.sh \
53 test_xdp_redirect.sh \
54 test_xdp_redirect_multi.sh \
55 test_xdp_meta.sh \
56 test_xdp_veth.sh \

--- 20 unchanged lines hidden (view full) ---

77TEST_PROGS_EXTENDED := with_addr.sh \
78 with_tunnels.sh ima_setup.sh \
79 test_xdp_vlan.sh test_bpftool.py
80
81# Compile but not part of 'make run_tests'
82TEST_GEN_PROGS_EXTENDED = test_sock_addr test_skb_cgroup_id_user \
83 flow_dissector_load test_flow_dissector test_tcp_check_syncookie_user \
84 test_lirc_mode2_user xdping test_cpp runqslower bench bpf_testmod.ko \
49TEST_FILES = xsk_prereqs.sh $(wildcard progs/btf_dump_test_case_*.c)
50
51# Order correspond to 'make run_tests' order
52TEST_PROGS := test_kmod.sh \
53 test_xdp_redirect.sh \
54 test_xdp_redirect_multi.sh \
55 test_xdp_meta.sh \
56 test_xdp_veth.sh \

--- 20 unchanged lines hidden (view full) ---

77TEST_PROGS_EXTENDED := with_addr.sh \
78 with_tunnels.sh ima_setup.sh \
79 test_xdp_vlan.sh test_bpftool.py
80
81# Compile but not part of 'make run_tests'
82TEST_GEN_PROGS_EXTENDED = test_sock_addr test_skb_cgroup_id_user \
83 flow_dissector_load test_flow_dissector test_tcp_check_syncookie_user \
84 test_lirc_mode2_user xdping test_cpp runqslower bench bpf_testmod.ko \
85 xskxceiver xdp_redirect_multi xdp_synproxy
85 xskxceiver xdp_redirect_multi xdp_synproxy veristat
86
87TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read
88
89# Emit succinct information message describing current building step
90# $1 - generic step name (e.g., CC, LINK, etc);
91# $2 - optional "flavor" specifier; if provided, will be emitted as [flavor];
92# $3 - target (assumed to be file); only file name will be emitted;
93# $4 - optional extra arg, emitted as-is, if provided.

--- 224 unchanged lines hidden (view full) ---

318
319CLANG_CFLAGS = $(CLANG_SYS_INCLUDES) \
320 -Wno-compare-distinct-pointer-types
321
322$(OUTPUT)/test_l4lb_noinline.o: BPF_CFLAGS += -fno-inline
323$(OUTPUT)/test_xdp_noinline.o: BPF_CFLAGS += -fno-inline
324
325$(OUTPUT)/flow_dissector_load.o: flow_dissector_load.h
86
87TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read
88
89# Emit succinct information message describing current building step
90# $1 - generic step name (e.g., CC, LINK, etc);
91# $2 - optional "flavor" specifier; if provided, will be emitted as [flavor];
92# $3 - target (assumed to be file); only file name will be emitted;
93# $4 - optional extra arg, emitted as-is, if provided.

--- 224 unchanged lines hidden (view full) ---

318
319CLANG_CFLAGS = $(CLANG_SYS_INCLUDES) \
320 -Wno-compare-distinct-pointer-types
321
322$(OUTPUT)/test_l4lb_noinline.o: BPF_CFLAGS += -fno-inline
323$(OUTPUT)/test_xdp_noinline.o: BPF_CFLAGS += -fno-inline
324
325$(OUTPUT)/flow_dissector_load.o: flow_dissector_load.h
326$(OUTPUT)/cgroup_getset_retval_hooks.o: cgroup_getset_retval_hooks.h
326
327# Build BPF object using Clang
328# $1 - input .c file
329# $2 - output .o file
330# $3 - CFLAGS
331define CLANG_BPF_BUILD_RULE
332 $(call msg,CLNG-BPF,$(TRUNNER_BINARY),$2)
333 $(Q)$(CLANG) $3 -O2 -target bpf -c $1 -mcpu=v3 -o $2

--- 11 unchanged lines hidden (view full) ---

345
346SKEL_BLACKLIST := btf__% test_pinning_invalid.c test_sk_assign.c
347
348LINKED_SKELS := test_static_linked.skel.h linked_funcs.skel.h \
349 linked_vars.skel.h linked_maps.skel.h \
350 test_subskeleton.skel.h test_subskeleton_lib.skel.h \
351 test_usdt.skel.h
352
327
328# Build BPF object using Clang
329# $1 - input .c file
330# $2 - output .o file
331# $3 - CFLAGS
332define CLANG_BPF_BUILD_RULE
333 $(call msg,CLNG-BPF,$(TRUNNER_BINARY),$2)
334 $(Q)$(CLANG) $3 -O2 -target bpf -c $1 -mcpu=v3 -o $2

--- 11 unchanged lines hidden (view full) ---

346
347SKEL_BLACKLIST := btf__% test_pinning_invalid.c test_sk_assign.c
348
349LINKED_SKELS := test_static_linked.skel.h linked_funcs.skel.h \
350 linked_vars.skel.h linked_maps.skel.h \
351 test_subskeleton.skel.h test_subskeleton_lib.skel.h \
352 test_usdt.skel.h
353
353LSKELS := kfunc_call_test.c fentry_test.c fexit_test.c fexit_sleep.c \
354LSKELS := fentry_test.c fexit_test.c fexit_sleep.c \
354 test_ringbuf.c atomics.c trace_printk.c trace_vprintk.c \
355 map_ptr_kern.c core_kern.c core_kern_overflow.c
356# Generate both light skeleton and libbpf skeleton for these
355 test_ringbuf.c atomics.c trace_printk.c trace_vprintk.c \
356 map_ptr_kern.c core_kern.c core_kern_overflow.c
357# Generate both light skeleton and libbpf skeleton for these
357LSKELS_EXTRA := test_ksyms_module.c test_ksyms_weak.c kfunc_call_test_subprog.c
358LSKELS_EXTRA := test_ksyms_module.c test_ksyms_weak.c kfunc_call_test.c \
359 kfunc_call_test_subprog.c
358SKEL_BLACKLIST += $$(LSKELS)
359
360SKEL_BLACKLIST += $$(LSKELS)
361
360test_static_linked.skel.h-deps := test_static_linked1.o test_static_linked2.o
361linked_funcs.skel.h-deps := linked_funcs1.o linked_funcs2.o
362linked_vars.skel.h-deps := linked_vars1.o linked_vars2.o
363linked_maps.skel.h-deps := linked_maps1.o linked_maps2.o
362test_static_linked.skel.h-deps := test_static_linked1.bpf.o test_static_linked2.bpf.o
363linked_funcs.skel.h-deps := linked_funcs1.bpf.o linked_funcs2.bpf.o
364linked_vars.skel.h-deps := linked_vars1.bpf.o linked_vars2.bpf.o
365linked_maps.skel.h-deps := linked_maps1.bpf.o linked_maps2.bpf.o
364# In the subskeleton case, we want the test_subskeleton_lib.subskel.h file
365# but that's created as a side-effect of the skel.h generation.
366# In the subskeleton case, we want the test_subskeleton_lib.subskel.h file
367# but that's created as a side-effect of the skel.h generation.
366test_subskeleton.skel.h-deps := test_subskeleton_lib2.o test_subskeleton_lib.o test_subskeleton.o
367test_subskeleton_lib.skel.h-deps := test_subskeleton_lib2.o test_subskeleton_lib.o
368test_usdt.skel.h-deps := test_usdt.o test_usdt_multispec.o
368test_subskeleton.skel.h-deps := test_subskeleton_lib2.bpf.o test_subskeleton_lib.bpf.o test_subskeleton.bpf.o
369test_subskeleton_lib.skel.h-deps := test_subskeleton_lib2.bpf.o test_subskeleton_lib.bpf.o
370test_usdt.skel.h-deps := test_usdt.bpf.o test_usdt_multispec.bpf.o
369
371
370LINKED_BPF_SRCS := $(patsubst %.o,%.c,$(foreach skel,$(LINKED_SKELS),$($(skel)-deps)))
372LINKED_BPF_SRCS := $(patsubst %.bpf.o,%.c,$(foreach skel,$(LINKED_SKELS),$($(skel)-deps)))
371
372# Set up extra TRUNNER_XXX "temporary" variables in the environment (relies on
373# $eval()) and pass control to DEFINE_TEST_RUNNER_RULES.
374# Parameters:
375# $1 - test runner base binary name (e.g., test_progs)
376# $2 - test runner extra "flavor" (e.g., no_alu32, gcc-bpf, etc)
377define DEFINE_TEST_RUNNER
378
379TRUNNER_OUTPUT := $(OUTPUT)$(if $2,/)$2
380TRUNNER_BINARY := $1$(if $2,-)$2
381TRUNNER_TEST_OBJS := $$(patsubst %.c,$$(TRUNNER_OUTPUT)/%.test.o, \
382 $$(notdir $$(wildcard $(TRUNNER_TESTS_DIR)/*.c)))
383TRUNNER_EXTRA_OBJS := $$(patsubst %.c,$$(TRUNNER_OUTPUT)/%.o, \
384 $$(filter %.c,$(TRUNNER_EXTRA_SOURCES)))
385TRUNNER_EXTRA_HDRS := $$(filter %.h,$(TRUNNER_EXTRA_SOURCES))
386TRUNNER_TESTS_HDR := $(TRUNNER_TESTS_DIR)/tests.h
387TRUNNER_BPF_SRCS := $$(notdir $$(wildcard $(TRUNNER_BPF_PROGS_DIR)/*.c))
373
374# Set up extra TRUNNER_XXX "temporary" variables in the environment (relies on
375# $eval()) and pass control to DEFINE_TEST_RUNNER_RULES.
376# Parameters:
377# $1 - test runner base binary name (e.g., test_progs)
378# $2 - test runner extra "flavor" (e.g., no_alu32, gcc-bpf, etc)
379define DEFINE_TEST_RUNNER
380
381TRUNNER_OUTPUT := $(OUTPUT)$(if $2,/)$2
382TRUNNER_BINARY := $1$(if $2,-)$2
383TRUNNER_TEST_OBJS := $$(patsubst %.c,$$(TRUNNER_OUTPUT)/%.test.o, \
384 $$(notdir $$(wildcard $(TRUNNER_TESTS_DIR)/*.c)))
385TRUNNER_EXTRA_OBJS := $$(patsubst %.c,$$(TRUNNER_OUTPUT)/%.o, \
386 $$(filter %.c,$(TRUNNER_EXTRA_SOURCES)))
387TRUNNER_EXTRA_HDRS := $$(filter %.h,$(TRUNNER_EXTRA_SOURCES))
388TRUNNER_TESTS_HDR := $(TRUNNER_TESTS_DIR)/tests.h
389TRUNNER_BPF_SRCS := $$(notdir $$(wildcard $(TRUNNER_BPF_PROGS_DIR)/*.c))
388TRUNNER_BPF_OBJS := $$(patsubst %.c,$$(TRUNNER_OUTPUT)/%.o, $$(TRUNNER_BPF_SRCS))
390TRUNNER_BPF_OBJS := $$(patsubst %.c,$$(TRUNNER_OUTPUT)/%.bpf.o, $$(TRUNNER_BPF_SRCS))
389TRUNNER_BPF_SKELS := $$(patsubst %.c,$$(TRUNNER_OUTPUT)/%.skel.h, \
390 $$(filter-out $(SKEL_BLACKLIST) $(LINKED_BPF_SRCS),\
391 $$(TRUNNER_BPF_SRCS)))
392TRUNNER_BPF_LSKELS := $$(patsubst %.c,$$(TRUNNER_OUTPUT)/%.lskel.h, $$(LSKELS) $$(LSKELS_EXTRA))
393TRUNNER_BPF_SKELS_LINKED := $$(addprefix $$(TRUNNER_OUTPUT)/,$(LINKED_SKELS))
394TEST_GEN_FILES += $$(TRUNNER_BPF_OBJS)
395
396# Evaluate rules now with extra TRUNNER_XXX variables above already defined

--- 13 unchanged lines hidden (view full) ---

410 $$(call msg,MKDIR,,$$@)
411 $(Q)mkdir -p $$@
412endif
413
414# ensure we set up BPF objects generation rule just once for a given
415# input/output directory combination
416ifeq ($($(TRUNNER_BPF_PROGS_DIR)$(if $2,-)$2-bpfobjs),)
417$(TRUNNER_BPF_PROGS_DIR)$(if $2,-)$2-bpfobjs := y
391TRUNNER_BPF_SKELS := $$(patsubst %.c,$$(TRUNNER_OUTPUT)/%.skel.h, \
392 $$(filter-out $(SKEL_BLACKLIST) $(LINKED_BPF_SRCS),\
393 $$(TRUNNER_BPF_SRCS)))
394TRUNNER_BPF_LSKELS := $$(patsubst %.c,$$(TRUNNER_OUTPUT)/%.lskel.h, $$(LSKELS) $$(LSKELS_EXTRA))
395TRUNNER_BPF_SKELS_LINKED := $$(addprefix $$(TRUNNER_OUTPUT)/,$(LINKED_SKELS))
396TEST_GEN_FILES += $$(TRUNNER_BPF_OBJS)
397
398# Evaluate rules now with extra TRUNNER_XXX variables above already defined

--- 13 unchanged lines hidden (view full) ---

412 $$(call msg,MKDIR,,$$@)
413 $(Q)mkdir -p $$@
414endif
415
416# ensure we set up BPF objects generation rule just once for a given
417# input/output directory combination
418ifeq ($($(TRUNNER_BPF_PROGS_DIR)$(if $2,-)$2-bpfobjs),)
419$(TRUNNER_BPF_PROGS_DIR)$(if $2,-)$2-bpfobjs := y
418$(TRUNNER_BPF_OBJS): $(TRUNNER_OUTPUT)/%.o: \
420$(TRUNNER_BPF_OBJS): $(TRUNNER_OUTPUT)/%.bpf.o: \
419 $(TRUNNER_BPF_PROGS_DIR)/%.c \
420 $(TRUNNER_BPF_PROGS_DIR)/*.h \
421 $$(INCLUDE_DIR)/vmlinux.h \
422 $(wildcard $(BPFDIR)/bpf_*.h) \
423 $(wildcard $(BPFDIR)/*.bpf.h) \
424 | $(TRUNNER_OUTPUT) $$(BPFOBJ)
425 $$(call $(TRUNNER_BPF_BUILD_RULE),$$<,$$@, \
426 $(TRUNNER_BPF_CFLAGS))
427
421 $(TRUNNER_BPF_PROGS_DIR)/%.c \
422 $(TRUNNER_BPF_PROGS_DIR)/*.h \
423 $$(INCLUDE_DIR)/vmlinux.h \
424 $(wildcard $(BPFDIR)/bpf_*.h) \
425 $(wildcard $(BPFDIR)/*.bpf.h) \
426 | $(TRUNNER_OUTPUT) $$(BPFOBJ)
427 $$(call $(TRUNNER_BPF_BUILD_RULE),$$<,$$@, \
428 $(TRUNNER_BPF_CFLAGS))
429
428$(TRUNNER_BPF_SKELS): %.skel.h: %.o $(BPFTOOL) | $(TRUNNER_OUTPUT)
430$(TRUNNER_BPF_SKELS): %.skel.h: %.bpf.o $(BPFTOOL) | $(TRUNNER_OUTPUT)
429 $$(call msg,GEN-SKEL,$(TRUNNER_BINARY),$$@)
430 $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked1.o) $$<
431 $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked2.o) $$(<:.o=.linked1.o)
432 $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked3.o) $$(<:.o=.linked2.o)
433 $(Q)diff $$(<:.o=.linked2.o) $$(<:.o=.linked3.o)
431 $$(call msg,GEN-SKEL,$(TRUNNER_BINARY),$$@)
432 $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked1.o) $$<
433 $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked2.o) $$(<:.o=.linked1.o)
434 $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked3.o) $$(<:.o=.linked2.o)
435 $(Q)diff $$(<:.o=.linked2.o) $$(<:.o=.linked3.o)
434 $(Q)$$(BPFTOOL) gen skeleton $$(<:.o=.linked3.o) name $$(notdir $$(<:.o=)) > $$@
435 $(Q)$$(BPFTOOL) gen subskeleton $$(<:.o=.linked3.o) name $$(notdir $$(<:.o=)) > $$(@:.skel.h=.subskel.h)
436 $(Q)$$(BPFTOOL) gen skeleton $$(<:.o=.linked3.o) name $$(notdir $$(<:.bpf.o=)) > $$@
437 $(Q)$$(BPFTOOL) gen subskeleton $$(<:.o=.linked3.o) name $$(notdir $$(<:.bpf.o=)) > $$(@:.skel.h=.subskel.h)
436
438
437$(TRUNNER_BPF_LSKELS): %.lskel.h: %.o $(BPFTOOL) | $(TRUNNER_OUTPUT)
439$(TRUNNER_BPF_LSKELS): %.lskel.h: %.bpf.o $(BPFTOOL) | $(TRUNNER_OUTPUT)
438 $$(call msg,GEN-SKEL,$(TRUNNER_BINARY),$$@)
439 $(Q)$$(BPFTOOL) gen object $$(<:.o=.llinked1.o) $$<
440 $(Q)$$(BPFTOOL) gen object $$(<:.o=.llinked2.o) $$(<:.o=.llinked1.o)
441 $(Q)$$(BPFTOOL) gen object $$(<:.o=.llinked3.o) $$(<:.o=.llinked2.o)
442 $(Q)diff $$(<:.o=.llinked2.o) $$(<:.o=.llinked3.o)
440 $$(call msg,GEN-SKEL,$(TRUNNER_BINARY),$$@)
441 $(Q)$$(BPFTOOL) gen object $$(<:.o=.llinked1.o) $$<
442 $(Q)$$(BPFTOOL) gen object $$(<:.o=.llinked2.o) $$(<:.o=.llinked1.o)
443 $(Q)$$(BPFTOOL) gen object $$(<:.o=.llinked3.o) $$(<:.o=.llinked2.o)
444 $(Q)diff $$(<:.o=.llinked2.o) $$(<:.o=.llinked3.o)
443 $(Q)$$(BPFTOOL) gen skeleton -L $$(<:.o=.llinked3.o) name $$(notdir $$(<:.o=_lskel)) > $$@
445 $(Q)$$(BPFTOOL) gen skeleton -L $$(<:.o=.llinked3.o) name $$(notdir $$(<:.bpf.o=_lskel)) > $$@
444
445$(TRUNNER_BPF_SKELS_LINKED): $(TRUNNER_BPF_OBJS) $(BPFTOOL) | $(TRUNNER_OUTPUT)
446
447$(TRUNNER_BPF_SKELS_LINKED): $(TRUNNER_BPF_OBJS) $(BPFTOOL) | $(TRUNNER_OUTPUT)
446 $$(call msg,LINK-BPF,$(TRUNNER_BINARY),$$(@:.skel.h=.o))
448 $$(call msg,LINK-BPF,$(TRUNNER_BINARY),$$(@:.skel.h=.bpf.o))
447 $(Q)$$(BPFTOOL) gen object $$(@:.skel.h=.linked1.o) $$(addprefix $(TRUNNER_OUTPUT)/,$$($$(@F)-deps))
448 $(Q)$$(BPFTOOL) gen object $$(@:.skel.h=.linked2.o) $$(@:.skel.h=.linked1.o)
449 $(Q)$$(BPFTOOL) gen object $$(@:.skel.h=.linked3.o) $$(@:.skel.h=.linked2.o)
450 $(Q)diff $$(@:.skel.h=.linked2.o) $$(@:.skel.h=.linked3.o)
451 $$(call msg,GEN-SKEL,$(TRUNNER_BINARY),$$@)
452 $(Q)$$(BPFTOOL) gen skeleton $$(@:.skel.h=.linked3.o) name $$(notdir $$(@:.skel.h=)) > $$@
453 $(Q)$$(BPFTOOL) gen subskeleton $$(@:.skel.h=.linked3.o) name $$(notdir $$(@:.skel.h=)) > $$(@:.skel.h=.subskel.h)
454endif

--- 39 unchanged lines hidden (view full) ---

494endif
495
496$(OUTPUT)/$(TRUNNER_BINARY): $(TRUNNER_TEST_OBJS) \
497 $(TRUNNER_EXTRA_OBJS) $$(BPFOBJ) \
498 $(RESOLVE_BTFIDS) \
499 | $(TRUNNER_BINARY)-extras
500 $$(call msg,BINARY,,$$@)
501 $(Q)$$(CC) $$(CFLAGS) $$(filter %.a %.o,$$^) $$(LDLIBS) -o $$@
449 $(Q)$$(BPFTOOL) gen object $$(@:.skel.h=.linked1.o) $$(addprefix $(TRUNNER_OUTPUT)/,$$($$(@F)-deps))
450 $(Q)$$(BPFTOOL) gen object $$(@:.skel.h=.linked2.o) $$(@:.skel.h=.linked1.o)
451 $(Q)$$(BPFTOOL) gen object $$(@:.skel.h=.linked3.o) $$(@:.skel.h=.linked2.o)
452 $(Q)diff $$(@:.skel.h=.linked2.o) $$(@:.skel.h=.linked3.o)
453 $$(call msg,GEN-SKEL,$(TRUNNER_BINARY),$$@)
454 $(Q)$$(BPFTOOL) gen skeleton $$(@:.skel.h=.linked3.o) name $$(notdir $$(@:.skel.h=)) > $$@
455 $(Q)$$(BPFTOOL) gen subskeleton $$(@:.skel.h=.linked3.o) name $$(notdir $$(@:.skel.h=)) > $$(@:.skel.h=.subskel.h)
456endif

--- 39 unchanged lines hidden (view full) ---

496endif
497
498$(OUTPUT)/$(TRUNNER_BINARY): $(TRUNNER_TEST_OBJS) \
499 $(TRUNNER_EXTRA_OBJS) $$(BPFOBJ) \
500 $(RESOLVE_BTFIDS) \
501 | $(TRUNNER_BINARY)-extras
502 $$(call msg,BINARY,,$$@)
503 $(Q)$$(CC) $$(CFLAGS) $$(filter %.a %.o,$$^) $$(LDLIBS) -o $$@
502 $(Q)$(RESOLVE_BTFIDS) --btf $(TRUNNER_OUTPUT)/btf_data.o $$@
504 $(Q)$(RESOLVE_BTFIDS) --btf $(TRUNNER_OUTPUT)/btf_data.bpf.o $$@
503 $(Q)ln -sf $(if $2,..,.)/tools/build/bpftool/bootstrap/bpftool $(if $2,$2/)bpftool
504
505endef
506
507# Define test_progs test runner.
508TRUNNER_TESTS_DIR := prog_tests
509TRUNNER_BPF_PROGS_DIR := progs
510TRUNNER_EXTRA_SOURCES := test_progs.c cgroup_helpers.c trace_helpers.c \

--- 77 unchanged lines hidden (view full) ---

588 $(OUTPUT)/bench_bpf_loop.o \
589 $(OUTPUT)/bench_strncmp.o \
590 $(OUTPUT)/bench_bpf_hashmap_full_update.o \
591 $(OUTPUT)/bench_local_storage.o \
592 $(OUTPUT)/bench_local_storage_rcu_tasks_trace.o
593 $(call msg,BINARY,,$@)
594 $(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(filter %.a %.o,$^) $(LDLIBS) -o $@
595
505 $(Q)ln -sf $(if $2,..,.)/tools/build/bpftool/bootstrap/bpftool $(if $2,$2/)bpftool
506
507endef
508
509# Define test_progs test runner.
510TRUNNER_TESTS_DIR := prog_tests
511TRUNNER_BPF_PROGS_DIR := progs
512TRUNNER_EXTRA_SOURCES := test_progs.c cgroup_helpers.c trace_helpers.c \

--- 77 unchanged lines hidden (view full) ---

590 $(OUTPUT)/bench_bpf_loop.o \
591 $(OUTPUT)/bench_strncmp.o \
592 $(OUTPUT)/bench_bpf_hashmap_full_update.o \
593 $(OUTPUT)/bench_local_storage.o \
594 $(OUTPUT)/bench_local_storage_rcu_tasks_trace.o
595 $(call msg,BINARY,,$@)
596 $(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(filter %.a %.o,$^) $(LDLIBS) -o $@
597
598$(OUTPUT)/veristat.o: $(BPFOBJ)
599$(OUTPUT)/veristat: $(OUTPUT)/veristat.o
600 $(call msg,BINARY,,$@)
601 $(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(filter %.a %.o,$^) $(LDLIBS) -o $@
602
596EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(SCRATCH_DIR) $(HOST_SCRATCH_DIR) \
597 prog_tests/tests.h map_tests/tests.h verifier/tests.h \
598 feature bpftool \
599 $(addprefix $(OUTPUT)/,*.o *.skel.h *.lskel.h *.subskel.h \
600 no_alu32 bpf_gcc bpf_testmod.ko \
601 liburandom_read.so)
602
603.PHONY: docs docs-clean
603EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(SCRATCH_DIR) $(HOST_SCRATCH_DIR) \
604 prog_tests/tests.h map_tests/tests.h verifier/tests.h \
605 feature bpftool \
606 $(addprefix $(OUTPUT)/,*.o *.skel.h *.lskel.h *.subskel.h \
607 no_alu32 bpf_gcc bpf_testmod.ko \
608 liburandom_read.so)
609
610.PHONY: docs docs-clean