1# SPDX-License-Identifier: GPL-2.0
2obj-y := core.o
3ifneq ($(CONFIG_BPF_JIT_ALWAYS_ON),y)
4# ___bpf_prog_run() needs GCSE disabled on x86; see 3193c0836f203 for details
5cflags-nogcse-$(CONFIG_X86)$(CONFIG_CC_IS_GCC) := -fno-gcse
6endif
7CFLAGS_core.o += $(call cc-disable-warning, override-init) $(cflags-nogcse-yy)
8
9obj-$(CONFIG_BPF_SYSCALL) += syscall.o verifier.o inode.o helpers.o tnum.o bpf_iter.o map_iter.o task_iter.o prog_iter.o link_iter.o
10obj-$(CONFIG_BPF_SYSCALL) += hashtab.o arraymap.o percpu_freelist.o bpf_lru_list.o lpm_trie.o map_in_map.o bloom_filter.o
11obj-$(CONFIG_BPF_SYSCALL) += local_storage.o queue_stack_maps.o ringbuf.o
12obj-$(CONFIG_BPF_SYSCALL) += bpf_local_storage.o bpf_task_storage.o
13obj-${CONFIG_BPF_LSM}	  += bpf_inode_storage.o
14obj-$(CONFIG_BPF_SYSCALL) += disasm.o
15obj-$(CONFIG_BPF_JIT) += trampoline.o
16obj-$(CONFIG_BPF_SYSCALL) += btf.o memalloc.o
17obj-$(CONFIG_BPF_JIT) += dispatcher.o
18ifeq ($(CONFIG_NET),y)
19obj-$(CONFIG_BPF_SYSCALL) += devmap.o
20obj-$(CONFIG_BPF_SYSCALL) += cpumap.o
21obj-$(CONFIG_BPF_SYSCALL) += offload.o
22obj-$(CONFIG_BPF_SYSCALL) += net_namespace.o
23endif
24ifeq ($(CONFIG_PERF_EVENTS),y)
25obj-$(CONFIG_BPF_SYSCALL) += stackmap.o
26endif
27ifeq ($(CONFIG_CGROUPS),y)
28obj-$(CONFIG_BPF_SYSCALL) += cgroup_iter.o bpf_cgrp_storage.o
29endif
30obj-$(CONFIG_CGROUP_BPF) += cgroup.o
31ifeq ($(CONFIG_INET),y)
32obj-$(CONFIG_BPF_SYSCALL) += reuseport_array.o
33endif
34ifeq ($(CONFIG_SYSFS),y)
35obj-$(CONFIG_DEBUG_INFO_BTF) += sysfs_btf.o
36endif
37ifeq ($(CONFIG_BPF_JIT),y)
38obj-$(CONFIG_BPF_SYSCALL) += bpf_struct_ops.o
39obj-$(CONFIG_BPF_SYSCALL) += cpumask.o
40obj-${CONFIG_BPF_LSM} += bpf_lsm.o
41endif
42obj-$(CONFIG_BPF_PRELOAD) += preload/
43
44obj-$(CONFIG_BPF_SYSCALL) += relo_core.o
45$(obj)/relo_core.o: $(srctree)/tools/lib/bpf/relo_core.c FORCE
46	$(call if_changed_rule,cc_o_c)
47