Newer
Older
honey-os / src / userland / vga / Makefile
  1. CC = i686-elf-gcc
  2. CCFLAGS = -m32 -mtune=generic -ffreestanding -nostdlib -c -I ../../include -I include -Wno-discarded-qualifiers -fms-extensions -Wno-shift-count-overflow -O0
  3. LD = i686-elf-ld
  4. LD_FLAGS = -z max-page-size=0x1000 -T ../link.ld
  5. AS = nasm
  6. ASFlAGS = -felf32
  7.  
  8. BUILD_FOLDER = build
  9.  
  10. SOURCE_FILES := $(shell find . -name '*.c' -or -name '*.asm' -or -name '*.s')
  11. OBJS := $(SOURCE_FILES:%=$(BUILD_FOLDER)/%.o)
  12.  
  13. ../../../initrd/vga: $(OBJS) ../../../build/hlib.o
  14. @echo "linking user program vga driver"
  15. @$(LD) $(LD_FLAGS) -o $@ $(OBJS)
  16.  
  17. $(BUILD_FOLDER)/%.asm.o: %.asm
  18. @echo "asembling $<"
  19. @mkdir -p $(dir $@)
  20. @$(AS) $(ASFlAGS) $< -o $@
  21.  
  22. $(BUILD_FOLDER)/%.c.o: %.c
  23. @echo "compiling $<"
  24. @mkdir -p $(dir $@)
  25. @$(CC) $(CCFLAGS) -r $< -o $@
  26.  
  27. clean:
  28. @echo "clearing build folder"
  29. @rm -r $(BUILD_FOLDER)