aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2019-10-06 20:36:00 +0200
committerMattias Andrée <maandree@kth.se>2019-10-06 20:46:04 +0200
commit67bc1de939bdfb2072074bc9554dfea9b32f64cd (patch)
tree1870ce05873f8ed9cdfa87fafa0d8b3e6223dd8d /Makefile
parentfix cielab to ciexyz conversion (diff)
downloadlibclut-67bc1de939bdfb2072074bc9554dfea9b32f64cd.tar.gz
libclut-67bc1de939bdfb2072074bc9554dfea9b32f64cd.tar.bz2
libclut-67bc1de939bdfb2072074bc9554dfea9b32f64cd.tar.xz
Simplify
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile37
1 files changed, 37 insertions, 0 deletions
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