diff options
author | Mattias Andrée <maandree@kth.se> | 2021-09-05 14:53:47 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-09-05 14:53:47 +0200 |
commit | a97da13a7c3716f985973f0454f5c8caa0fa05b1 (patch) | |
tree | 41096cd7f389b916c0c77df0432f4f00ddb327c9 /Makefile | |
parent | First commit (diff) | |
download | libnumtext-a97da13a7c3716f985973f0454f5c8caa0fa05b1.tar.gz libnumtext-a97da13a7c3716f985973f0454f5c8caa0fa05b1.tar.bz2 libnumtext-a97da13a7c3716f985973f0454f5c8caa0fa05b1.tar.xz |
Add tests for and fix Swedish
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 28 |
1 files changed, 25 insertions, 3 deletions
@@ -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 |