EXEC := bringelle CC := gcc -c -m32 -fno-pie -fno-builtin -fno-stack-protector LD_SCRIPT := linker.ld # Note that BOOT_OBJ do not match boot.S # Indeed boot.o generated by boot.S should appear # first in the kernel binary (thus it must be linked first, cf the $(EXEC) rule) BOOT_OBJ := $(addsuffix .o,$(basename $(shell find ./boot -name "*.[c|S]" ! -name "boot.S"))) UTILS_OBJ := $(addsuffix .o,$(basename $(shell find ./utils -name "*.[c|S]"))) all: $(EXEC) $(EXEC): boot/boot.o $(UTILS_OBJ) bringelle.o ld -n -T $(LD_SCRIPT) -nostdlib -o bringelle $^ %.o: %.S as --32 -o $@ $^ -mx86-used-note=no %.o: %.c $(CC) -o $@ $< #objcopy --remove-section .note.gnu.property $@ clean: rm -f $(EXEC) find ./ -name "*.o" -delete .PHONY: clean cdrom