build: add support for building tools targeting host machine

This commit is contained in:
2023-02-07 11:25:33 +00:00
parent 625eac9ca7
commit 2f69bfd4f0
7 changed files with 374 additions and 3 deletions

View File

@@ -45,7 +45,7 @@ LDFLAGS := $(LDFLAGS) -g -Os
ALL_KERNEL_OBJECT_FILES := $(KERNEL_OBJ) $(ARCH_OBJ) $(LIBC_OBJ)
ALL_KERNEL_DEPS := $(ALL_KERNEL_OBJECT_FILES:.o=.d)
all: $(BUILD_DIR)/$(KERNEL_EXEC)
all: $(BUILD_DIR)/$(KERNEL_EXEC) tools
-include $(ALL_KERNEL_DEPS)
@@ -69,7 +69,7 @@ clean:
@rm -rf $(BUILD_DIR)
$(BUILD_DIR)/compile_commands.json:
@$(MAKE) clean
@$(MAKE) --no-print-directory clean
@printf " \033[1;93mGEN\033[0m Generating compiler database.\n"
@@ -77,8 +77,11 @@ $(BUILD_DIR)/compile_commands.json:
compile-db: $(BUILD_DIR)/compile_commands.json
tools:
@$(MAKE) --no-print-directory -C tools
include arch/$(ARCH)/extra.mk
.PHONY: all compile-db
.PHONY: all tools compile-db
.INTERMEDIATE: $(ARCH_TEMP_FILES)