From b905869a35f062a4e5072f10bec3a2ba3db0e365 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Wed, 30 Jul 2025 14:32:01 -0400 Subject: working userland with some invoke syscalls --- Makefile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1d26c59 --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +include $(CONFIG) +include config.mk + +CDIRS := boot +CDIRS += boot/$(TARGET_BOOTLOADER) +CDIRS += device lib syscall + +CFILES := $(wildcard *.c) +CFILES += $(wildcard arch/$(TARGET_MACHINE)/*.c) +CFILES += $(foreach dir, $(CDIRS), $(wildcard $(dir)/*.c)) +CFILES += $(foreach dir, $(CDIRS), $(wildcard arch/$(TARGET_MACHINE)/$(dir)/*.c)) + +SFILES := $(wildcard *.s) +SFILES += $(wildcard arch/$(TARGET_MACHINE)/*.s) +SFILES += $(foreach dir, $(CDIRS), $(wildcard $(dir)/*.s)) +SFILES += $(foreach dir, $(CDIRS), $(wildcard arch/$(TARGET_MACHINE)/$(dir)/*.s)) + +OBJFILES := $(patsubst %.c,%.o,$(CFILES)) +OBJFILES += $(patsubst %.s,%.o,$(SFILES)) + +BIN := jove.elf + +all: $(BIN) + +.PHONY: clean +clean: + rm $(OBJFILES) + rm $(BIN) + +$(BIN): ${OBJFILES} + $(LD) $(LDFLAGS) ${OBJFILES} -o $(BIN) + +%.o:%.c + $(CC) $(CFLAGS) -c $< -o $@ + +%.o:%.S + $(AS) -g -c $< -o $@ -- cgit v1.2.1