From a97da13a7c3716f985973f0454f5c8caa0fa05b1 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 5 Sep 2021 14:53:47 +0200 Subject: Add tests for and fix Swedish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 796d0cf..9532826 100644 --- a/Makefile +++ b/Makefile @@ -3,18 +3,30 @@ CONFIGFILE = config.mk include $(CONFIGFILE) +LANG =\ + swedish + OBJ =\ libnumtext_num2text.o\ libnumtext_remove_separators.o\ - swedish.o + $(LANG:=.o) HDR =\ libnumtext.h\ common.h +TEST =\ + $(LANG:=.test) + +TEST_OBJ =\ + $(TEST:=.o) + + all: libnumtext.a $(OBJ): $(HDR) $(OBJ:.o=.lo): $(HDR) +$(TEST_OBJ): libnumtext.h +$(TEST): libnumtext.a .c.o: $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS) @@ -22,10 +34,20 @@ $(OBJ:.o=.lo): $(HDR) .c.lo: $(CC) -fPIC -c -o $@ $< $(CFLAGS) $(CPPFLAGS) +.test.o.test: + $(CC) -o $@ $< libnumtext.a $(LDFLAGS) + libnumtext.a: $(OBJ) @rm -f -- $@ $(AR) rc $@ $(OBJ) +check: $(TEST) + @set -e &&\ + for t in $(TEST); do\ + printf './%s\n' "$$t";\ + "./$$t" || exit 1;\ + done + install: libnumtext.a mkdir -p -- "$(DESTDIR)$(PREFIX)/lib" mkdir -p -- "$(DESTDIR)$(PREFIX)/include" @@ -40,6 +62,6 @@ clean: -rm -f -- *.o *.a *.lo *.su *.so *.so.* *.gch *.gcov *.gcno *.gcda .SUFFIXES: -.SUFFIXES: .lo .o .c +.SUFFIXES: .lo .o .c .test .test.o -.PHONY: all install uninstall clean +.PHONY: all check install uninstall clean -- cgit v1.2.3-70-g09d2