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