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