16 lines
415 B
Makefile
16 lines
415 B
Makefile
include ../../kernel.settings
|
|
CC=$(PREFIX)gcc
|
|
LD=$(PREFIX)ld
|
|
SRCS = $(shell find . -name '*.[cS]')
|
|
OBJS = $(addsuffix .o,$(basename $(SRCS)))
|
|
ASFLAGS +=
|
|
CFLAGS += -fno-stack-protector -nostdinc -ffreestanding -std=c11 -fno-builtin -w -Werror -nostdlib -fpie
|
|
LDFLAGS = -T loader.ld
|
|
all: $(OBJS)
|
|
$(LD) $(LDFLAGS) -o loader.bin $(OBJS)
|
|
|
|
%.o: %.c
|
|
$(CC) $(CFLAGS) -c -o $@ $^
|
|
|
|
%.o: %.S
|
|
$(CC) $(ASFLAGS) -c -o $@ $^
|