Lines Matching +full:2 +full:c
89 # $2 - optional "flavor" specifier; if provided, will be emitted as [flavor];
97 msg = @printf ' %-8s%s %s%s\n' "$(1)" "$(if $(2), [$(2)])" "$(notdir $(3))" "$(if $(4), $(4))";
127 $(OUTPUT)/%.o: %.c
129 $(Q)$(CC) $(CFLAGS) -c $(filter %.c,$^) $(LDLIBS) -o $@
131 $(OUTPUT)/%:%.c
133 $(Q)$(LINK.c) $^ $(LDLIBS) -o $@
135 $(OUTPUT)/urandom_read: urandom_read.c
139 $(OUTPUT)/test_stub.o: test_stub.c $(BPFOBJ)
141 $(Q)$(CC) -c $(CFLAGS) -o $@ $<
153 $(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/runqslower \
160 $(OUTPUT)/test_dev_cgroup: cgroup_helpers.c
161 $(OUTPUT)/test_skb_cgroup_id_user: cgroup_helpers.c
162 $(OUTPUT)/test_sock: cgroup_helpers.c
163 $(OUTPUT)/test_sock_addr: cgroup_helpers.c
164 $(OUTPUT)/test_socket_cookie: cgroup_helpers.c
165 $(OUTPUT)/test_sockmap: cgroup_helpers.c
166 $(OUTPUT)/test_tcpbpf_user: cgroup_helpers.c
167 $(OUTPUT)/test_tcpnotify_user: cgroup_helpers.c trace_helpers.c
168 $(OUTPUT)/get_cgroup_id_user: cgroup_helpers.c
169 $(OUTPUT)/test_cgroup_storage: cgroup_helpers.c
170 $(OUTPUT)/test_netcnt: cgroup_helpers.c
171 $(OUTPUT)/test_sock_fields: cgroup_helpers.c
172 $(OUTPUT)/test_sysctl: cgroup_helpers.c
177 $(Q)$(MAKE) $(submake_extras) -C $(BPFTOOLDIR) \
182 -C $(BPFTOOLDIR)/Documentation \
189 $(Q)$(MAKE) $(submake_extras) -C $(BPFDIR) OUTPUT=$(BUILD_DIR)/libbpf/ \
199 $(Q)$(BPFTOOL) btf dump file $(VMLINUX_BTF) format c > $@
206 $(TOOLSDIR)/bpf/resolve_btfids/main.c \
207 $(TOOLSDIR)/lib/rbtree.c \
208 $(TOOLSDIR)/lib/zalloc.c \
209 $(TOOLSDIR)/lib/string.c \
210 $(TOOLSDIR)/lib/ctype.c \
211 $(TOOLSDIR)/lib/str_error_r.c
212 $(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/resolve_btfids \
222 $(shell $(1) -v -E - </dev/null 2>&1 \
245 # $1 - input .c file
246 # $2 - output .o file
250 $(call msg,CLNG-LLC,$(TRUNNER_BINARY),$2)
252 -c $1 -o - || echo "BPF obj compilation failed") | \
253 $(LLC) -mattr=dwarfris -march=bpf -mcpu=v3 $4 -filetype=obj -o $2
257 $(call msg,CLNG-LLC,$(TRUNNER_BINARY),$2)
259 -c $1 -o - || echo "BPF obj compilation failed") | \
260 $(LLC) -march=bpf -mcpu=v2 $4 -filetype=obj -o $2
264 $(call msg,CLNG-BPF,$(TRUNNER_BINARY),$2)
266 -c $1 -o - || echo "BPF obj compilation failed") | \
267 $(LLC) -march=bpf -mcpu=v3 $4 -filetype=obj -o $2
271 $(call msg,GCC-BPF,$(TRUNNER_BINARY),$2)
272 $(Q)$(BPF_GCC) $3 $4 -O2 -c $1 -o $2
275 SKEL_BLACKLIST := btf__% test_pinning_invalid.c test_sk_assign.c
281 # $2 - test runner extra "flavor" (e.g., no_alu32, gcc-bpf, etc)
284 TRUNNER_OUTPUT := $(OUTPUT)$(if $2,/)$2
285 TRUNNER_BINARY := $1$(if $2,-)$2
286 TRUNNER_TEST_OBJS := $$(patsubst %.c,$$(TRUNNER_OUTPUT)/%.test.o, \
287 $$(notdir $$(wildcard $(TRUNNER_TESTS_DIR)/*.c)))
288 TRUNNER_EXTRA_OBJS := $$(patsubst %.c,$$(TRUNNER_OUTPUT)/%.o, \
289 $$(filter %.c,$(TRUNNER_EXTRA_SOURCES)))
292 TRUNNER_BPF_SRCS := $$(notdir $$(wildcard $(TRUNNER_BPF_PROGS_DIR)/*.c))
293 TRUNNER_BPF_OBJS := $$(patsubst %.c,$$(TRUNNER_OUTPUT)/%.o, $$(TRUNNER_BPF_SRCS))
294 TRUNNER_BPF_SKELS := $$(patsubst %.c,$$(TRUNNER_OUTPUT)/%.skel.h, \
300 $$(eval $$(call DEFINE_TEST_RUNNER_RULES,$1,$2))
307 # $2 - test runner extra "flavor" (e.g., no_alu32, gcc-bpf, etc)
319 ifeq ($($(TRUNNER_BPF_PROGS_DIR)$(if $2,-)$2-bpfobjs),)
320 $(TRUNNER_BPF_PROGS_DIR)$(if $2,-)$2-bpfobjs := y
322 $(TRUNNER_BPF_PROGS_DIR)/%.c \
340 $(TRUNNER_TESTS_HDR): $(TRUNNER_TESTS_DIR)/*.c
344 ls *.c 2> /dev/null | \
345 sed -e 's@\([^\.]*\)\.c@DEFINE_TEST(\1)@'; \
352 $(TRUNNER_TESTS_DIR)/%.c \
358 $(Q)cd $$(@D) && $$(CC) -I. $$(CFLAGS) -c $(CURDIR)/$$< $$(LDLIBS) -o $$(@F)
361 %.c \
366 $(Q)$$(CC) $$(CFLAGS) -c $$< $$(LDLIBS) -o $$@
370 ifneq ($2,)
388 TRUNNER_EXTRA_SOURCES := test_progs.c cgroup_helpers.c trace_helpers.c \
389 network_helpers.c testing_helpers.c \
392 $(wildcard progs/btf_dump_test_case_*.c)
414 TRUNNER_EXTRA_SOURCES := test_maps.c
425 verifier/tests.h: verifier/*.c
429 ls *.c 2> /dev/null | sed -e 's@\(.*\)@#include \"\1\"@'; \
432 $(OUTPUT)/test_verifier: test_verifier.c verifier/tests.h $(BPFOBJ) | $(OUTPUT)
434 $(Q)$(CC) $(CFLAGS) $(filter %.a %.o %.c,$^) $(LDLIBS) -o $@
436 # Make sure we are able to include and link libbpf against c++.
442 $(OUTPUT)/bench_%.o: benchs/bench_%.c bench.h
444 $(Q)$(CC) $(CFLAGS) -c $(filter %.c,$^) $(LDLIBS) -o $@