From e7f69c8fbbbcbddde84933b2becd91e787d1ac63 Mon Sep 17 00:00:00 2001 From: Johnny Richard Date: Fri, 11 Apr 2025 01:15:01 +0200 Subject: Intial commit Signed-off-by: Johnny Richard --- Makefile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1f49002 --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ +SHELL := /bin/sh +CC := c99 +CFLAGS := -g -Werror -Wall -pedantic +SRCDIR := ./src +SRCS := $(shell find . -name '*.c') +OBJS := $(SRCS:.c=.o) +DEPS := $(OBJS:.o=.d) +TARGET := sm + +.POSIX: +.PHONY: all clean + +all: $(TARGET) + +%.d: %.c + @$(CC) -MM $(CPPFLAGS) $< > $@ + +%.o: %.c %.d + @$(CC) $(CFLAGS) -c -o $@ $< + @printf 'CC\t%s\n' '$@' + +-include $(DEPS) + +$(TARGET): $(OBJS) + @$(CC) $(CFLAGS) $(OBJS) -o $@ + @printf 'CCLD\t%s\n' '$@' + +clean: + $(RM) $(TARGET) + $(RM) $(OBJS) $(DEPS) -- cgit v1.2.3