1 # Process this file with automake to produce Makefile.in 2 3 NULL = 4 SUBDIRS = 5 DIST_SUBDIRS = 6 BUILT_SOURCES = 7 EXTRA_DIST = 8 CLEANFILES = 9 DISTCLEANFILES = 10 MAINTAINERCLEANFILES = 11 DISTCHECK_CONFIGURE_FLAGS = --enable-introspection 12 TESTS = 13 check_PROGRAMS = 14 15 # Convenience targets: 16 lib: $(BUILT_SOURCES) libharfbuzz.la 17 libs: $(BUILT_SOURCES) $(lib_LTLIBRARIES) 18 19 lib_LTLIBRARIES = libharfbuzz.la 20 21 include Makefile.sources 22 23 HBCFLAGS = 24 HBLIBS = 25 HBNONPCLIBS = 26 HBDEPS = 27 HBSOURCES = $(HB_BASE_sources) 28 HBSOURCES += $(HB_BASE_RAGEL_GENERATED_sources) 29 HBHEADERS = $(HB_BASE_headers) 30 31 if HAVE_FALLBACK 32 HBSOURCES += $(HB_FALLBACK_sources) 33 endif 34 35 if HAVE_PTHREAD 36 HBCFLAGS += $(PTHREAD_CFLAGS) 37 HBNONPCLIBS += $(PTHREAD_LIBS) 38 endif 39 40 if HAVE_GLIB 41 HBCFLAGS += $(GLIB_CFLAGS) 42 HBLIBS += $(GLIB_LIBS) 43 HBDEPS += $(GLIB_DEPS) 44 HBSOURCES += $(HB_GLIB_sources) 45 HBHEADERS += $(HB_GLIB_headers) 46 endif 47 48 if HAVE_FREETYPE 49 HBCFLAGS += $(FREETYPE_CFLAGS) 50 HBLIBS += $(FREETYPE_LIBS) 51 # XXX 52 # The following creates a recursive dependency on FreeType if FreeType is 53 # built with HarfBuzz support enabled. Newer pkg-config handles that just 54 # fine but pkg-config 0.26 as shipped in Ubuntu 14.04 crashes. Remove 55 # in a year or two, or otherwise work around it... 56 #HBDEPS += $(FREETYPE_DEPS) 57 HBSOURCES += $(HB_FT_sources) 58 HBHEADERS += $(HB_FT_headers) 59 endif 60 61 if HAVE_GRAPHITE2 62 HBCFLAGS += $(GRAPHITE2_CFLAGS) 63 HBLIBS += $(GRAPHITE2_LIBS) 64 HBDEPS += $(GRAPHITE2_DEPS) 65 HBSOURCES += $(HB_GRAPHITE2_sources) 66 HBHEADERS += $(HB_GRAPHITE2_headers) 67 endif 68 69 if HAVE_UNISCRIBE 70 HBCFLAGS += $(UNISCRIBE_CFLAGS) 71 HBNONPCLIBS += $(UNISCRIBE_LIBS) 72 HBSOURCES += $(HB_UNISCRIBE_sources) 73 HBHEADERS += $(HB_UNISCRIBE_headers) 74 endif 75 76 if HAVE_DIRECTWRITE 77 HBCFLAGS += $(DIRECTWRITE_CXXFLAGS) 78 HBNONPCLIBS += $(DIRECTWRITE_LIBS) 79 HBSOURCES += $(HB_DIRECTWRITE_sources) 80 HBHEADERS += $(HB_DIRECTWRITE_headers) 81 endif 82 83 if HAVE_CORETEXT 84 HBCFLAGS += $(CORETEXT_CFLAGS) 85 HBNONPCLIBS += $(CORETEXT_LIBS) 86 HBSOURCES += $(HB_CORETEXT_sources) 87 HBHEADERS += $(HB_CORETEXT_headers) 88 endif 89 90 if HAVE_UCDN 91 SUBDIRS += hb-ucdn 92 HBCFLAGS += -I$(srcdir)/hb-ucdn 93 HBLIBS += hb-ucdn/libhb-ucdn.la 94 HBSOURCES += $(HB_UCDN_sources) 95 hb-ucdn/libhb-ucdn.la: ucdn 96 ucdn: 97 @$(MAKE) $(AM_MAKEFLAGS) -C hb-ucdn 98 endif 99 DIST_SUBDIRS += hb-ucdn 100 101 102 BUILT_SOURCES += \ 103 hb-version.h 104 105 $(srcdir)/hb-version.h: hb-version.h.in $(top_srcdir)/configure.ac 106 $(AM_V_GEN) $(SED) \ 107 -e 's/[@]HB_VERSION_MAJOR@/$(HB_VERSION_MAJOR)/' \ 108 -e 's/[@]HB_VERSION_MINOR@/$(HB_VERSION_MINOR)/' \ 109 -e 's/[@]HB_VERSION_MICRO@/$(HB_VERSION_MICRO)/' \ 110 -e 's/[@]HB_VERSION@/$(HB_VERSION)/' \ 111 "$<" > "$@" || ($(RM) "$@"; false) 112 113 # Put the library together 114 115 HBLIBS += $(HBNONPCLIBS) 116 117 if OS_WIN32 118 export_symbols = -export-symbols harfbuzz.def 119 harfbuzz_def_dependency = harfbuzz.def 120 export_symbols_subset = -export-symbols harfbuzz-subset.def 121 harfbuzz_subset_def_dependency = harfbuzz-subset.def 122 export_symbols_icu = -export-symbols harfbuzz-icu.def 123 harfbuzz_icu_def_dependency = harfbuzz-icu.def 124 export_symbols_gobject = -export-symbols harfbuzz-gobject.def 125 harfbuzz_gobject_def_dependency = harfbuzz-gobject.def 126 chosen_linker = $(CXXLINK) 127 else 128 if WITH_LIBSTDCXX 129 chosen_linker = $(CXXLINK) 130 else 131 if HAVE_GCC 132 # Use a C linker for GCC, not C++; Don't link to libstdc++ 133 chosen_linker = $(LINK) 134 else 135 chosen_linker = $(CXXLINK) 136 endif 137 endif 138 endif 139 140 @CODE_COVERAGE_RULES@ 141 142 base_link_flags = $(AM_LDFLAGS) -lm -version-info $(HB_LIBTOOL_VERSION_INFO) -no-undefined 143 libharfbuzz_la_LINK = $(chosen_linker) $(libharfbuzz_la_LDFLAGS) 144 libharfbuzz_la_SOURCES = $(HBSOURCES) $(HBHEADERS) 145 libharfbuzz_la_CPPFLAGS = $(HBCFLAGS) $(CODE_COVERAGE_CFLAGS) 146 libharfbuzz_la_LDFLAGS = $(base_link_flags) $(export_symbols) $(CODE_COVERAGE_LDFLAGS) 147 libharfbuzz_la_LIBADD = $(HBLIBS) 148 EXTRA_libharfbuzz_la_DEPENDENCIES = $(harfbuzz_def_dependency) 149 pkginclude_HEADERS = $(HBHEADERS) 150 nodist_pkginclude_HEADERS = 151 pkgconfigdir = $(libdir)/pkgconfig 152 pkgconfig_DATA = harfbuzz.pc 153 cmakedir = $(libdir)/cmake/harfbuzz 154 cmake_DATA = harfbuzz-config.cmake 155 EXTRA_DIST += hb-version.h.in harfbuzz.pc.in harfbuzz-config.cmake.in 156 157 lib_LTLIBRARIES += libharfbuzz-subset.la 158 libharfbuzz_subset_la_SOURCES = $(HB_SUBSET_sources) 159 libharfbuzz_subset_la_CPPFLAGS = $(HBCFLAGS) $(CODE_COVERAGE_CFLAGS) 160 libharfbuzz_subset_la_LDFLAGS = $(base_link_flags) $(export_symbols_subset) $(CODE_COVERAGE_LDFLAGS) 161 libharfbuzz_subset_la_LIBADD = libharfbuzz.la 162 EXTRA_libharfbuzz_subset_la_DEPENDENCIES = $(harfbuzz_subset_def_dependency) 163 pkginclude_HEADERS += $(HB_SUBSET_headers) 164 pkgconfig_DATA += harfbuzz-subset.pc 165 EXTRA_DIST += harfbuzz-subset.pc.in 166 167 if HAVE_ICU 168 if HAVE_ICU_BUILTIN 169 HBCFLAGS += $(ICU_CFLAGS) 170 HBLIBS += $(ICU_LIBS) 171 HBSOURCES += $(HB_ICU_sources) 172 HBHEADERS += $(HB_ICU_headers) 173 else 174 lib_LTLIBRARIES += libharfbuzz-icu.la 175 libharfbuzz_icu_la_SOURCES = $(HB_ICU_sources) 176 libharfbuzz_icu_la_CPPFLAGS = $(HBCFLAGS) $(ICU_CFLAGS) $(CODE_COVERAGE_CFLAGS) 177 libharfbuzz_icu_la_LDFLAGS = $(base_link_flags) $(export_symbols_icu) $(CODE_COVERAGE_LDFLAGS) 178 libharfbuzz_icu_la_LIBADD = $(ICU_LIBS) libharfbuzz.la 179 EXTRA_libharfbuzz_icu_la_DEPENDENCIES = $(harfbuzz_icu_def_dependency) 180 pkginclude_HEADERS += $(HB_ICU_headers) 181 pkgconfig_DATA += harfbuzz-icu.pc 182 endif 183 endif 184 EXTRA_DIST += harfbuzz-icu.pc.in 185 186 if HAVE_GOBJECT 187 lib_LTLIBRARIES += libharfbuzz-gobject.la 188 libharfbuzz_gobject_la_LINK = $(chosen_linker) $(libharfbuzz_gobject_la_LDFLAGS) 189 libharfbuzz_gobject_la_SOURCES = $(HB_GOBJECT_DIST_sources) 190 nodist_libharfbuzz_gobject_la_SOURCES = $(HB_GOBJECT_NODIST_sources) 191 libharfbuzz_gobject_la_CPPFLAGS = $(HBCFLAGS) $(GOBJECT_CFLAGS) $(CODE_COVERAGE_CFLAGS) 192 libharfbuzz_gobject_la_LDFLAGS = $(base_link_flags) $(CODE_COVERAGE_LDFLAGS) 193 libharfbuzz_gobject_la_LIBADD = $(GOBJECT_LIBS) libharfbuzz.la 194 EXTRA_libharfbuzz_gobject_la_DEPENDENCIES = $(harfbuzz_gobject_def_dependency) 195 pkginclude_HEADERS += $(HB_GOBJECT_DIST_headers) 196 nodist_pkginclude_HEADERS += $(HB_GOBJECT_NODIST_headers) 197 pkgconfig_DATA += harfbuzz-gobject.pc 198 199 BUILT_SOURCES += \ 200 $(HB_GOBJECT_ENUM_sources) \ 201 $(HB_GOBJECT_ENUM_headers) \ 202 $(NULL) 203 DISTCLEANFILES += \ 204 $(HB_GOBJECT_ENUM_sources) \ 205 $(HB_GOBJECT_ENUM_headers) \ 206 $(NULL) 207 hb-gobject-enums.%: hb-gobject-enums.%.tmpl $(HBHEADERS) 208 $(AM_V_GEN) PYTHONIOENCODING=UTF-8 $(GLIB_MKENUMS) \ 209 --identifier-prefix hb_ --symbol-prefix hb_gobject \ 210 --template $^ | \ 211 sed 's/_t_get_type/_get_type/g; s/_T (/ (/g' > "$@" \ 212 || ($(RM) "$@"; false) 213 endif 214 EXTRA_DIST += \ 215 harfbuzz-gobject.pc.in \ 216 hb-gobject-enums.cc.tmpl \ 217 hb-gobject-enums.h.tmpl \ 218 $(NULL) 219 220 221 %.pc: %.pc.in $(top_builddir)/config.status 222 $(AM_V_GEN) \ 223 $(SED) -e 's@%prefix%@$(prefix)@g' \ 224 -e 's@%exec_prefix%@$(exec_prefix)@g' \ 225 -e 's@%libdir%@$(libdir)@g' \ 226 -e 's@%includedir%@$(includedir)@g' \ 227 -e 's@%libs_private%@$(HBNONPCLIBS)@g' \ 228 -e 's@%requires_private%@$(HBDEPS)@g' \ 229 -e 's@%VERSION%@$(VERSION)@g' \ 230 "$<" > "$@" \ 231 || ($(RM) "$@"; false) 232 233 CLEANFILES += $(pkgconfig_DATA) 234 235 236 DEF_FILES = harfbuzz.def harfbuzz-subset.def harfbuzz-icu.def harfbuzz-deprecated-symbols.txt 237 if HAVE_GOBJECT 238 DEF_FILES += harfbuzz-gobject.def 239 endif 240 check: $(DEF_FILES) # For check-symbols.sh 241 CLEANFILES += $(DEF_FILES) 242 harfbuzz.def: $(HBHEADERS) $(HBNODISTHEADERS) 243 $(AM_V_GEN) $(srcdir)/gen-def.py "$@" $^ 244 harfbuzz-subset.def: $(HB_SUBSET_headers) 245 $(AM_V_GEN) $(srcdir)/gen-def.py "$@" $^ 246 harfbuzz-icu.def: $(HB_ICU_headers) 247 $(AM_V_GEN) $(srcdir)/gen-def.py "$@" $^ 248 harfbuzz-gobject.def: $(HB_GOBJECT_headers) 249 $(AM_V_GEN) $(srcdir)/gen-def.py "$@" $^ 250 harfbuzz-deprecated-symbols.txt: $(srcdir)/hb-deprecated.h 251 $(AM_V_GEN) PLAIN_LIST=1 $(srcdir)/gen-def.py "$@" $^ 252 253 254 GENERATORS = \ 255 gen-arabic-table.py \ 256 gen-def.py \ 257 gen-emoji-table.py \ 258 gen-indic-table.py \ 259 gen-os2-unicode-ranges.py \ 260 gen-tag-table.py \ 261 gen-use-table.py \ 262 gen-vowel-constraints.py \ 263 $(NULL) 264 EXTRA_DIST += $(GENERATORS) 265 266 unicode-tables: arabic-table indic-table tag-table use-table emoji-table 267 268 arabic-table: gen-arabic-table.py ArabicShaping.txt UnicodeData.txt Blocks.txt 269 $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-arabic-table.hh \ 270 || ($(RM) $(srcdir)/hb-ot-shape-complex-arabic-table.hh; false) 271 272 indic-table: gen-indic-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt Blocks.txt 273 $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-indic-table.cc \ 274 || ($(RM) $(srcdir)/hb-ot-shape-complex-indic-table.cc; false) 275 276 tag-table: gen-tag-table.py languagetags language-subtag-registry 277 $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-tag-table.hh \ 278 || ($(RM) $(srcdir)/hb-ot-tag-table.hh; false) 279 280 use-table: gen-use-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt UnicodeData.txt Blocks.txt 281 $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-use-table.cc \ 282 || ($(RM) $(srcdir)/hb-ot-shape-complex-use-table.cc; false) 283 284 vowel-constraints: gen-vowel-constraints.py HBIndicVowelConstraints.txt Scripts.txt 285 $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-vowel-constraints.cc \ 286 || ($(RM) $(srcdir)/hb-ot-shape-complex-vowel-constraints.cc; false) 287 288 emoji-table: gen-emoji-table.py emoji-data.txt 289 $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-unicode-emoji-table.hh \ 290 || ($(RM) $(srcdir)/hb-unicode-emoji-table.hh; false) 291 292 built-sources: $(BUILT_SOURCES) 293 294 .PHONY: unicode-tables arabic-table indic-table tag-table use-table vowel-constraints emoji-table built-sources 295 296 RAGEL_GENERATED = \ 297 $(patsubst %,$(srcdir)/%,$(HB_BASE_RAGEL_GENERATED_sources)) \ 298 $(NULL) 299 BUILT_SOURCES += $(RAGEL_GENERATED) 300 EXTRA_DIST += \ 301 $(HB_BASE_RAGEL_sources) \ 302 $(NULL) 303 # We decided to add ragel-generated files to git... 304 #MAINTAINERCLEANFILES += $(RAGEL_GENERATED) 305 $(srcdir)/%.hh: $(srcdir)/%.rl 306 $(AM_V_GEN)(cd $(srcdir) && $(RAGEL) -e -F1 -o "$*.hh" "$*.rl") \ 307 || ($(RM) "$@"; false) 308 309 noinst_PROGRAMS = \ 310 main \ 311 test \ 312 test-buffer-serialize \ 313 test-name-table \ 314 test-size-params \ 315 test-would-substitute \ 316 $(NULL) 317 bin_PROGRAMS = 318 319 main_SOURCES = main.cc 320 main_CPPFLAGS = $(HBCFLAGS) 321 main_LDADD = libharfbuzz.la $(HBLIBS) 322 323 test_SOURCES = test.cc 324 test_CPPFLAGS = $(HBCFLAGS) $(FREETYPE_CFLAGS) 325 test_LDADD = libharfbuzz.la $(HBLIBS) $(FREETYPE_LIBS) 326 327 test_buffer_serialize_SOURCES = test-buffer-serialize.cc 328 test_buffer_serialize_CPPFLAGS = $(HBCFLAGS) 329 test_buffer_serialize_LDADD = libharfbuzz.la $(HBLIBS) 330 331 test_name_table_SOURCES = test-name-table.cc 332 test_name_table_CPPFLAGS = $(HBCFLAGS) 333 test_name_table_LDADD = libharfbuzz.la $(HBLIBS) 334 335 test_size_params_SOURCES = test-size-params.cc 336 test_size_params_CPPFLAGS = $(HBCFLAGS) 337 test_size_params_LDADD = libharfbuzz.la $(HBLIBS) 338 339 test_would_substitute_SOURCES = test-would-substitute.cc 340 test_would_substitute_CPPFLAGS = $(HBCFLAGS) $(FREETYPE_CFLAGS) 341 test_would_substitute_LDADD = libharfbuzz.la $(HBLIBS) $(FREETYPE_LIBS) 342 343 if HAVE_FREETYPE 344 if HAVE_CAIRO_FT 345 noinst_PROGRAMS += test-ot-color 346 test_ot_color_SOURCES = test-ot-color.cc 347 test_ot_color_CPPFLAGS = $(HBCFLAGS) $(FREETYPE_CFLAGS) $(CAIRO_FT_CFLAGS) 348 test_ot_color_LDADD = libharfbuzz.la $(HBLIBS) $(FREETYPE_LIBS) $(CAIRO_LIBS) $(CAIRO_FT_LIBS) 349 endif # HAVE_CAIRO_FT 350 endif # HAVE_FREETYPE 351 352 dist_check_SCRIPTS = \ 353 check-c-linkage-decls.sh \ 354 check-externs.sh \ 355 check-header-guards.sh \ 356 check-includes.sh \ 357 check-static-inits.sh \ 358 check-symbols.sh \ 359 $(NULL) 360 TESTS += $(dist_check_SCRIPTS) 361 362 if !WITH_LIBSTDCXX 363 dist_check_SCRIPTS += \ 364 check-libstdc++.sh \ 365 $(NULL) 366 endif 367 368 check_PROGRAMS += \ 369 dump-indic-data \ 370 dump-khmer-data \ 371 dump-myanmar-data \ 372 dump-use-data \ 373 $(NULL) 374 dump_indic_data_SOURCES = dump-indic-data.cc hb-ot-shape-complex-indic-table.cc 375 dump_indic_data_CPPFLAGS = $(HBCFLAGS) 376 dump_indic_data_LDADD = libharfbuzz.la $(HBLIBS) 377 dump_khmer_data_SOURCES = dump-khmer-data.cc hb-ot-shape-complex-indic-table.cc 378 dump_khmer_data_CPPFLAGS = $(HBCFLAGS) 379 dump_khmer_data_LDADD = libharfbuzz.la $(HBLIBS) 380 dump_myanmar_data_SOURCES = dump-myanmar-data.cc hb-ot-shape-complex-indic-table.cc 381 dump_myanmar_data_CPPFLAGS = $(HBCFLAGS) 382 dump_myanmar_data_LDADD = libharfbuzz.la $(HBLIBS) 383 dump_use_data_SOURCES = dump-use-data.cc hb-ot-shape-complex-use-table.cc 384 dump_use_data_CPPFLAGS = $(HBCFLAGS) 385 dump_use_data_LDADD = libharfbuzz.la $(HBLIBS) 386 387 check_PROGRAMS += test-ot-tag test-unicode-ranges 388 TESTS += test-ot-tag test-unicode-ranges 389 390 test_ot_tag_SOURCES = hb-ot-tag.cc 391 test_ot_tag_CPPFLAGS = $(HBCFLAGS) -DMAIN 392 test_ot_tag_LDADD = libharfbuzz.la $(HBLIBS) 393 394 test_unicode_ranges_SOURCES = test-unicode-ranges.cc 395 test_unicode_ranges_LDADD = libharfbuzz.la $(HBLIBS) 396 397 TESTS_ENVIRONMENT = \ 398 srcdir="$(srcdir)" \ 399 MAKE="$(MAKE) $(AM_MAKEFLAGS)" \ 400 HBSOURCES="$(HBSOURCES)" \ 401 HBHEADERS="$(HBHEADERS)" \ 402 $(NULL) 403 404 if HAVE_INTROSPECTION 405 406 -include $(INTROSPECTION_MAKEFILE) 407 INTROSPECTION_GIRS = HarfBuzz-0.0.gir # What does the 0 mean anyway?! 408 INTROSPECTION_SCANNER_ARGS = -I$(srcdir) -n hb --identifier-prefix=hb_ --warn-all 409 INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) 410 INTROSPECTION_SCANNER_ENV = CC="$(CC)" 411 412 HarfBuzz-0.0.gir: libharfbuzz.la libharfbuzz-gobject.la 413 HarfBuzz_0_0_gir_INCLUDES = GObject-2.0 414 HarfBuzz_0_0_gir_CFLAGS = \ 415 $(INCLUDES) \ 416 $(HBCFLAGS) \ 417 -DHB_H \ 418 -DHB_H_IN \ 419 -DHB_OT_H \ 420 -DHB_OT_H_IN \ 421 -DHB_AAT_H \ 422 -DHB_AAT_H_IN \ 423 -DHB_GOBJECT_H \ 424 -DHB_GOBJECT_H_IN \ 425 -DHB_EXTERN= \ 426 $(NULL) 427 HarfBuzz_0_0_gir_LIBS = \ 428 libharfbuzz.la \ 429 libharfbuzz-gobject.la \ 430 $(NULL) 431 HarfBuzz_0_0_gir_FILES = \ 432 $(HBHEADERS) \ 433 $(HBSOURCES) \ 434 $(HB_GOBJECT_sources) \ 435 $(HB_GOBJECT_headers) \ 436 $(NULL) 437 438 girdir = $(datadir)/gir-1.0 439 gir_DATA = $(INTROSPECTION_GIRS) 440 441 typelibdir = $(libdir)/girepository-1.0 442 typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) 443 444 CLEANFILES += $(gir_DATA) $(typelib_DATA) 445 446 endif 447 448 -include $(top_srcdir)/git.mk 449