feat: wrapper function for bootstraping user program
[lunaix-os.git] / lunaix-os / makefile.prog
diff --git a/lunaix-os/makefile.prog b/lunaix-os/makefile.prog
new file mode 100644 (file)
index 0000000..1c09c78
--- /dev/null
@@ -0,0 +1,12 @@
+include config/make-locations
+include config/make-os
+include config/make-cc
+
+SRC_FILES := $(wildcard uprog/*.c)
+PROGRAMES := $(patsubst uprog/%.c, $(USR_DIR)/%, $(SRC_FILES))
+
+$(USR_DIR)/%:
+       @echo "  BUILD   $(*F)"
+       @$(CC) -T usr/link-usr.ld $(INCLUDES) $(CFLAGS) $(LDFLAGS) uprog/$(*F).c $(BIN_DIR)/$(USR_LIB) -o $@
+
+all: $(PROGRAMES)
\ No newline at end of file