aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-04-08 17:45:01 +0200
committerMattias Andrée <maandree@kth.se>2021-04-08 17:45:01 +0200
commit2adf7222ce021748b0edc4a9c5a32375a5b0d124 (patch)
treeb3f0b683a23e969a744fcfdf43352c6498985f69 /Makefile
parentAdd readme (diff)
downloadlibcontacts-2adf7222ce021748b0edc4a9c5a32375a5b0d124.tar.gz
libcontacts-2adf7222ce021748b0edc4a9c5a32375a5b0d124.tar.bz2
libcontacts-2adf7222ce021748b0edc4a9c5a32375a5b0d124.tar.xz
Add test for libcontacts_get_path
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 12 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 72f191b..4a543c8 100644
--- a/Makefile
+++ b/Makefile
@@ -43,8 +43,9 @@ HDR =\
LOBJ = $(OBJ:.o=.lo)
-all: libcontacts.a libcontacts.$(LIBEXT)
+all: libcontacts.a libcontacts.$(LIBEXT) test
$(OBJ): $($@:.o=.c) $(HDR)
+test.o: test.c $(HDR)
libcontacts.a: $(OBJ)
-rm -f -- $@
@@ -60,6 +61,14 @@ libcontacts.$(LIBEXT): $(LOBJ)
.c.lo:
$(CC) -fPIC -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
+test: test.o libcontacts.a
+ $(CC) -o $@ test.o libcontacts.a $(LDFLAGS)
+
+check: test
+ @rm -rf -- .testdir
+ ./test
+ @rm -rf -- .testdir
+
install: libcontacts.a libcontacts.$(LIBEXT)
mkdir -p -- "$(DESTDIR)$(PREFIX)/lib"
mkdir -p -- "$(DESTDIR)$(PREFIX)/include"
@@ -77,9 +86,9 @@ uninstall:
-rm -f -- "$(DESTDIR)$(PREFIX)/include/libcontacts.h"
clean:
- -rm -f -- *.o *.a *.lo *.so *.dylib *.dll *.su
+ -rm -rf -- *.o *.a *.lo *.so *.dylib *.dll *.su test .testdir
.SUFFIXES:
.SUFFIXES: .c .o .lo
-.PHONY: all install uninstall clean
+.PHONY: all check install uninstall clean