From 024cf2f59a7ee23f46140932b7b617f1f3fc1508 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 25 Mar 2025 21:47:16 +0100 Subject: Add tests and some fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 11ab463..e5926ac 100644 --- a/Makefile +++ b/Makefile @@ -29,12 +29,29 @@ HDR =\ libgeome.h\ common.h +TEST =\ + test-time.t\ + test-timezone.t\ + test-file.t\ + test-command.t\ + test-netservice.t + +TEST_OBJ =\ + test-common.to\ + $(TEST:.t=.to) + +TEST_HDR =\ + libgeome.h\ + test-common.h + LOBJ = $(OBJ:.o=.lo) -all: libgeome.a libgeome.$(LIBEXT) +all: libgeome.a libgeome.$(LIBEXT) $(TEST) $(OBJ): $(HDR) $(LOBJ): $(HDR) +$(TEST): test-common.to libgeome.a +$(TEST_OBJ): $(TEST_HDR) .c.o: $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS) @@ -42,6 +59,12 @@ $(LOBJ): $(HDR) .c.lo: $(CC) -fPIC -c -o $@ $< $(CFLAGS) $(CPPFLAGS) +.c.to: + $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS) + +.to.t: + $(CC) -o $@ $< test-common.to libgeome.a $(CFLAGS) $(CPPFLAGS) -lm + libgeome.a: $(OBJ) @rm -f -- $@ $(AR) rc $@ $(OBJ) @@ -68,10 +91,10 @@ uninstall: -rm -f -- "$(DESTDIR)$(PREFIX)/include/libgeome.h" clean: - -rm -f -- *.o *.a *.lo *.su *.so *.so.* *.dll *.dylib + -rm -f -- *.o *.a *.lo *.su *.so *.so.* *.dll *.dylib *.t *.to -rm -f -- *.gch *.gcov *.gcno *.gcda *.$(LIBEXT) .SUFFIXES: -.SUFFIXES: .lo .o .c +.SUFFIXES: .lo .o .c .t .to .PHONY: all install uninstall clean -- cgit v1.2.3-70-g09d2