From 2adf7222ce021748b0edc4a9c5a32375a5b0d124 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 8 Apr 2021 17:45:01 +0200 Subject: Add test for libcontacts_get_path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'Makefile') 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 -- cgit v1.2.3-70-g09d2