From d705e71f90bc4874fb13e4496a2ebd6968d38a79 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Fri, 1 Sep 2017 20:33:00 +0200 Subject: Switches to Makefiles. --- src/Makefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/Makefile (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..1cd5199 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,21 @@ +SRC_FILES = $(wildcard ./*.c) +OBJ_FILES = $(SRC_FILES:.c=.o) +DEP_FILES = $(SRC_FILES:.c=.d) + +build: export.a + +export.a: $(OBJ_FILES) + ar cr $@ $^ + +clean: + rm -f $(OBJ_FILES) + rm -f $(DEP_FILES) + rm -f export.a + +%.d: %.c + @set -e; rm -f $@; \ + $(CC) -M $(CPPFLAGS) $< > $@.$$$$; \ + sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ + rm -f $@.$$$$ + +include $(DEP_FILES) -- cgit v1.2.3-70-g09d2