Makefile (fe33c0fbed75dd464747c0faaedf94c7d8eb4101) Makefile (98cb12eb52a780e682bea8372fdb2912c08132dd)
1# SPDX-License-Identifier: GPL-2.0
2# Makefile for net selftests
3
4CFLAGS = -Wall -Wl,--no-as-needed -O2 -g
5CFLAGS += -I../../../../usr/include/ $(KHDR_INCLUDES)
6# Additional include paths needed by kselftest.h
7CFLAGS += -I../
8

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

79TEST_GEN_PROGS += sk_bind_sendto_listen
80TEST_GEN_PROGS += sk_connect_zero_addr
81TEST_PROGS += test_ingress_egress_chaining.sh
82TEST_GEN_PROGS += so_incoming_cpu
83TEST_PROGS += sctp_vrf.sh
84TEST_GEN_FILES += sctp_hello
85TEST_GEN_FILES += csum
86TEST_GEN_FILES += nat6to4.o
1# SPDX-License-Identifier: GPL-2.0
2# Makefile for net selftests
3
4CFLAGS = -Wall -Wl,--no-as-needed -O2 -g
5CFLAGS += -I../../../../usr/include/ $(KHDR_INCLUDES)
6# Additional include paths needed by kselftest.h
7CFLAGS += -I../
8

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

79TEST_GEN_PROGS += sk_bind_sendto_listen
80TEST_GEN_PROGS += sk_connect_zero_addr
81TEST_PROGS += test_ingress_egress_chaining.sh
82TEST_GEN_PROGS += so_incoming_cpu
83TEST_PROGS += sctp_vrf.sh
84TEST_GEN_FILES += sctp_hello
85TEST_GEN_FILES += csum
86TEST_GEN_FILES += nat6to4.o
87TEST_GEN_FILES += xdp_dummy.o
87TEST_GEN_FILES += ip_local_port_range
88TEST_GEN_FILES += bind_wildcard
89TEST_PROGS += test_vxlan_mdb.sh
90TEST_PROGS += test_bridge_neigh_suppress.sh
91TEST_PROGS += test_vxlan_nolocalbypass.sh
92TEST_PROGS += test_bridge_backup_port.sh
93TEST_PROGS += fdb_flush.sh
94TEST_PROGS += fq_band_pktlimit.sh

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

99include ../lib.mk
100
101$(OUTPUT)/reuseport_bpf_numa: LDLIBS += -lnuma
102$(OUTPUT)/tcp_mmap: LDLIBS += -lpthread -lcrypto
103$(OUTPUT)/tcp_inq: LDLIBS += -lpthread
104$(OUTPUT)/bind_bhash: LDLIBS += -lpthread
105$(OUTPUT)/io_uring_zerocopy_tx: CFLAGS += -I../../../include/
106
88TEST_GEN_FILES += ip_local_port_range
89TEST_GEN_FILES += bind_wildcard
90TEST_PROGS += test_vxlan_mdb.sh
91TEST_PROGS += test_bridge_neigh_suppress.sh
92TEST_PROGS += test_vxlan_nolocalbypass.sh
93TEST_PROGS += test_bridge_backup_port.sh
94TEST_PROGS += fdb_flush.sh
95TEST_PROGS += fq_band_pktlimit.sh

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

100include ../lib.mk
101
102$(OUTPUT)/reuseport_bpf_numa: LDLIBS += -lnuma
103$(OUTPUT)/tcp_mmap: LDLIBS += -lpthread -lcrypto
104$(OUTPUT)/tcp_inq: LDLIBS += -lpthread
105$(OUTPUT)/bind_bhash: LDLIBS += -lpthread
106$(OUTPUT)/io_uring_zerocopy_tx: CFLAGS += -I../../../include/
107
107# Rules to generate bpf obj nat6to4.o
108# Rules to generate bpf objs
108CLANG ?= clang
109SCRATCH_DIR := $(OUTPUT)/tools
110BUILD_DIR := $(SCRATCH_DIR)/build
111BPFDIR := $(abspath ../../../lib/bpf)
112APIDIR := $(abspath ../../../include/uapi)
113
114CCINCLUDE += -I../bpf
115CCINCLUDE += -I../../../../usr/include/

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

134endef
135
136ifneq ($(CROSS_COMPILE),)
137CLANG_TARGET_ARCH = --target=$(notdir $(CROSS_COMPILE:%-=%))
138endif
139
140CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG),$(CLANG_TARGET_ARCH))
141
109CLANG ?= clang
110SCRATCH_DIR := $(OUTPUT)/tools
111BUILD_DIR := $(SCRATCH_DIR)/build
112BPFDIR := $(abspath ../../../lib/bpf)
113APIDIR := $(abspath ../../../include/uapi)
114
115CCINCLUDE += -I../bpf
116CCINCLUDE += -I../../../../usr/include/

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

135endef
136
137ifneq ($(CROSS_COMPILE),)
138CLANG_TARGET_ARCH = --target=$(notdir $(CROSS_COMPILE:%-=%))
139endif
140
141CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG),$(CLANG_TARGET_ARCH))
142
142$(OUTPUT)/nat6to4.o: nat6to4.c $(BPFOBJ) | $(MAKE_DIRS)
143$(OUTPUT)/nat6to4.o $(OUTPUT)/xdp_dummy.o: $(OUTPUT)/%.o : %.c $(BPFOBJ) | $(MAKE_DIRS)
143 $(CLANG) -O2 --target=bpf -c $< $(CCINCLUDE) $(CLANG_SYS_INCLUDES) -o $@
144
145$(BPFOBJ): $(wildcard $(BPFDIR)/*.[ch] $(BPFDIR)/Makefile) \
146 $(APIDIR)/linux/bpf.h \
147 | $(BUILD_DIR)/libbpf
148 $(MAKE) $(submake_extras) -C $(BPFDIR) OUTPUT=$(BUILD_DIR)/libbpf/ \
149 EXTRA_CFLAGS='-g -O0' \
150 DESTDIR=$(SCRATCH_DIR) prefix= all install_headers
151
152EXTRA_CLEAN := $(SCRATCH_DIR)
144 $(CLANG) -O2 --target=bpf -c $< $(CCINCLUDE) $(CLANG_SYS_INCLUDES) -o $@
145
146$(BPFOBJ): $(wildcard $(BPFDIR)/*.[ch] $(BPFDIR)/Makefile) \
147 $(APIDIR)/linux/bpf.h \
148 | $(BUILD_DIR)/libbpf
149 $(MAKE) $(submake_extras) -C $(BPFDIR) OUTPUT=$(BUILD_DIR)/libbpf/ \
150 EXTRA_CFLAGS='-g -O0' \
151 DESTDIR=$(SCRATCH_DIR) prefix= all install_headers
152
153EXTRA_CLEAN := $(SCRATCH_DIR)