feat: serial device interfacing
[lunaix-os.git] / lunaix-os / usr / cat / makefile
diff --git a/lunaix-os/usr/cat/makefile b/lunaix-os/usr/cat/makefile
new file mode 100644 (file)
index 0000000..33802bd
--- /dev/null
@@ -0,0 +1,21 @@
+define src_files
+       main.c
+endef
+
+obj_files := $(addsuffix .o,$(src_files))
+include_opt := $(addprefix -I,$(INCLUDES))
+
+out := $(BUILD_DIR)/bin
+
+%.c.o: %.c
+       $(call status_,CC,$<)
+       @$(CC) $(CFLAGS) $(include_opt) -c $< -o $@
+
+$(out)/$(BUILD_NAME): $(obj_files)
+       $(call status_,LD,$(@F))
+       @$(CC) -T $(LD_SCRIPT) -o $@ $< $(LIBC) $(LDFLAGS)
+
+all: $(out)/$(BUILD_NAME)
+
+clean:
+       @rm -f $(obj_files)
\ No newline at end of file