summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2024-03-11 21:30:31 -0400
committerJon Santmyer <jon@jonsantmyer.com>2024-03-11 21:30:31 -0400
commitd1ff7bcc91886626dc9060ec5fb67ee102ab7c1d (patch)
tree8f0b5cd8aad31089131785dc6e37b659490f9955 /Makefile
downloadjove-kernel-d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d.tar.gz
jove-kernel-d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d.tar.bz2
jove-kernel-d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d.zip
usermode capable kernel with logging syscall
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile39
1 files changed, 39 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..6697fc6
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,39 @@
+include config.mk
+
+CFILES := $(wildcard *.c)
+CFILES += $(wildcard */*.c)
+CFILES += $(wildcard boot/$(TARGET_BOOTLOADER)/*.c)
+CFILES += $(wildcard arch/$(TARGET_MACHINE)/*.c)
+CFILES += $(wildcard arch/$(TARGET_MACHINE)/*/*.c)
+
+SFILES := $(wildcard *.S)
+SFILES += $(wildcard */*.S)
+SFILES += $(wildcard arch/$(TARGET_MACHINE)/*.S)
+SFILES += $(wildcard arch/$(TARGET_MACHINE)/*/*.S)
+
+OBJFILES := $(patsubst %.c,%.o,$(CFILES))
+OBJFILES += $(patsubst %.S,%.o,$(SFILES))
+
+DFILES := $(wildcard *.d)
+DFILES += $(wildcard */*.d)
+DFILES += $(wildcard arch/$(TARGET_MACHINE)/*.d)
+DFILES += $(wildcard arch/$(TARGET_MACHINE)/*/*.d)
+
+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 $@