diff options
author | Anders Roxell <anders.roxell@linaro.org> | 2019-03-14 23:52:11 +0100 |
---|---|---|
committer | Anders Roxell <anders.roxell@linaro.org> | 2019-03-14 23:52:11 +0100 |
commit | 6df5c51d1729e685508a17bb9d64133913a859a5 (patch) | |
tree | c70946937e91f532f856d675f082ba8112469d07 | |
parent | e346a2455c995bbe747ecb0a9e0ca84bd91abd32 (diff) |
build against tools/(arch|include) instead of headers_installkselftest-tools-includeWIP-ksft-use-tools-inc-next-20190306
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
31 files changed, 67 insertions, 86 deletions
@@ -1178,9 +1178,17 @@ endif # --------------------------------------------------------------------------- # Kernel selftest +PHONY += kselftest-build +kselftest-build: + $(Q)$(MAKE) O=$(abspath $(objtree))/kselftest -C $(srctree)/tools/testing/selftests all + +PHONY += kselftest-install +kselftest-install: kselftest-build + $(Q)$(MAKE) O=$(abspath $(objtree))/kselftest -C $(srctree)/tools/testing/selftests install + PHONY += kselftest -kselftest: - $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests run_tests +kselftest: kselftest-build + $(Q)$(MAKE) O=$(abspath $(objtree))/kselftest -C $(srctree)/tools/testing/selftests run_tests PHONY += kselftest-clean kselftest-clean: diff --git a/tools/gpio/Makefile b/tools/gpio/Makefile index 6ecdd1067826..2e2e3157c588 100644 --- a/tools/gpio/Makefile +++ b/tools/gpio/Makefile @@ -12,7 +12,7 @@ endif # (this improves performance and avoids hard-to-debug behaviour); MAKEFLAGS += -r -override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include +override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I../include/uapi ALL_TARGETS := lsgpio gpio-hammer gpio-event-mon ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS)) @@ -23,15 +23,6 @@ export srctree OUTPUT CC LD CFLAGS include $(srctree)/tools/build/Makefile.include # -# We need the following to be outside of kernel tree -# -$(OUTPUT)include/linux/gpio.h: ../../include/uapi/linux/gpio.h - mkdir -p $(OUTPUT)include/linux 2>&1 || true - ln -sf $(CURDIR)/../../include/uapi/linux/gpio.h $@ - -prepare: $(OUTPUT)include/linux/gpio.h - -# # lsgpio # LSGPIO_IN := $(OUTPUT)lsgpio-in.o @@ -60,7 +51,6 @@ $(OUTPUT)gpio-event-mon: $(GPIO_EVENT_MON_IN) clean: rm -f $(ALL_PROGRAMS) - rm -f $(OUTPUT)include/linux/gpio.h find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete install: $(ALL_PROGRAMS) diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index 971fc8428117..e9258e82a57c 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -76,9 +76,9 @@ override LDFLAGS = endif BUILD := $(O) -ifndef BUILD - BUILD := $(KBUILD_OUTPUT) -endif +#ifndef BUILD +# BUILD := $(KBUILD_OUTPUT) +#endif ifndef BUILD BUILD := $(shell pwd) endif @@ -124,7 +124,7 @@ clean_hotplug: run_pstore_crash: make -C pstore run_crash -INSTALL_PATH ?= install +INSTALL_PATH ?= $(O)/kselftest-install INSTALL_PATH := $(abspath $(INSTALL_PATH)) ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh diff --git a/tools/testing/selftests/android/ion/Makefile b/tools/testing/selftests/android/ion/Makefile index ce05c5f3594b..bbdfefc4fbce 100644 --- a/tools/testing/selftests/android/ion/Makefile +++ b/tools/testing/selftests/android/ion/Makefile @@ -1,13 +1,12 @@ - -INCLUDEDIR := -I. -I../../../../../drivers/staging/android/uapi/ -I../../../../../usr/include/ +top_srcdir = ../../../../.. +tools_dir = $(top_srcdir)/tools +INCLUDEDIR := -I. -I$(top_srcdir)/drivers/staging/android/uapi/ -I$(tools_dir)/include/uapi -I$(tools_dir)/include/ CFLAGS := $(CFLAGS) $(INCLUDEDIR) -Wall -O2 -g TEST_GEN_FILES := ionapp_export ionapp_import ionmap_test TEST_PROGS := ion_test.sh -KSFT_KHDR_INSTALL := 1 -top_srcdir = ../../../../.. include ../../lib.mk $(OUTPUT)/ionapp_export: ionapp_export.c ipcsocket.c ionutils.c diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 518cd587cd63..a4caedad2bcf 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -1,21 +1,21 @@ # SPDX-License-Identifier: GPL-2.0 -LIBDIR := ../../../lib +tools_dir = ../../.. +LIBDIR := $(tools_dir)/lib BPFDIR := $(LIBDIR)/bpf -APIDIR := ../../../include/uapi -GENDIR := ../../../../include/generated -GENHDR := $(GENDIR)/autoconf.h - -ifneq ($(wildcard $(GENHDR)),) - GENFLAGS := -DHAVE_GENHDR -endif +APIDIR := $(tools_dir)/include/uapi CLANG ?= clang LLC ?= llc LLVM_OBJCOPY ?= llvm-objcopy LLVM_READELF ?= llvm-readelf BTF_PAHOLE ?= pahole -CFLAGS += -Wall -O2 -I$(APIDIR) -I$(LIBDIR) -I$(BPFDIR) -I$(GENDIR) $(GENFLAGS) -I../../../include +mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) +mkfile_dir := $(dir $(mkfile_path)) +CFLAGS += -Wall -O2 -I$(APIDIR) -I$(LIBDIR) -I$(BPFDIR) $(GENFLAGS) -I../../../include +CFLAGS += -I$(mkfile_dir) +CFLAGS += -I$(mkfile_dir)/verifier +CFLAGS += -I$(mkfile_dir)/prog_tests LDLIBS += -lcap -lelf -lrt -lpthread # Order correspond to 'make run_tests' order @@ -118,7 +118,7 @@ endif CLANG_SYS_INCLUDES := $(shell $(CLANG) -v -E - </dev/null 2>&1 \ | sed -n '/<...> search starts here:/,/End of search list./{ s| \(/.*\)|-idirafter \1|p }') -CLANG_FLAGS = -I. -I./include/uapi -I../../../include/uapi \ +CLANG_FLAGS = -I. -I./include/uapi -I../../../include/uapi -I$(OUTPUT) \ $(CLANG_SYS_INCLUDES) \ -Wno-compare-distinct-pointer-types @@ -205,8 +205,11 @@ $(OUTPUT)/test_progs: $(PROG_TESTS_H) $(OUTPUT)/test_progs: CFLAGS += -I$(OUTPUT) $(OUTPUT)/test_progs: prog_tests/*.c +$(OUTPUT)/prog_tests: + @mkdir -p $(OUTPUT)/prog_tests + PROG_TESTS_FILES := $(wildcard prog_tests/*.c) -$(PROG_TESTS_H): $(PROG_TESTS_FILES) +$(PROG_TESTS_H): $(PROG_TESTS_FILES) $(OUTPUT)/prog_tests $(shell ( cd prog_tests/ echo '/* Generated header, do not edit */'; \ echo '#ifdef DECLARE'; \ @@ -223,8 +226,11 @@ VERIFIER_TESTS_H := $(OUTPUT)/verifier/tests.h $(OUTPUT)/test_verifier: $(VERIFIER_TESTS_H) $(OUTPUT)/test_verifier: CFLAGS += -I$(OUTPUT) +$(OUTPUT)/verifier: + @mkdir -p $(OUTPUT)/verifier + VERIFIER_TEST_FILES := $(wildcard verifier/*.c) -$(OUTPUT)/verifier/tests.h: $(VERIFIER_TEST_FILES) +$(VERIFIER_TESTS_H): $(VERIFIER_TEST_FILES) $(OUTPUT)/verifier $(shell ( cd verifier/ echo '/* Generated header, do not edit */'; \ echo '#ifdef FILL_ARRAY'; \ diff --git a/tools/testing/selftests/drivers/dma-buf/Makefile b/tools/testing/selftests/drivers/dma-buf/Makefile index f22c3f7cf612..49ea1825efa3 100644 --- a/tools/testing/selftests/drivers/dma-buf/Makefile +++ b/tools/testing/selftests/drivers/dma-buf/Makefile @@ -1,4 +1,4 @@ -CFLAGS += -I../../../../../usr/include/ +CFLAGS += -I../../../../include/uapi TEST_GEN_PROGS := udmabuf diff --git a/tools/testing/selftests/filesystems/Makefile b/tools/testing/selftests/filesystems/Makefile index 129880fb42d3..192969d42d74 100644 --- a/tools/testing/selftests/filesystems/Makefile +++ b/tools/testing/selftests/filesystems/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -I../../../../usr/include/ +CFLAGS += -I../../../include/ TEST_GEN_PROGS := devpts_pts TEST_GEN_PROGS_EXTENDED := dnotify_test diff --git a/tools/testing/selftests/filesystems/binderfs/Makefile b/tools/testing/selftests/filesystems/binderfs/Makefile index 58cb659b56b4..e4dbc6555f71 100644 --- a/tools/testing/selftests/filesystems/binderfs/Makefile +++ b/tools/testing/selftests/filesystems/binderfs/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -I../../../../../usr/include/ +CFLAGS += -I../../../include/ TEST_GEN_PROGS := binderfs_test include ../../lib.mk diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/testing/selftests/futex/functional/Makefile index 30996306cabc..ad1eeb14fda7 100644 --- a/tools/testing/selftests/futex/functional/Makefile +++ b/tools/testing/selftests/futex/functional/Makefile @@ -19,7 +19,6 @@ TEST_GEN_FILES := \ TEST_PROGS := run.sh top_srcdir = ../../../../.. -KSFT_KHDR_INSTALL := 1 include ../../lib.mk $(TEST_GEN_FILES): $(HEADERS) diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selftests/gpio/Makefile index 0bb80619db58..89edc09354c2 100644 --- a/tools/testing/selftests/gpio/Makefile +++ b/tools/testing/selftests/gpio/Makefile @@ -6,7 +6,7 @@ ifeq ($(MOUNT_LDLIBS),) MOUNT_LDLIBS := -lmount -I/usr/include/libmount endif -CFLAGS += -O2 -g -std=gnu99 -Wall -I../../../../usr/include/ $(MOUNT_CFLAGS) +CFLAGS += -O2 -g -std=gnu99 -Wall -I../../../include/ $(MOUNT_CFLAGS) LDLIBS += $(MOUNT_LDLIBS) TEST_PROGS := gpio-mockup.sh @@ -23,7 +23,6 @@ override define CLEAN $(MAKE) -C $(GPIODIR) OUTPUT=$(GPIODIR)/ clean endef -KSFT_KHDR_INSTALL := 1 include ../lib.mk $(TEST_PROGS_EXTENDED): $(GPIODIR)/$(GPIOOBJ) diff --git a/tools/testing/selftests/ipc/Makefile b/tools/testing/selftests/ipc/Makefile index 1c4448a843a4..9d14e4aad9fc 100644 --- a/tools/testing/selftests/ipc/Makefile +++ b/tools/testing/selftests/ipc/Makefile @@ -10,7 +10,7 @@ ifeq ($(ARCH),x86_64) CFLAGS := -DCONFIG_X86_64 -D__x86_64__ endif -CFLAGS += -I../../../../usr/include/ +CFLAGS += -I../../../include/ TEST_GEN_PROGS := msgque diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile index 47aa9887f9d4..ca8841c1d183 100644 --- a/tools/testing/selftests/kcmp/Makefile +++ b/tools/testing/selftests/kcmp/Makefile @@ -1,4 +1,4 @@ -CFLAGS += -I../../../../usr/include/ +CFLAGS += -I../../../include/ TEST_GEN_PROGS := kcmp_test diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile index 3c1f4bdf9000..fb500090552e 100644 --- a/tools/testing/selftests/kvm/Makefile +++ b/tools/testing/selftests/kvm/Makefile @@ -1,7 +1,6 @@ all: top_srcdir = ../../../.. -KSFT_KHDR_INSTALL := 1 UNAME_M := $(shell uname -m) LIBKVM = lib/assert.c lib/elf.c lib/io.c lib/kvm_util.c lib/ucall.c lib/sparsebit.c @@ -26,10 +25,8 @@ TEST_GEN_PROGS_aarch64 += clear_dirty_log_test TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(UNAME_M)) LIBKVM += $(LIBKVM_$(UNAME_M)) -INSTALL_HDR_PATH = $(top_srcdir)/usr -LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/ LINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include -CFLAGS += -O2 -g -std=gnu99 -I$(LINUX_TOOL_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude -I$(<D) -Iinclude/$(UNAME_M) -I.. +CFLAGS += -O2 -g -std=gnu99 -I$(LINUX_TOOL_INCLUDE) -Iinclude -I$(<D) -Iinclude/$(UNAME_M) -I.. LDFLAGS += -pthread # After inclusion, $(OUTPUT) is defined and @@ -50,7 +47,7 @@ $(OUTPUT)/libkvm.a: $(LIBKVM_OBJ) all: $(STATIC_LIBS) $(TEST_GEN_PROGS): $(STATIC_LIBS) -cscope: include_paths = $(LINUX_TOOL_INCLUDE) $(LINUX_HDR_PATH) include lib .. +cscope: include_paths = $(LINUX_TOOL_INCLUDE) include lib .. cscope: $(RM) cscope.* (find $(include_paths) -name '*.h' \ diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 8b0f16409ed7..3682a20c5b27 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -16,19 +16,14 @@ TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS)) TEST_GEN_PROGS_EXTENDED := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS_EXTENDED)) TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES)) -ifdef KSFT_KHDR_INSTALL top_srcdir ?= ../../../.. include $(top_srcdir)/scripts/subarch.include ARCH ?= $(SUBARCH) -.PHONY: khdr -khdr: - make ARCH=$(ARCH) -C $(top_srcdir) headers_install +KRN_INC_HDR := -I$(KBUILD_SRC)/tools/include/ +KRN_API_HDR := -I$(KBUILD_SRC)/tools/arch/$(ARCH)/include/ -I$(KBUILD_SRC)/tools/include/uapi/ -all: khdr $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) -else all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) -endif .ONESHELL: define RUN_TEST_PRINT_RESULT diff --git a/tools/testing/selftests/media_tests/Makefile b/tools/testing/selftests/media_tests/Makefile index 60826d7d37d4..a50cb7503f8c 100644 --- a/tools/testing/selftests/media_tests/Makefile +++ b/tools/testing/selftests/media_tests/Makefile @@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 # -CFLAGS += -I../ -I../../../../usr/include/ +tools_dir = ../../.. +CFLAGS += -I../ -I../../../include/ TEST_GEN_PROGS := media_device_test media_device_open video_device_test include ../lib.mk diff --git a/tools/testing/selftests/membarrier/Makefile b/tools/testing/selftests/membarrier/Makefile index 02845532b059..174d928fd49e 100644 --- a/tools/testing/selftests/membarrier/Makefile +++ b/tools/testing/selftests/membarrier/Makefile @@ -1,4 +1,4 @@ -CFLAGS += -g -I../../../../usr/include/ +CFLAGS += -g -I../../../include/ TEST_GEN_PROGS := membarrier_test diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests/memfd/Makefile index 53a848109f7b..c6c31445aff2 100644 --- a/tools/testing/selftests/memfd/Makefile +++ b/tools/testing/selftests/memfd/Makefile @@ -1,8 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS += -D_FILE_OFFSET_BITS=64 -CFLAGS += -I../../../../include/uapi/ -CFLAGS += -I../../../../include/ -CFLAGS += -I../../../../usr/include/ +CFLAGS += -I../../../include/uapi/ +CFLAGS += -I../../../include/ TEST_GEN_PROGS := memfd_test TEST_PROGS := run_fuse_test.sh run_hugetlbfs_test.sh diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile index 1e6d14d2825c..ef72291d5ae9 100644 --- a/tools/testing/selftests/net/Makefile +++ b/tools/testing/selftests/net/Makefile @@ -2,7 +2,7 @@ # Makefile for net selftests CFLAGS = -Wall -Wl,--no-as-needed -O2 -g -CFLAGS += -I../../../../usr/include/ +CFLAGS += -I../../../include/ TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh netdevice.sh \ rtnetlink.sh xfrm_policy.sh @@ -18,7 +18,6 @@ TEST_GEN_FILES += udpgso udpgso_bench_tx udpgso_bench_rx ip_defrag TEST_GEN_PROGS = reuseport_bpf reuseport_bpf_cpu reuseport_bpf_numa TEST_GEN_PROGS += reuseport_dualstack reuseaddr_conflict tls -KSFT_KHDR_INSTALL := 1 include ../lib.mk $(OUTPUT)/reuseport_bpf_numa: LDLIBS += -lnuma diff --git a/tools/testing/selftests/networking/timestamping/Makefile b/tools/testing/selftests/networking/timestamping/Makefile index 1de8bd8ccf5d..106d6a806564 100644 --- a/tools/testing/selftests/networking/timestamping/Makefile +++ b/tools/testing/selftests/networking/timestamping/Makefile @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -I../../../../../usr/include +CFLAGS += -I../../../../include TEST_GEN_FILES := hwtstamp_config rxtimestamp timestamping txtimestamp TEST_PROGS := txtimestamp.sh @@ -7,5 +7,4 @@ TEST_PROGS := txtimestamp.sh all: $(TEST_PROGS) top_srcdir = ../../../../.. -KSFT_KHDR_INSTALL := 1 include ../../lib.mk diff --git a/tools/testing/selftests/pidfd/Makefile b/tools/testing/selftests/pidfd/Makefile index deaf8073bc06..0e404c8914ed 100644 --- a/tools/testing/selftests/pidfd/Makefile +++ b/tools/testing/selftests/pidfd/Makefile @@ -1,4 +1,4 @@ -CFLAGS += -g -I../../../../usr/include/ +CFLAGS += -g -I../../../include/ TEST_GEN_PROGS := pidfd_test diff --git a/tools/testing/selftests/powerpc/ptrace/Makefile b/tools/testing/selftests/powerpc/ptrace/Makefile index 8d3f006c98cc..b5b3de2d315a 100644 --- a/tools/testing/selftests/powerpc/ptrace/Makefile +++ b/tools/testing/selftests/powerpc/ptrace/Makefile @@ -7,7 +7,7 @@ TEST_GEN_PROGS := ptrace-gpr ptrace-tm-gpr ptrace-tm-spd-gpr \ top_srcdir = ../../../../.. include ../../lib.mk -CFLAGS += -m64 -I../../../../../usr/include -I../tm -mhtm -fno-pie +CFLAGS += -m64 -I../../../../include -I../tm -mhtm -fno-pie $(OUTPUT)/ptrace-pkey $(OUTPUT)/core-pkey: child.h $(OUTPUT)/ptrace-pkey $(OUTPUT)/core-pkey: LDLIBS += -pthread diff --git a/tools/testing/selftests/powerpc/security/Makefile b/tools/testing/selftests/powerpc/security/Makefile index 85861c46b445..7ea9576fa42e 100644 --- a/tools/testing/selftests/powerpc/security/Makefile +++ b/tools/testing/selftests/powerpc/security/Makefile @@ -3,7 +3,7 @@ TEST_GEN_PROGS := rfi_flush top_srcdir = ../../../../.. -CFLAGS += -I../../../../../usr/include +CFLAGS += -I../../../../include include ../../lib.mk diff --git a/tools/testing/selftests/powerpc/syscalls/Makefile b/tools/testing/selftests/powerpc/syscalls/Makefile index 161b8846336f..0de413e41d94 100644 --- a/tools/testing/selftests/powerpc/syscalls/Makefile +++ b/tools/testing/selftests/powerpc/syscalls/Makefile @@ -1,6 +1,6 @@ TEST_GEN_PROGS := ipc_unmuxed -CFLAGS += -I../../../../../usr/include +CFLAGS += -I../../../../include top_srcdir = ../../../../.. include ../../lib.mk diff --git a/tools/testing/selftests/powerpc/tm/Makefile b/tools/testing/selftests/powerpc/tm/Makefile index c0734ed0ef56..e09456bfa7d5 100644 --- a/tools/testing/selftests/powerpc/tm/Makefile +++ b/tools/testing/selftests/powerpc/tm/Makefile @@ -15,7 +15,7 @@ $(TEST_GEN_PROGS): ../harness.c ../utils.c CFLAGS += -mhtm $(OUTPUT)/tm-syscall: tm-syscall-asm.S -$(OUTPUT)/tm-syscall: CFLAGS += -I../../../../../usr/include +$(OUTPUT)/tm-syscall: CFLAGS += -I../../../../include $(OUTPUT)/tm-tmspr: CFLAGS += -pthread $(OUTPUT)/tm-vmx-unavail: CFLAGS += -pthread -m64 $(OUTPUT)/tm-resched-dscr: ../pmu/lib.c diff --git a/tools/testing/selftests/ptp/Makefile b/tools/testing/selftests/ptp/Makefile index ef06de0898b7..159ad7813e08 100644 --- a/tools/testing/selftests/ptp/Makefile +++ b/tools/testing/selftests/ptp/Makefile @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -I../../../../usr/include/ +CFLAGS += -I../../../include/ TEST_PROGS := testptp LDLIBS += -lrt all: $(TEST_PROGS) diff --git a/tools/testing/selftests/rseq/Makefile b/tools/testing/selftests/rseq/Makefile index c30c52e1d0d2..6a693e2fb31f 100644 --- a/tools/testing/selftests/rseq/Makefile +++ b/tools/testing/selftests/rseq/Makefile @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0+ OR MIT -CFLAGS += -O2 -Wall -g -I./ -I../../../../usr/include/ -L./ -Wl,-rpath=./ +CFLAGS += -O2 -Wall -g -I./ -I../../../include/ -L./ -Wl,-rpath=./ LDLIBS += -lpthread # Own dependencies because we only want to build against 1st prerequisite, but diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile index 1760b3e39730..a489bc59c3e2 100644 --- a/tools/testing/selftests/seccomp/Makefile +++ b/tools/testing/selftests/seccomp/Makefile @@ -1,17 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 -all: - -include ../lib.mk - -.PHONY: all clean - -BINARIES := seccomp_bpf seccomp_benchmark +TEST_GEN_PROGS := seccomp_bpf seccomp_benchmark CFLAGS += -Wl,-no-as-needed -Wall -seccomp_bpf: seccomp_bpf.c ../kselftest_harness.h +$(OUTPUT)/seccomp_bpf: seccomp_bpf.c ../kselftest_harness.h $(CC) $(CFLAGS) $(LDFLAGS) $< -lpthread -o $@ -TEST_PROGS += $(BINARIES) -EXTRA_CLEAN := $(BINARIES) - -all: $(BINARIES) +include ../lib.mk diff --git a/tools/testing/selftests/sync/Makefile b/tools/testing/selftests/sync/Makefile index d0121a8a3523..9eaccaf6fcf0 100644 --- a/tools/testing/selftests/sync/Makefile +++ b/tools/testing/selftests/sync/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS += -O2 -g -std=gnu89 -pthread -Wall -Wextra -CFLAGS += -I../../../../usr/include/ +CFLAGS += -I../../../include/ LDFLAGS += -pthread .PHONY: all clean diff --git a/tools/testing/selftests/tc-testing/bpf/Makefile b/tools/testing/selftests/tc-testing/bpf/Makefile index be5a5e542804..dc92eb271d9a 100644 --- a/tools/testing/selftests/tc-testing/bpf/Makefile +++ b/tools/testing/selftests/tc-testing/bpf/Makefile @@ -4,7 +4,6 @@ APIDIR := ../../../../include/uapi TEST_GEN_FILES = action.o top_srcdir = ../../../../.. -KSFT_KHDR_INSTALL := 1 include ../../lib.mk CLANG ?= clang diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index e13eb6cc8901..aac447fa09f9 100644 --- a/tools/testing/selftests/vm/Makefile +++ b/tools/testing/selftests/vm/Makefile @@ -5,7 +5,7 @@ ifndef OUTPUT OUTPUT := $(shell pwd) endif -CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS) +CFLAGS = -Wall -I ../../../include $(EXTRA_CFLAGS) LDLIBS = -lrt TEST_GEN_FILES = compaction_test TEST_GEN_FILES += gup_benchmark @@ -25,7 +25,6 @@ TEST_GEN_FILES += virtual_address_range TEST_PROGS := run_vmtests -KSFT_KHDR_INSTALL := 1 include ../lib.mk $(OUTPUT)/userfaultfd: LDLIBS += -lpthread diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile index 186520198de7..722e798a52d5 100644 --- a/tools/testing/selftests/x86/Makefile +++ b/tools/testing/selftests/x86/Makefile @@ -32,7 +32,8 @@ BINARIES_64 := $(TARGETS_C_64BIT_ALL:%=%_64) BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32)) BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64)) -CFLAGS := -O2 -g -std=gnu99 -pthread -Wall +CFLAGS := -O2 -g -std=gnu99 -pthread -Wall -I../../../include +CFLAGS += -I../../../arch/x86/include/uapi -I../../../arch/x86/include # call32_from_64 in thunks.S uses absolute addresses. ifeq ($(CAN_BUILD_WITH_NOPIE),1) |