Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. PROJDIRS := ./
  2. CFILES := $(shell find $(PROJDIRS) -type f -name "*.cpp")
  3. ASMFILES := $(shell find $(PROJDIRS) -type f -name "*.asm")
  4. COBJFILES := $(patsubst %.c,%.o,$(CFILES))
  5. ASMOBJFILES := $(patsubst %.asm,%.o,$(ASMFILES))
  6.  
  7. CC := clang++ --target=i686-pc-none-elf
  8. LD := ld
  9. ASM := nasm
  10.  
  11. all: kernel clean copy
  12.  
  13. kernel: ${COBJFILES} ${ASMOBJFILES}
  14. ${LD} -s -Tlink.ld -o kernel ${COBJFILES} ${ASMOBJFILES}
  15.  
  16. %.o: %.c
  17. ${CC} -Wall -std=gnu99 -O2 -I./include -c -o $@ $<
  18.  
  19. %.o: %.asm
  20. ${ASM} -felf32 -o $@ $<
  21.  
  22. clean:
  23. rm ${COBJFILES} ${ASMOBJFILES}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement