1# Process this file with automake to produce Makefile.in 2 3NULL = 4EXTRA_DIST = 5CLEANFILES = 6DISTCLEANFILES = 7MAINTAINERCLEANFILES = 8 9# Convenience targets: 10lib: 11 @$(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/src lib 12libs: 13 @$(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/src libs 14 15EXTRA_DIST += CMakeLists.txt 16 17EXTRA_DIST += fonts 18 19LINK = $(CXXLINK) 20 21if HAVE_GLIB 22AM_CPPFLAGS = -DSRCDIR="\"$(srcdir)\"" -I$(top_srcdir)/src/ -I$(top_builddir)/src/ $(GLIB_CFLAGS) 23LDADD = $(top_builddir)/src/libharfbuzz.la $(GLIB_LIBS) 24 25EXTRA_DIST += hb-test.h hb-subset-test.h 26 27check_PROGRAMS = $(TEST_PROGS) 28noinst_PROGRAMS = $(TEST_PROGS) 29 30TEST_PROGS = \ 31 test-aat-layout \ 32 test-baseline \ 33 test-blob \ 34 test-buffer \ 35 test-collect-unicodes \ 36 test-common \ 37 test-font \ 38 test-map \ 39 test-object \ 40 test-ot-face \ 41 test-set \ 42 test-shape \ 43 test-subset \ 44 test-subset-cmap \ 45 test-subset-drop-tables \ 46 test-subset-glyf \ 47 test-subset-hdmx \ 48 test-subset-hmtx \ 49 test-subset-os2 \ 50 test-subset-post \ 51 test-subset-vmtx \ 52 test-subset-cff1 \ 53 test-subset-cff2 \ 54 test-unicode \ 55 test-version \ 56 test-subset-nameids \ 57 $(NULL) 58 59test_subset_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la 60test_subset_cmap_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la 61test_subset_drop_tables_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la 62test_subset_glyf_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la 63test_subset_hdmx_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la 64test_subset_hmtx_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la 65test_subset_os2_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la 66test_subset_post_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la 67test_subset_vmtx_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la 68test_subset_cff1_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la 69test_subset_cff2_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la 70test_subset_nameids_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la 71 72test_unicode_CPPFLAGS = \ 73 $(AM_CPPFLAGS) \ 74 $(GLIB_CFLAGS) \ 75 $(NULL) 76test_unicode_LDADD = $(LDADD) 77if HAVE_ICU 78test_unicode_CPPFLAGS += $(ICU_CFLAGS) 79test_unicode_LDADD += $(top_builddir)/src/libharfbuzz-icu.la $(ICU_LIBS) 80endif 81 82 83TEST_PROGS += \ 84 test-ot-color \ 85 test-ot-ligature-carets \ 86 test-ot-name \ 87 test-ot-tag \ 88 test-ot-extents-cff \ 89 $(NULL) 90 91 92if HAVE_PTHREAD 93if HAVE_FREETYPE 94TEST_PROGS += test-multithread 95test_multithread_CFLAGS = $(CFLAGS) $(PTHREAD_CFLAGS) $(FREETYPE_CFLAGS) 96test_multithread_LDADD = $(LDADD) $(PTHREAD_LIBS) $(FREETYPE_LIBS) 97# The auto-generated link rule somehow includes CFLAGS as well. Without 98# it, pthread link fails, because, who knows why, $PTHREAD_LIBS is empty. 99test_multithread_LINK = $(LINK) $(PTHREAD_CFLAGS) 100endif 101endif 102 103if HAVE_FREETYPE 104TEST_PROGS += \ 105 test-ot-math \ 106 $(NULL) 107test_ot_math_LDADD = $(LDADD) $(FREETYPE_LIBS) 108test_ot_math_CPPFLAGS = $(AM_CPPFLAGS) $(FREETYPE_CFLAGS) 109endif # HAVE_FREETYPE 110 111 112# Tests for header compilation 113TEST_PROGS += \ 114 test-c \ 115 test-cplusplus \ 116 $(NULL) 117test_cplusplus_SOURCES = test-cplusplus.cc 118test_c_CPPFLAGS = $(AM_CPPFLAGS) 119test_cplusplus_CPPFLAGS = $(AM_CPPFLAGS) 120if HAVE_ICU 121test_c_CPPFLAGS += $(ICU_CFLAGS) 122test_cplusplus_CPPFLAGS += $(ICU_CFLAGS) 123endif 124if HAVE_FREETYPE 125test_c_CPPFLAGS += $(FREETYPE_CFLAGS) 126test_cplusplus_CPPFLAGS += $(FREETYPE_CFLAGS) 127endif 128 129# Default test running environment 130TESTS = $(TEST_PROGS) 131TESTS_ENVIRONMENT = \ 132 MALLOC_CHECK_=2 \ 133 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) \ 134 G_DEBUG=gc-friendly \ 135 G_SLICE=always-malloc \ 136 srcdir=$(srcdir) \ 137 G_TEST_SRCDIR=$(abs_srcdir) \ 138 G_TEST_BUILDDIR=$(abs_builddir) \ 139 $(NULL) 140 141 142# check-tool: Run tests under $(TOOL) 143check-tool: 144 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \ 145 TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) $(top_builddir)/libtool --mode=execute \ 146 env $(TOOL)' 147# check-tool-raw: Run tests under $(TOOL), but don't run under libtool 148check-tool-raw: 149 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \ 150 TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) \ 151 env $(TOOL)' 152 153# check-gtester: Run tests under gtester 154GTESTER = gtester 155check-gtester: 156 $(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool-raw TOOL="$(GTESTER) --verbose --keep-going" 157 158 159# Check tests under valgrind. Saves log to log-valgrind.txt 160VALGRIND_FLAGS = \ 161 --tool=memcheck \ 162 --track-origins=yes \ 163 --leak-check=yes \ 164 $(EXTRA_VALGRIND_FLAGS) 165# Can't do for now: --show-reachable=yes 166CLEANFILES += log-valgrind.txt 167valgrind_verbose = $(valgrind_verbose_@AM_V@) 168valgrind_verbose_ = $(valgrind_verbose_@AM_DEFAULT_V@) 169valgrind_verbose_0 = | \ 170 grep '\(^[^=]\|ERROR SUMMARY\|definitely lost\|indirectly lost\)' | grep -v ': 0' 171# TODO: The following check does not fail if valgrind finds error. It should. 172check-valgrind: 173 $(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool TOOL="valgrind $(VALGRIND_FLAGS)" \ 174 2>&1 | tee log-valgrind.txt $(valgrind_verbose) 175 176 177# check-symbols: Finds untested API symbols 178symbols-tested.txt: $(TEST_PROGS) 179 $(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \ 180 | grep ' U hb_' | sed 's/.* U hb_/hb_/' \ 181 | sort | uniq > $@.tmp && mv $@.tmp $@ 182symbols-tested-or-deprecated.txt: symbols-tested.txt $(top_builddir)/src/harfbuzz-deprecated-symbols.txt 183 $(AM_V_GEN)cat $^ | sort | uniq > $@.tmp; mv $@.tmp $@ 184symbols-exported.txt: $(top_builddir)/src/.libs/libharfbuzz.so 185 $(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \ 186 | grep ' T ' | sed 's/.* T //' | grep -v '^\(_init\|_fini\)$$' \ 187 | sort | uniq > $@.tmp && mv $@.tmp $@ 188symbols-untested.txt: symbols-tested-or-deprecated.txt symbols-exported.txt 189 $(AM_V_GEN)diff $^ > $@.tmp; mv $@.tmp $@ 190CLEANFILES += symbols-tested.txt \ 191 symbols-exported.txt \ 192 symbols-untested.txt \ 193 symbols-tested-or-deprecated.txt 194check-symbols: symbols-untested.txt 195 @! cat $^ | grep . 196 197 198 199else # !HAVE_GLIB 200check-am: err-glib 201err-glib: 202 @echo "You need to have glib support enabled to run the tests" 203 @exit 77 204endif # HAVE_GLIB 205 206.PHONY: check-symbols check-tool check-valgrind 207 208-include $(top_srcdir)/git.mk 209