Add header dependencies to Makefiles
This commit is contained in:
parent
f245d0e280
commit
c869ab6f85
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
/**/*.o
|
||||
/**/*.d
|
||||
/**/*.a
|
||||
/**/*.bin
|
||||
/**/*.bin.gz
|
||||
|
@ -10,14 +10,15 @@ INTERNAL_CFLAGS = \
|
||||
-fno-stack-protector \
|
||||
-fno-pic \
|
||||
-fomit-frame-pointer \
|
||||
-Wno-address-of-packed-member \
|
||||
-masm=intel \
|
||||
-mno-80387 \
|
||||
-mno-mmx \
|
||||
-mno-3dnow \
|
||||
-mno-sse \
|
||||
-mno-sse2 \
|
||||
-I. \
|
||||
-Wno-address-of-packed-member
|
||||
-MMD \
|
||||
-I.
|
||||
|
||||
LDFLAGS = -flto -Os
|
||||
|
||||
@ -34,6 +35,7 @@ INTERNAL_LDFLAGS = \
|
||||
C_FILES := $(shell find ./ -type f -name '*.c' | sort)
|
||||
ASM_FILES := $(shell find ./ -type f -name '*.asm' | sort)
|
||||
OBJ := $(ASM_FILES:.asm=.o) $(C_FILES:.c=.o)
|
||||
HEADER_DEPS := $(C_FILES:.c=.d)
|
||||
|
||||
all: decompressor.bin
|
||||
|
||||
@ -41,6 +43,8 @@ decompressor.bin: $(OBJ)
|
||||
$(LD) $(OBJ) $(LDFLAGS) $(INTERNAL_LDFLAGS) -o decompressor.elf
|
||||
$(OBJCOPY) -O binary decompressor.elf decompressor.bin
|
||||
|
||||
-include $(HEADER_DEPS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) $(INTERNAL_CFLAGS) -c $< -o $@
|
||||
|
||||
|
@ -11,15 +11,16 @@ INTERNAL_CFLAGS = \
|
||||
-fno-stack-protector \
|
||||
-fno-pic \
|
||||
-fomit-frame-pointer \
|
||||
-Wno-address-of-packed-member \
|
||||
-masm=intel \
|
||||
-mno-80387 \
|
||||
-mno-mmx \
|
||||
-mno-3dnow \
|
||||
-mno-sse \
|
||||
-mno-sse2 \
|
||||
-MMD \
|
||||
-I. \
|
||||
-I.. \
|
||||
-Wno-address-of-packed-member
|
||||
-I..
|
||||
|
||||
LDFLAGS = -flto -Os
|
||||
|
||||
@ -36,13 +37,16 @@ INTERNAL_LDFLAGS = \
|
||||
C_FILES := $(shell find ./ -type f -name '*.c' | sort)
|
||||
ASM_FILES := $(shell find ./ -type f -name '*.asm' | sort)
|
||||
OBJ := $(ASM_FILES:.asm=.o) $(C_FILES:.c=.o)
|
||||
HEADER_DEPS := $(C_FILES:.c=.d)
|
||||
|
||||
all: limine.bin
|
||||
all: stage2.bin
|
||||
|
||||
limine.bin: $(OBJ)
|
||||
stage2.bin: $(OBJ)
|
||||
$(LD) $(OBJ) $(LDFLAGS) $(INTERNAL_LDFLAGS) -o stage2.elf
|
||||
$(OBJCOPY) -O binary stage2.elf stage2.bin
|
||||
|
||||
-include $(HEADER_DEPS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) $(INTERNAL_CFLAGS) -c $< -o $@
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user