From 7e555f1ba2ca26632fda82ff3542e5e415af19cd Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sat, 13 Sep 2025 23:43:16 -0400 Subject: build: Add Makefile to sys/lib/ Signed-off-by: Ian Moffett --- src/sys/lib/Makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/sys/lib/Makefile (limited to 'src/sys/lib/Makefile') diff --git a/src/sys/lib/Makefile b/src/sys/lib/Makefile new file mode 100644 index 0000000..46e4aec --- /dev/null +++ b/src/sys/lib/Makefile @@ -0,0 +1,25 @@ +include ../conf/sys.mk + +.SILENT: +override PROMPT := printf "%s\t\t%s\n" + +TARGET_LIB = ../target/libstring.a +CFLAGS = -I../include/ -I../include/lib/ -I../target/header/ $(MI_CFLAGS) -O0 +CFILES = $(shell find . -name "*.c") + +DEPS = $(CFILES:.c=.d) +OBJECTS = $(CFILES:%.c=%.o) + +.PHONY: all +all: $(OBJECTS) + $(PROMPT) " MI.AR " $< + ar rcs $(TARGET_LIB) $(OBJECTS) + +-include $(DEPS) +%.o: %.c + $(PROMPT) " MI.CC " $< + $(CC) -c $(CFLAGS) $< -o $@ + +.PHONY: clean +clean: + rm -f $(DEPS) $(OBJECTS) -- cgit v1.2.3