diff options
author | Mattias Andrée <maandree@kth.se> | 2023-01-07 23:40:55 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2023-01-07 23:40:55 +0100 |
commit | 4a7c500000af251d55919b7462599a67fc76c5bc (patch) | |
tree | 467c177dd2db091bd2789845859d9e8837c977a6 /Makefile | |
parent | Add textual descriptions of subpixel layouts (diff) | |
download | libfonts-4a7c500000af251d55919b7462599a67fc76c5bc.tar.gz libfonts-4a7c500000af251d55919b7462599a67fc76c5bc.tar.bz2 libfonts-4a7c500000af251d55919b7462599a67fc76c5bc.tar.xz |
Add tests
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -25,6 +25,10 @@ OBJ =\ libfonts_get_subpixel_order_class.o\ libfonts_unget_subpixel_order_class.o +TESTS =\ + libfonts_get_subpixel_order_class.test\ + libfonts_unget_subpixel_order_class.test + HDR =\ common.h\ libfonts.h @@ -32,9 +36,10 @@ HDR =\ LOBJ = $(OBJ:.o=.lo) -all: libfonts.a libfonts.$(LIBEXT) +all: libfonts.a libfonts.$(LIBEXT) $(TESTS) $(OBJ): $(HDR) $(LOBJ): $(HDR) +$(TESTS): $(HDR) libfonts.a .c.o: $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS) @@ -42,6 +47,9 @@ $(LOBJ): $(HDR) .c.lo: $(CC) -fPIC -c -o $@ $< $(CFLAGS) $(CPPFLAGS) +.c.test: + $(CC) -o $@ $< libfonts.a $(CFLAGS) $(CPPFLAGS) -DTEST $(LDFLAGS) + libfonts.a: $(OBJ) @rm -f -- $@ $(AR) rc $@ $(OBJ) @@ -50,6 +58,9 @@ libfonts.a: $(OBJ) libfonts.$(LIBEXT): $(LOBJ) $(CC) $(LIBFLAGS) -o $@ $(LOBJ) $(LDFLAGS) +check: $(TESTS) + @for t in $(TESTS); do printf './%s\n' $$t; ./$$t || exit 1; done + install: libfonts.a libfonts.$(LIBEXT) mkdir -p -- "$(DESTDIR)$(PREFIX)/lib" mkdir -p -- "$(DESTDIR)$(PREFIX)/include" @@ -68,10 +79,10 @@ uninstall: -rm -f -- "$(DESTDIR)$(PREFIX)/include/libfonts.h" clean: - -rm -f -- *.o *.a *.lo *.su *.so *.so.* *.dll *.dylib + -rm -f -- *.o *.a *.lo *.su *.so *.so.* *.dll *.dylib *.test -rm -f -- *.gch *.gcov *.gcno *.gcda *.$(LIBEXT) .SUFFIXES: -.SUFFIXES: .lo .o .c +.SUFFIXES: .lo .o .c .test .PHONY: all install uninstall clean |