Debian Codegraph @

arch/riscv/kernel/vdso_cfi/Makefile

raw
1 # SPDX-License-Identifier: GPL-2.0-only
2 # RISC-V VDSO CFI Makefile
3 # This Makefile builds the VDSO with CFI support when CONFIG_RISCV_USER_CFI is enabled
4
5 # setting VDSO_CFI_BUILD triggers build for vdso differently
6 VDSO_CFI_BUILD := 1
7
8 # Set the source directory to the main vdso directory
9 src := $(srctree)/arch/riscv/kernel/vdso
10
11 # Copy all .S and .c files from vdso directory to vdso_cfi object build directory
12 vdso_c_sources := $(wildcard $(src)/*.c)
13 vdso_S_sources := $(wildcard $(src)/*.S)
14 vdso_c_objects := $(addprefix $(obj)/, $(notdir $(vdso_c_sources)))
15 vdso_S_objects := $(addprefix $(obj)/, $(notdir $(vdso_S_sources)))
16
17 $(vdso_S_objects): $(obj)/%.S: $(src)/%.S
18 $(Q)cp $< $@
19
20 $(vdso_c_objects): $(obj)/%.c: $(src)/%.c
21 $(Q)cp $< $@
22
23 # Include the main VDSO Makefile which contains all the build rules and sources
24 # The VDSO_CFI_BUILD variable will be passed to it to enable CFI compilation
25 include $(src)/Makefile