aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/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