summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f1305e1
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,27 @@
+BOOT_DIR := loader
+BOOT_FILE := $(BOOT_DIR)/loader.efi
+
+CORE_DIR := kc/core
+CORE_FILE := $(CORE_DIR)/kernel.os
+
+TARGETS := $(BOOT_FILE) $(CORE_FILE)
+DIRS := $(BOOT_DIR) $(CORE_DIR)
+
+DIRS_CLEAN := $(addprefix clean-,$(DIRS))
+DIRS_DISTCLEAN := $(addprefix dist,$(DIRS_CLEAN))
+
+all: $(TARGETS)
+clean: $(DIRS_CLEAN)
+distclean: $(DIRS_DISTCLEAN)
+
+$(DIRS_CLEAN): clean-%:
+ $(MAKE) -C $* clean
+
+$(DIRS_DISTCLEAN): distclean-%:
+ $(MAKE) -C $* distclean
+
+$(TARGETS):
+ $(MAKE) -C $(dir $@)
+
+.PHONY: all clean distclean $(TARGETS) $(DIRS) $(DIRS_CLEAN) $(DIRS_DISTCLEAN)
+