Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PROJDIRS := ./
- CFILES := $(shell find $(PROJDIRS) -type f -name "*.cpp")
- ASMFILES := $(shell find $(PROJDIRS) -type f -name "*.asm")
- COBJFILES := $(patsubst %.c,%.o,$(CFILES))
- ASMOBJFILES := $(patsubst %.asm,%.o,$(ASMFILES))
- CC := clang++ --target=i686-pc-none-elf
- LD := ld
- ASM := nasm
- all: kernel clean copy
- kernel: ${COBJFILES} ${ASMOBJFILES}
- ${LD} -s -Tlink.ld -o kernel ${COBJFILES} ${ASMOBJFILES}
- %.o: %.c
- ${CC} -Wall -std=gnu99 -O2 -I./include -c -o $@ $<
- %.o: %.asm
- ${ASM} -felf32 -o $@ $<
- clean:
- rm ${COBJFILES} ${ASMOBJFILES}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement