From 67bc1de939bdfb2072074bc9554dfea9b32f64cd Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 6 Oct 2019 20:36:00 +0200 Subject: Simplify MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4ed58b0 --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +.POSIX: + +CONFIGFILE = config.mk +include $(CONFIGFILE) + +all: libclut.a + +libclut.o: libclut.c libclut.h + $(CC) -c -o $@ libclut.c $(CPPFLAGS) $(CFLAGS) + +libclut.a: libclut.o + $(AR) rc $@ libclut.o + $(AR) s $@ + +test.o: test.c libclut.h + $(CC) -c -o $@ test.c $(CPPFLAGS) $(CFLAGS) + +test: test.o libclut.a + $(CC) -o $@ test.o libclut.a $(LDFLAGS) + +check: test + ./test + +install: libclut.a + mkdir -p -- "$(DESTDIR)$(PREFIX)/lib" + mkdir -p -- "$(DESTDIR)$(PREFIX)/include" + cp -- libclut.a "$(DESTDIR)$(PREFIX)/lib" + cp -- libclut.h "$(DESTDIR)$(PREFIX)/include" + +uninstall: + -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libclut.a" + -rm -f -- "$(DESTDIR)$(PREFIX)/include/libclut.h" + +clean: + -rm -f -- *.o *.a test + +.PHONY: all check install uninstall clean -- cgit v1.2.3-70-g09d2