From 8aefba73e9f29ec7de90b13429518f9236c70072 Mon Sep 17 00:00:00 2001 From: Matthew Brush Date: Wed, 13 Aug 2025 18:38:33 -0700 Subject: [PATCH] Fix Make dependencies to support parallel builds (-j) On my computer (-j12) the build time is reduced from around 9.5 seconds to around 4 seconds. Use like: `make -j$(nproc) run` --- Makefile | 4 ++-- user/Makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index be11cc62..2da23305 100644 --- a/Makefile +++ b/Makefile @@ -18,10 +18,10 @@ all: shared kernel user shared: $(MAKE) -C shared -user: prepare-fs +user: shared prepare-fs $(MAKE) -C user -kernel: +kernel: shared $(MAKE) -C kernel LOAD_ADDR=$(LOAD_ADDR) XHCI_CTX_SIZE=$(XHCI_CTX_SIZE) QEMU=$(QEMU) clean: diff --git a/user/Makefile b/user/Makefile index 90e3b3de..5546d5ce 100644 --- a/user/Makefile +++ b/user/Makefile @@ -26,7 +26,7 @@ all: prepare $(LOCATION)$(TARGET) prepare: mkdir -p $(BUILD_DIR) -$(LOCATION)$(TARGET): $(OBJ) +$(LOCATION)$(TARGET): ../shared/libshared.a $(OBJ) echo $(LDFLAGS) -o $(LOCATION)$(ELF) $(addprefix $(BUILD_DIR)/,$(notdir $(OBJ))) ../shared/libshared.a $(VLD) $(LDFLAGS) -o $(LOCATION)$(ELF) $(addprefix $(BUILD_DIR)/,$(notdir $(OBJ))) ../shared/libshared.a $(OBJCOPY) -O binary $(LOCATION)$(ELF) $@