Makefile (912c0a85911a6364ac127b6e1de8c2c7782db1bc) Makefile (c78fd76f2b673d1fb5306612c87df812c0a9ad0c)
1# SPDX-License-Identifier: GPL-2.0
2TARGETS = android
3TARGETS += bpf
4TARGETS += breakpoints
5TARGETS += capabilities
6TARGETS += cgroup
7TARGETS += cpufreq
8TARGETS += cpu-hotplug

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

81# Append kselftest to KBUILD_OUTPUT to avoid cluttering
82# KBUILD_OUTPUT with selftest objects and headers installed
83# by selftests Makefile or lib.mk.
84ifdef building_out_of_srctree
85override LDFLAGS =
86endif
87
88ifneq ($(O),)
1# SPDX-License-Identifier: GPL-2.0
2TARGETS = android
3TARGETS += bpf
4TARGETS += breakpoints
5TARGETS += capabilities
6TARGETS += cgroup
7TARGETS += cpufreq
8TARGETS += cpu-hotplug

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

81# Append kselftest to KBUILD_OUTPUT to avoid cluttering
82# KBUILD_OUTPUT with selftest objects and headers installed
83# by selftests Makefile or lib.mk.
84ifdef building_out_of_srctree
85override LDFLAGS =
86endif
87
88ifneq ($(O),)
89 BUILD := $(O)
89 BUILD := $(abs_objtree)
90else
91 ifneq ($(KBUILD_OUTPUT),)
90else
91 ifneq ($(KBUILD_OUTPUT),)
92 BUILD := $(KBUILD_OUTPUT)/kselftest
92 BUILD := $(abs_objtree)/kselftest
93 else
94 BUILD := $(shell pwd)
95 DEFAULT_INSTALL_HDR_PATH := 1
96 endif
97endif
98
99# Prepare for headers install
100top_srcdir ?= ../../..
101include $(top_srcdir)/scripts/subarch.include
102ARCH ?= $(SUBARCH)
103export KSFT_KHDR_INSTALL_DONE := 1
104export BUILD
93 else
94 BUILD := $(shell pwd)
95 DEFAULT_INSTALL_HDR_PATH := 1
96 endif
97endif
98
99# Prepare for headers install
100top_srcdir ?= ../../..
101include $(top_srcdir)/scripts/subarch.include
102ARCH ?= $(SUBARCH)
103export KSFT_KHDR_INSTALL_DONE := 1
104export BUILD
105#$(info abd_objtree = $(abs_objtree) BUILD = $(BUILD))
105
106# build and run gpio when output directory is the src dir.
107# gpio has dependency on tools/gpio and builds tools/gpio
108# objects in the src directory in all cases making the src
109# repo dirty even when objects are relocated.
110ifneq (1,$(DEFAULT_INSTALL_HDR_PATH))
111 TMP := $(filter-out gpio, $(TARGETS))
112 TARGETS := $(TMP)

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

185# Avoid changing the rest of the logic here and lib.mk.
186INSTALL_PATH := $(KSFT_INSTALL_PATH)
187ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh
188
189install: all
190ifdef INSTALL_PATH
191 @# Ask all targets to install their files
192 mkdir -p $(INSTALL_PATH)/kselftest
106
107# build and run gpio when output directory is the src dir.
108# gpio has dependency on tools/gpio and builds tools/gpio
109# objects in the src directory in all cases making the src
110# repo dirty even when objects are relocated.
111ifneq (1,$(DEFAULT_INSTALL_HDR_PATH))
112 TMP := $(filter-out gpio, $(TARGETS))
113 TARGETS := $(TMP)

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

186# Avoid changing the rest of the logic here and lib.mk.
187INSTALL_PATH := $(KSFT_INSTALL_PATH)
188ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh
189
190install: all
191ifdef INSTALL_PATH
192 @# Ask all targets to install their files
193 mkdir -p $(INSTALL_PATH)/kselftest
194 install -m 744 kselftest/module.sh $(INSTALL_PATH)/kselftest/
193 install -m 744 kselftest/runner.sh $(INSTALL_PATH)/kselftest/
194 install -m 744 kselftest/prefix.pl $(INSTALL_PATH)/kselftest/
195 @for TARGET in $(TARGETS); do \
196 BUILD_TARGET=$$BUILD/$$TARGET; \
197 $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
198 done;
199
200 @# Ask all targets to emit their test scripts

--- 37 unchanged lines hidden ---
195 install -m 744 kselftest/runner.sh $(INSTALL_PATH)/kselftest/
196 install -m 744 kselftest/prefix.pl $(INSTALL_PATH)/kselftest/
197 @for TARGET in $(TARGETS); do \
198 BUILD_TARGET=$$BUILD/$$TARGET; \
199 $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
200 done;
201
202 @# Ask all targets to emit their test scripts

--- 37 unchanged lines hidden ---