include $(CONFIG) CFILES := $(wildcard *.c) CFILES += $(wildcard arch/$(TARGET_MACHINE)/*.c) OFILES := $(patsubst %.c,%.o,$(CFILES)) OFILES += $(STATICLIBS) CFLAGS := -ffreestanding -nostdlib -g LDFLAGS := -T arch/$(TARGET_MACHINE)/link.ld OCFLAGS := -O binary \ --set-section-flags .bss=alloc,load,contents all: $(OFILES) $(LD) $(LDFLAGS) ${OFILES} -o init.elf objcopy $(OCFLAGS) init.elf $(OUT)/init clean: -rm ${OFILES} -rm init.elf %.o:%.c $(CC) $(CFLAGS) -c $< -o $@