setos

拙OS
Log | Files | Refs | LICENSE

Makefile (459B)


      1 CC = gcc
      2 LD = ld
      3 CFLAGS = -I ../../include -nostdlib -fpic -mno-red-zone -Wall -g \
      4 	-ffreestanding -fno-builtin
      5 LDFLAGS = -e kernel_main -static
      6 OBJS = main.o draw.o alloc.o console.o
      7 LIBS = libc
      8 LIBOBJ = ../libc/libc.o
      9 
     10 all: main.elf
     11 
     12 main.elf: $(OBJS) libs memmap.ld
     13 	$(LD) $(LDFLAGS) -T memmap.ld -o $@ $(OBJS) $(LIBOBJ)
     14 
     15 %.o: %.c
     16 	$(CC) $(CFLAGS) -c -o $@ $<
     17 
     18 libs:
     19 	for lib in $(LIBS); do \
     20 		cd ../$$lib && make; \
     21 	done
     22 
     23 clean:
     24 	rm -f $(OBJS) main.elf