include config.mk CDIRS := boot device initrd klib memory task syscall CDIRS += memory/alloc CDIRS += boot/$(TARGET_BOOTLOADER) CDIRS += arch/$(TARGET_MACHINE) CFILES := $(wildcard *.c) CFILES += $(foreach dir, $(CDIRS), $(wildcard $(dir)/*.c)) SFILES := $(wildcard *.S) SFILES += $(foreach dir, $(CDIRS), $(wildcard $(dir)/*.S)) OBJFILES := $(patsubst %.c,%.o,$(CFILES)) OBJFILES += $(patsubst %.S,%.o,$(SFILES)) BIN := jove.elf all: $(BIN) .PHONY: clean clean: rm $(OBJFILES) rm $(DFILES) rm $(BIN) $(BIN): ${OBJFILES} $(LD) $(LDFLAGS) ${OBJFILES} -o $(BIN) %.o:%.c $(CC) $(CFLAGS) -c $< -o $@ %.o:%.S $(AS) -g -c $< -o $@