From 513ee4f15567048b619848edb092cdc4f33fe1c0 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 13 Aug 2021 16:57:18 +0200 Subject: First commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..61b281b --- /dev/null +++ b/Makefile @@ -0,0 +1,45 @@ +.POSIX: + +CONFIGFILE = config.mk +include $(CONFIGFILE) + +OBJ =\ + libparsepsf.o + +LIB_HDR =\ + libparsepsf.h + +HDR =\ + $(LIB_HDR) + +all: libparsepsf.a demo +$(OBJ): $(@:.o=.c) $(HDR) +libparsepsf.o: libparsepsf.c $(LIB_HDR) + +libparsepsf.a: $(OBJ) + $(AR) rc $@ $(OBJ) + $(AR) ts $@ > /dev/null + +.c.o: + $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS) + +demo: demo.o libparsepsf.a + $(CC) -o $@ $@.o libparsepsf.a $(LDFLAGS) + +install: libparsepsf.a + mkdir -p -- "$(DESTDIR)$(PREFIX)/lib" + mkdir -p -- "$(DESTDIR)$(PREFIX)/include" + cp -- libparsepsf.a "$(DESTDIR)$(PREFIX)/lib" + cp -- libparsepsf.h "$(DESTDIR)$(PREFIX)/include" + +uninstall: + -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libparsepsf.a" + -rm -f -- "$(DESTDIR)$(PREFIX)/include/libparsepsf.h" + +clean: + -rm -f -- *.o *.lo *.su *.a *.so *.so.* demo + +.SUFFIXES: +.SUFFIXES: .c .o + +.PHONY: all install uninstall clean -- cgit v1.2.3-70-g09d2