# Harakiri agent-native kernel — kbuild Makefile
#
# Supports both:
#   CONFIG_HARAKIRI=m — out-of-tree module (QEMU iteration)
#     make -C <kdir> M=$PWD ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- modules
#   CONFIG_HARAKIRI=y — built into the kernel (phone)
#     copy this directory into the kernel tree (e.g. drivers/harakiri/),
#     add "source drivers/harakiri/Kconfig" to drivers/Kconfig,
#     add "obj-$(CONFIG_HARAKIRI) += harakiri/" to drivers/Makefile,
#     then enable CONFIG_HARAKIRI=y in your defconfig.
#
# kbuild already puts $(KDIR)/include on the path, so <harakiri/...>
# resolves to the headers in include/harakiri/.

obj-$(CONFIG_HARAKIRI) += harakiri.o
harakiri-objs := harakiri_core.o harakiri_sched.o harakiri_proc.o harakiri_sicore.o

# Fallback for out-of-tree module builds without Kconfig:
# if CONFIG_HARAKIRI is unset, build as a module.
ifndef CONFIG_HARAKIRI
obj-m += harakiri.o
endif
