aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2021-04-06 08:26:01 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2021-04-06 08:26:01 +0200
commit3df156a9be38b2c9a1b34cbe5f7528af7edf9f09 (patch)
treeb813908041a6166e829713d31d9d1333986ff4ec
parentfcdc14f939a25189988e21f53dc24d5aed560504 (diff)
Update Makefile
-rw-r--r--src/Makefile11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Makefile b/src/Makefile
index 08b31d7..4fa31a1 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,14 +1,15 @@
EXEC := bringelle
CC := gcc -c -m32 -fno-pie -fno-builtin -fno-stack-protector
-UTILS_OBJ := $(addsuffix .o,$(basename $(wildcard utils/*.c)))
+BOOT_OBJ := $(addsuffix .o,$(basename $(shell find ./boot -name "*.[c|S]")))
+UTILS_OBJ := $(addsuffix .o,$(basename $(shell find ./utils -name "*.[c|S]")))
all: $(EXEC)
-$(EXEC): boot/boot.o $(UTILS_OBJ) bringelle.o
+$(EXEC): $(BOOT_OBJ) $(UTILS_OBJ) bringelle.o
ld -Ttext=0x00100000 -melf_i386 -nostdlib --oformat=binary -o bringelle $^
-boot/boot.o: ./boot/boot.S
+%.o: %.S
as --32 -o $@ $^ -mx86-used-note=no
%.o: %.c
@@ -16,8 +17,8 @@ boot/boot.o: ./boot/boot.S
objcopy --remove-section .note.gnu.property $@
clean:
- - rm $(EXEC)
- - find ./ -name "*.o" -delete
+ rm -f $(EXEC)
+ find ./ -name "*.o" -delete
.PHONY: clean