aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
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