build: Resolve some potential dependency race on gnu-efi
diff --git a/stage23/Makefile b/stage23/Makefile
index 1a243c18..c145fa55 100644
--- a/stage23/Makefile
+++ b/stage23/Makefile
@@ -296,8 +296,20 @@ endif
-include $(HEADER_DEPS)
+ifeq ($(TARGET), uefi)
+$(BUILDDIR)/%.o: %.c $(BUILDDIR)/gnu-efi
+ $(TOOLCHAIN_CC) $(CFLAGS) $(INTERNAL_CFLAGS) -c $< -o $@
+endif
+
+ifeq ($(TARGET), uefi32)
+$(BUILDDIR)/%.o: %.c $(BUILDDIR)/gnu-efi
+ $(TOOLCHAIN_CC) $(CFLAGS) $(INTERNAL_CFLAGS) -c $< -o $@
+endif
+
+ifeq ($(TARGET), bios)
$(BUILDDIR)/%.o: %.c
$(TOOLCHAIN_CC) $(CFLAGS) $(INTERNAL_CFLAGS) -c $< -o $@
+endif
-include $(HEADER_DEPS)
@@ -309,7 +321,7 @@ endif
-include $(HEADER_DEPS)
ifeq ($(TARGET), uefi)
-$(BUILDDIR)/%.32.o: %.32.c
+$(BUILDDIR)/%.32.o: %.32.c $(BUILDDIR)/gnu-efi
$(TOOLCHAIN_CC) $(CFLAGS) $(INTERNAL_CFLAGS32) -c $< -o $@.32
$(TOOLCHAIN_OBJCOPY) -I elf32-i386 -O elf64-x86-64 $@.32 $@
rm $@.32
