Makefile (aaccdf9c93a00cc5eec6f9d97046b44643c60800) | Makefile (3cccbaa0332169d4ff05587062a7ed528aeddb60) |
---|---|
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 .) --- 313 unchanged lines hidden (view full) --- 322define GCC_BPF_BUILD_RULE 323 $(call msg,GCC-BPF,$(TRUNNER_BINARY),$2) 324 $(Q)$(BPF_GCC) $3 -O2 -c $1 -o $2 325endef 326 327SKEL_BLACKLIST := btf__% test_pinning_invalid.c test_sk_assign.c 328 329LINKED_SKELS := test_static_linked.skel.h linked_funcs.skel.h \ | 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 .) --- 313 unchanged lines hidden (view full) --- 322define GCC_BPF_BUILD_RULE 323 $(call msg,GCC-BPF,$(TRUNNER_BINARY),$2) 324 $(Q)$(BPF_GCC) $3 -O2 -c $1 -o $2 325endef 326 327SKEL_BLACKLIST := btf__% test_pinning_invalid.c test_sk_assign.c 328 329LINKED_SKELS := test_static_linked.skel.h linked_funcs.skel.h \ |
330 linked_vars.skel.h linked_maps.skel.h | 330 linked_vars.skel.h linked_maps.skel.h \ 331 test_subskeleton.skel.h test_subskeleton_lib.skel.h |
331 | 332 |
333# In the subskeleton case, we want the test_subskeleton_lib.subskel.h file 334# but that's created as a side-effect of the skel.h generation. 335test_subskeleton.skel.h-deps := test_subskeleton_lib2.o test_subskeleton_lib.o test_subskeleton.o 336test_subskeleton_lib.skel.h-deps := test_subskeleton_lib2.o test_subskeleton_lib.o 337 |
|
332LSKELS := kfunc_call_test.c fentry_test.c fexit_test.c fexit_sleep.c \ 333 test_ringbuf.c atomics.c trace_printk.c trace_vprintk.c \ 334 map_ptr_kern.c core_kern.c core_kern_overflow.c 335# Generate both light skeleton and libbpf skeleton for these 336LSKELS_EXTRA := test_ksyms_module.c test_ksyms_weak.c kfunc_call_test_subprog.c 337SKEL_BLACKLIST += $$(LSKELS) 338 339test_static_linked.skel.h-deps := test_static_linked1.o test_static_linked2.o --- 60 unchanged lines hidden (view full) --- 400 401$(TRUNNER_BPF_SKELS): %.skel.h: %.o $(BPFTOOL) | $(TRUNNER_OUTPUT) 402 $$(call msg,GEN-SKEL,$(TRUNNER_BINARY),$$@) 403 $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked1.o) $$< 404 $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked2.o) $$(<:.o=.linked1.o) 405 $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked3.o) $$(<:.o=.linked2.o) 406 $(Q)diff $$(<:.o=.linked2.o) $$(<:.o=.linked3.o) 407 $(Q)$$(BPFTOOL) gen skeleton $$(<:.o=.linked3.o) name $$(notdir $$(<:.o=)) > $$@ | 338LSKELS := kfunc_call_test.c fentry_test.c fexit_test.c fexit_sleep.c \ 339 test_ringbuf.c atomics.c trace_printk.c trace_vprintk.c \ 340 map_ptr_kern.c core_kern.c core_kern_overflow.c 341# Generate both light skeleton and libbpf skeleton for these 342LSKELS_EXTRA := test_ksyms_module.c test_ksyms_weak.c kfunc_call_test_subprog.c 343SKEL_BLACKLIST += $$(LSKELS) 344 345test_static_linked.skel.h-deps := test_static_linked1.o test_static_linked2.o --- 60 unchanged lines hidden (view full) --- 406 407$(TRUNNER_BPF_SKELS): %.skel.h: %.o $(BPFTOOL) | $(TRUNNER_OUTPUT) 408 $$(call msg,GEN-SKEL,$(TRUNNER_BINARY),$$@) 409 $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked1.o) $$< 410 $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked2.o) $$(<:.o=.linked1.o) 411 $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked3.o) $$(<:.o=.linked2.o) 412 $(Q)diff $$(<:.o=.linked2.o) $$(<:.o=.linked3.o) 413 $(Q)$$(BPFTOOL) gen skeleton $$(<:.o=.linked3.o) name $$(notdir $$(<:.o=)) > $$@ |
414 $(Q)$$(BPFTOOL) gen subskeleton $$(<:.o=.linked3.o) name $$(notdir $$(<:.o=)) > $$(@:.skel.h=.subskel.h) |
|
408 409$(TRUNNER_BPF_LSKELS): %.lskel.h: %.o $(BPFTOOL) | $(TRUNNER_OUTPUT) 410 $$(call msg,GEN-SKEL,$(TRUNNER_BINARY),$$@) 411 $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked1.o) $$< 412 $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked2.o) $$(<:.o=.linked1.o) 413 $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked3.o) $$(<:.o=.linked2.o) 414 $(Q)diff $$(<:.o=.linked2.o) $$(<:.o=.linked3.o) 415 $(Q)$$(BPFTOOL) gen skeleton -L $$(<:.o=.linked3.o) name $$(notdir $$(<:.o=_lskel)) > $$@ 416 417$(TRUNNER_BPF_SKELS_LINKED): $(TRUNNER_BPF_OBJS) $(BPFTOOL) | $(TRUNNER_OUTPUT) 418 $$(call msg,LINK-BPF,$(TRUNNER_BINARY),$$(@:.skel.h=.o)) 419 $(Q)$$(BPFTOOL) gen object $$(@:.skel.h=.linked1.o) $$(addprefix $(TRUNNER_OUTPUT)/,$$($$(@F)-deps)) 420 $(Q)$$(BPFTOOL) gen object $$(@:.skel.h=.linked2.o) $$(@:.skel.h=.linked1.o) 421 $(Q)$$(BPFTOOL) gen object $$(@:.skel.h=.linked3.o) $$(@:.skel.h=.linked2.o) 422 $(Q)diff $$(@:.skel.h=.linked2.o) $$(@:.skel.h=.linked3.o) 423 $$(call msg,GEN-SKEL,$(TRUNNER_BINARY),$$@) 424 $(Q)$$(BPFTOOL) gen skeleton $$(@:.skel.h=.linked3.o) name $$(notdir $$(@:.skel.h=)) > $$@ | 415 416$(TRUNNER_BPF_LSKELS): %.lskel.h: %.o $(BPFTOOL) | $(TRUNNER_OUTPUT) 417 $$(call msg,GEN-SKEL,$(TRUNNER_BINARY),$$@) 418 $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked1.o) $$< 419 $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked2.o) $$(<:.o=.linked1.o) 420 $(Q)$$(BPFTOOL) gen object $$(<:.o=.linked3.o) $$(<:.o=.linked2.o) 421 $(Q)diff $$(<:.o=.linked2.o) $$(<:.o=.linked3.o) 422 $(Q)$$(BPFTOOL) gen skeleton -L $$(<:.o=.linked3.o) name $$(notdir $$(<:.o=_lskel)) > $$@ 423 424$(TRUNNER_BPF_SKELS_LINKED): $(TRUNNER_BPF_OBJS) $(BPFTOOL) | $(TRUNNER_OUTPUT) 425 $$(call msg,LINK-BPF,$(TRUNNER_BINARY),$$(@:.skel.h=.o)) 426 $(Q)$$(BPFTOOL) gen object $$(@:.skel.h=.linked1.o) $$(addprefix $(TRUNNER_OUTPUT)/,$$($$(@F)-deps)) 427 $(Q)$$(BPFTOOL) gen object $$(@:.skel.h=.linked2.o) $$(@:.skel.h=.linked1.o) 428 $(Q)$$(BPFTOOL) gen object $$(@:.skel.h=.linked3.o) $$(@:.skel.h=.linked2.o) 429 $(Q)diff $$(@:.skel.h=.linked2.o) $$(@:.skel.h=.linked3.o) 430 $$(call msg,GEN-SKEL,$(TRUNNER_BINARY),$$@) 431 $(Q)$$(BPFTOOL) gen skeleton $$(@:.skel.h=.linked3.o) name $$(notdir $$(@:.skel.h=)) > $$@ |
432 $(Q)$$(BPFTOOL) gen subskeleton $$(@:.skel.h=.linked3.o) name $$(notdir $$(@:.skel.h=)) > $$(@:.skel.h=.subskel.h) |
|
425endif 426 427# ensure we set up tests.h header generation rule just once 428ifeq ($($(TRUNNER_TESTS_DIR)-tests-hdr),) 429$(TRUNNER_TESTS_DIR)-tests-hdr := y 430$(TRUNNER_TESTS_HDR): $(TRUNNER_TESTS_DIR)/*.c 431 $$(call msg,TEST-HDR,$(TRUNNER_BINARY),$$@) 432 $$(shell (echo '/* Generated header, do not edit */'; \ --- 121 unchanged lines hidden (view full) --- 554 $(OUTPUT)/bench_bpf_loop.o \ 555 $(OUTPUT)/bench_strncmp.o 556 $(call msg,BINARY,,$@) 557 $(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(filter %.a %.o,$^) $(LDLIBS) -o $@ 558 559EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(SCRATCH_DIR) $(HOST_SCRATCH_DIR) \ 560 prog_tests/tests.h map_tests/tests.h verifier/tests.h \ 561 feature bpftool \ | 433endif 434 435# ensure we set up tests.h header generation rule just once 436ifeq ($($(TRUNNER_TESTS_DIR)-tests-hdr),) 437$(TRUNNER_TESTS_DIR)-tests-hdr := y 438$(TRUNNER_TESTS_HDR): $(TRUNNER_TESTS_DIR)/*.c 439 $$(call msg,TEST-HDR,$(TRUNNER_BINARY),$$@) 440 $$(shell (echo '/* Generated header, do not edit */'; \ --- 121 unchanged lines hidden (view full) --- 562 $(OUTPUT)/bench_bpf_loop.o \ 563 $(OUTPUT)/bench_strncmp.o 564 $(call msg,BINARY,,$@) 565 $(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(filter %.a %.o,$^) $(LDLIBS) -o $@ 566 567EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(SCRATCH_DIR) $(HOST_SCRATCH_DIR) \ 568 prog_tests/tests.h map_tests/tests.h verifier/tests.h \ 569 feature bpftool \ |
562 $(addprefix $(OUTPUT)/,*.o *.skel.h *.lskel.h no_alu32 bpf_gcc bpf_testmod.ko) | 570 $(addprefix $(OUTPUT)/,*.o *.skel.h *.lskel.h *.subskel.h no_alu32 bpf_gcc bpf_testmod.ko) |
563 564.PHONY: docs docs-clean | 571 572.PHONY: docs docs-clean |