aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-08-13 16:57:18 +0200
committerMattias Andrée <maandree@kth.se>2021-08-13 16:57:18 +0200
commit513ee4f15567048b619848edb092cdc4f33fe1c0 (patch)
tree46a58fa34f1bd5307e4e4267f53c8db1f62acfde /Makefile
downloadlibparsepsf-3b0fd7d0fbfd3eb7037e09b9b664d3a4ae4a74fe.tar.gz
libparsepsf-3b0fd7d0fbfd3eb7037e09b9b664d3a4ae4a74fe.tar.bz2
libparsepsf-3b0fd7d0fbfd3eb7037e09b9b664d3a4ae4a74fe.tar.xz
First commit1.0
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile45
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