From 13ddec78a4aa981be40bbf0e7ad7929d21f4aca6 Mon Sep 17 00:00:00 2001 From: MCorange Date: Sun, 2 Nov 2025 17:35:51 +0200 Subject: [PATCH] Finally figured out how to provide direct path to config Honestly reading the code is the best docs --- .gitignore | 1 + Makefile | 13 +++---------- linux/Makefile | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 .gitignore create mode 100644 linux/Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/build diff --git a/Makefile b/Makefile index 8456799..f75042b 100644 --- a/Makefile +++ b/Makefile @@ -4,19 +4,12 @@ BUILD_DIR ?= $(MAKEFILE_DIR)build ARCH ?= x86 KERNEL_FILE_NAME ?= bzImage +export BUILD_DIR export ARCH export KERNEL_FILE_NAME -KERNEL_PATH = $(BUILD_DIR)/arch/$(ARCH)/boot/$(bzImage) - -all: $(KERNEL_PATH) - - -$(KERNEL_PATH): - @mkdir -p $(BUILD_DIR)/linux/kernel - cp $(MAKEFILE_DIR)/linux/.config $(BUILD_DIR)/linux/kernel/.config - $(MAKE) -C $(MAKEFILE_DIR)/linux/kernel O=$(BUILD_DIR)/linux/kernel - +kernel: + $(MAKE) -C $(MAKEFILE_DIR)/linux clean: diff --git a/linux/Makefile b/linux/Makefile new file mode 100644 index 0000000..0ab0a10 --- /dev/null +++ b/linux/Makefile @@ -0,0 +1,15 @@ +MAKEFILE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) + +BUILD_DIR ?= $(MAKEFILE_DIR)build +ARCH ?= x86 +KERNEL_FILE_NAME ?= bzImage + +KERNEL_PATH = $(BUILD_DIR)/arch/$(ARCH)/boot/$(bzImage) +KERNEL_BUILD_DIR=$(BUILD_DIR)/linux/kernel + +all: $(KERNEL_PATH) + + +$(KERNEL_PATH): + @mkdir -p $(KERNEL_BUILD_DIR) + $(MAKE) -C $(MAKEFILE_DIR)/kernel O=$(KERNEL_BUILD_DIR) KCONFIG_CONFIG="$(MAKEFILE_DIR)/.config"