diff options
author | Mattias Andrée <maandree@kth.se> | 2021-08-13 16:57:18 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-08-13 16:57:18 +0200 |
commit | 513ee4f15567048b619848edb092cdc4f33fe1c0 (patch) | |
tree | 46a58fa34f1bd5307e4e4267f53c8db1f62acfde /Makefile | |
download | libparsepsf-513ee4f15567048b619848edb092cdc4f33fe1c0.tar.gz libparsepsf-513ee4f15567048b619848edb092cdc4f33fe1c0.tar.bz2 libparsepsf-513ee4f15567048b619848edb092cdc4f33fe1c0.tar.xz |
First commit1.0
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 45 |
1 files changed, 45 insertions, 0 deletions
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 |