1# Process this file with automake to produce Makefile.in
2
3NULL =
4SUBDIRS =
5DIST_SUBDIRS =
6BUILT_SOURCES =
7EXTRA_DIST =
8CLEANFILES =
9DISTCLEANFILES =
10MAINTAINERCLEANFILES =
11DISTCHECK_CONFIGURE_FLAGS = --enable-introspection
12TESTS =
13check_PROGRAMS =
14
15# Convenience targets:
16lib: $(BUILT_SOURCES) libharfbuzz.la
17libs: $(BUILT_SOURCES) $(lib_LTLIBRARIES)
18
19lib_LTLIBRARIES = libharfbuzz.la
20
21include Makefile.sources
22
23HBCFLAGS =
24HBLIBS =
25HBNONPCLIBS =
26HBDEPS =
27HBSOURCES =  $(HB_BASE_sources)
28HBSOURCES += $(HB_BASE_RAGEL_GENERATED_sources)
29HBHEADERS = $(HB_BASE_headers)
30
31if HAVE_FALLBACK
32HBSOURCES += $(HB_FALLBACK_sources)
33endif
34
35if HAVE_PTHREAD
36HBCFLAGS += $(PTHREAD_CFLAGS)
37HBNONPCLIBS += $(PTHREAD_LIBS)
38endif
39
40if HAVE_GLIB
41HBCFLAGS += $(GLIB_CFLAGS)
42HBLIBS   += $(GLIB_LIBS)
43HBDEPS   += $(GLIB_DEPS)
44HBSOURCES += $(HB_GLIB_sources)
45HBHEADERS += $(HB_GLIB_headers)
46endif
47
48if HAVE_FREETYPE
49HBCFLAGS += $(FREETYPE_CFLAGS)
50HBLIBS   += $(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)
57HBSOURCES += $(HB_FT_sources)
58HBHEADERS += $(HB_FT_headers)
59endif
60
61if HAVE_GRAPHITE2
62HBCFLAGS += $(GRAPHITE2_CFLAGS)
63HBLIBS   += $(GRAPHITE2_LIBS)
64HBDEPS   += $(GRAPHITE2_DEPS)
65HBSOURCES += $(HB_GRAPHITE2_sources)
66HBHEADERS += $(HB_GRAPHITE2_headers)
67endif
68
69if HAVE_UNISCRIBE
70HBCFLAGS += $(UNISCRIBE_CFLAGS)
71HBNONPCLIBS += $(UNISCRIBE_LIBS)
72HBSOURCES += $(HB_UNISCRIBE_sources)
73HBHEADERS += $(HB_UNISCRIBE_headers)
74endif
75
76if HAVE_DIRECTWRITE
77HBCFLAGS += $(DIRECTWRITE_CXXFLAGS)
78HBNONPCLIBS += $(DIRECTWRITE_LIBS)
79HBSOURCES += $(HB_DIRECTWRITE_sources)
80HBHEADERS += $(HB_DIRECTWRITE_headers)
81endif
82
83if HAVE_CORETEXT
84HBCFLAGS += $(CORETEXT_CFLAGS)
85HBNONPCLIBS += $(CORETEXT_LIBS)
86HBSOURCES += $(HB_CORETEXT_sources)
87HBHEADERS += $(HB_CORETEXT_headers)
88endif
89
90if HAVE_UCDN
91SUBDIRS += hb-ucdn
92HBCFLAGS += -I$(srcdir)/hb-ucdn
93HBLIBS   += hb-ucdn/libhb-ucdn.la
94HBSOURCES += $(HB_UCDN_sources)
95hb-ucdn/libhb-ucdn.la: ucdn
96ucdn:
97	@$(MAKE) $(AM_MAKEFLAGS) -C hb-ucdn
98endif
99DIST_SUBDIRS += hb-ucdn
100
101
102BUILT_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
115HBLIBS += $(HBNONPCLIBS)
116
117if OS_WIN32
118export_symbols = -export-symbols harfbuzz.def
119harfbuzz_def_dependency = harfbuzz.def
120export_symbols_subset = -export-symbols harfbuzz-subset.def
121harfbuzz_subset_def_dependency = harfbuzz-subset.def
122export_symbols_icu = -export-symbols harfbuzz-icu.def
123harfbuzz_icu_def_dependency = harfbuzz-icu.def
124export_symbols_gobject = -export-symbols harfbuzz-gobject.def
125harfbuzz_gobject_def_dependency = harfbuzz-gobject.def
126chosen_linker = $(CXXLINK)
127else
128if WITH_LIBSTDCXX
129chosen_linker = $(CXXLINK)
130else
131if HAVE_GCC
132# Use a C linker for GCC, not C++; Don't link to libstdc++
133chosen_linker = $(LINK)
134else
135chosen_linker = $(CXXLINK)
136endif
137endif
138endif
139
140@CODE_COVERAGE_RULES@
141
142base_link_flags = $(AM_LDFLAGS) -lm -version-info $(HB_LIBTOOL_VERSION_INFO) -no-undefined
143libharfbuzz_la_LINK = $(chosen_linker) $(libharfbuzz_la_LDFLAGS)
144libharfbuzz_la_SOURCES = $(HBSOURCES) $(HBHEADERS)
145libharfbuzz_la_CPPFLAGS = $(HBCFLAGS) $(CODE_COVERAGE_CFLAGS)
146libharfbuzz_la_LDFLAGS = $(base_link_flags) $(export_symbols) $(CODE_COVERAGE_LDFLAGS)
147libharfbuzz_la_LIBADD = $(HBLIBS)
148EXTRA_libharfbuzz_la_DEPENDENCIES = $(harfbuzz_def_dependency)
149pkginclude_HEADERS = $(HBHEADERS)
150nodist_pkginclude_HEADERS =
151pkgconfigdir = $(libdir)/pkgconfig
152pkgconfig_DATA = harfbuzz.pc
153cmakedir = $(libdir)/cmake/harfbuzz
154cmake_DATA = harfbuzz-config.cmake
155EXTRA_DIST += hb-version.h.in harfbuzz.pc.in harfbuzz-config.cmake.in
156
157lib_LTLIBRARIES += libharfbuzz-subset.la
158libharfbuzz_subset_la_SOURCES = $(HB_SUBSET_sources)
159libharfbuzz_subset_la_CPPFLAGS = $(HBCFLAGS) $(CODE_COVERAGE_CFLAGS)
160libharfbuzz_subset_la_LDFLAGS = $(base_link_flags) $(export_symbols_subset) $(CODE_COVERAGE_LDFLAGS)
161libharfbuzz_subset_la_LIBADD = libharfbuzz.la
162EXTRA_libharfbuzz_subset_la_DEPENDENCIES = $(harfbuzz_subset_def_dependency)
163pkginclude_HEADERS += $(HB_SUBSET_headers)
164pkgconfig_DATA += harfbuzz-subset.pc
165EXTRA_DIST += harfbuzz-subset.pc.in
166
167if HAVE_ICU
168if HAVE_ICU_BUILTIN
169HBCFLAGS += $(ICU_CFLAGS)
170HBLIBS += $(ICU_LIBS)
171HBSOURCES += $(HB_ICU_sources)
172HBHEADERS += $(HB_ICU_headers)
173else
174lib_LTLIBRARIES += libharfbuzz-icu.la
175libharfbuzz_icu_la_SOURCES = $(HB_ICU_sources)
176libharfbuzz_icu_la_CPPFLAGS = $(HBCFLAGS) $(ICU_CFLAGS) $(CODE_COVERAGE_CFLAGS)
177libharfbuzz_icu_la_LDFLAGS = $(base_link_flags) $(export_symbols_icu) $(CODE_COVERAGE_LDFLAGS)
178libharfbuzz_icu_la_LIBADD = $(ICU_LIBS) libharfbuzz.la
179EXTRA_libharfbuzz_icu_la_DEPENDENCIES = $(harfbuzz_icu_def_dependency)
180pkginclude_HEADERS += $(HB_ICU_headers)
181pkgconfig_DATA += harfbuzz-icu.pc
182endif
183endif
184EXTRA_DIST += harfbuzz-icu.pc.in
185
186if HAVE_GOBJECT
187lib_LTLIBRARIES += libharfbuzz-gobject.la
188libharfbuzz_gobject_la_LINK = $(chosen_linker) $(libharfbuzz_gobject_la_LDFLAGS)
189libharfbuzz_gobject_la_SOURCES = $(HB_GOBJECT_DIST_sources)
190nodist_libharfbuzz_gobject_la_SOURCES = $(HB_GOBJECT_NODIST_sources)
191libharfbuzz_gobject_la_CPPFLAGS = $(HBCFLAGS) $(GOBJECT_CFLAGS) $(CODE_COVERAGE_CFLAGS)
192libharfbuzz_gobject_la_LDFLAGS = $(base_link_flags) $(CODE_COVERAGE_LDFLAGS)
193libharfbuzz_gobject_la_LIBADD = $(GOBJECT_LIBS) libharfbuzz.la
194EXTRA_libharfbuzz_gobject_la_DEPENDENCIES = $(harfbuzz_gobject_def_dependency)
195pkginclude_HEADERS += $(HB_GOBJECT_DIST_headers)
196nodist_pkginclude_HEADERS += $(HB_GOBJECT_NODIST_headers)
197pkgconfig_DATA += harfbuzz-gobject.pc
198
199BUILT_SOURCES += \
200	$(HB_GOBJECT_ENUM_sources) \
201	$(HB_GOBJECT_ENUM_headers) \
202	$(NULL)
203DISTCLEANFILES += \
204	$(HB_GOBJECT_ENUM_sources) \
205	$(HB_GOBJECT_ENUM_headers) \
206	$(NULL)
207hb-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)
213endif
214EXTRA_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
233CLEANFILES += $(pkgconfig_DATA)
234
235
236DEF_FILES = harfbuzz.def harfbuzz-subset.def harfbuzz-icu.def harfbuzz-deprecated-symbols.txt
237if HAVE_GOBJECT
238DEF_FILES += harfbuzz-gobject.def
239endif
240check: $(DEF_FILES) # For check-symbols.sh
241CLEANFILES += $(DEF_FILES)
242harfbuzz.def: $(HBHEADERS) $(HBNODISTHEADERS)
243	$(AM_V_GEN) $(srcdir)/gen-def.py "$@" $^
244harfbuzz-subset.def: $(HB_SUBSET_headers)
245	$(AM_V_GEN) $(srcdir)/gen-def.py "$@" $^
246harfbuzz-icu.def: $(HB_ICU_headers)
247	$(AM_V_GEN) $(srcdir)/gen-def.py "$@" $^
248harfbuzz-gobject.def: $(HB_GOBJECT_headers)
249	$(AM_V_GEN) $(srcdir)/gen-def.py "$@" $^
250harfbuzz-deprecated-symbols.txt: $(srcdir)/hb-deprecated.h
251	$(AM_V_GEN) PLAIN_LIST=1 $(srcdir)/gen-def.py "$@" $^
252
253
254GENERATORS = \
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)
264EXTRA_DIST += $(GENERATORS)
265
266unicode-tables: arabic-table indic-table tag-table use-table emoji-table
267
268arabic-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
272indic-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
276tag-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
280use-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
284vowel-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
288emoji-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
292built-sources: $(BUILT_SOURCES)
293
294.PHONY: unicode-tables arabic-table indic-table tag-table use-table vowel-constraints emoji-table built-sources
295
296RAGEL_GENERATED = \
297	$(patsubst %,$(srcdir)/%,$(HB_BASE_RAGEL_GENERATED_sources)) \
298	$(NULL)
299BUILT_SOURCES += $(RAGEL_GENERATED)
300EXTRA_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
309noinst_PROGRAMS = \
310	main \
311	test \
312	test-buffer-serialize \
313	test-name-table \
314	test-size-params \
315	test-would-substitute \
316	$(NULL)
317bin_PROGRAMS =
318
319main_SOURCES = main.cc
320main_CPPFLAGS = $(HBCFLAGS)
321main_LDADD = libharfbuzz.la $(HBLIBS)
322
323test_SOURCES = test.cc
324test_CPPFLAGS = $(HBCFLAGS) $(FREETYPE_CFLAGS)
325test_LDADD = libharfbuzz.la $(HBLIBS) $(FREETYPE_LIBS)
326
327test_buffer_serialize_SOURCES = test-buffer-serialize.cc
328test_buffer_serialize_CPPFLAGS = $(HBCFLAGS)
329test_buffer_serialize_LDADD = libharfbuzz.la $(HBLIBS)
330
331test_name_table_SOURCES = test-name-table.cc
332test_name_table_CPPFLAGS = $(HBCFLAGS)
333test_name_table_LDADD = libharfbuzz.la $(HBLIBS)
334
335test_size_params_SOURCES = test-size-params.cc
336test_size_params_CPPFLAGS = $(HBCFLAGS)
337test_size_params_LDADD = libharfbuzz.la $(HBLIBS)
338
339test_would_substitute_SOURCES = test-would-substitute.cc
340test_would_substitute_CPPFLAGS = $(HBCFLAGS) $(FREETYPE_CFLAGS)
341test_would_substitute_LDADD = libharfbuzz.la $(HBLIBS) $(FREETYPE_LIBS)
342
343if HAVE_FREETYPE
344if HAVE_CAIRO_FT
345noinst_PROGRAMS += test-ot-color
346test_ot_color_SOURCES = test-ot-color.cc
347test_ot_color_CPPFLAGS = $(HBCFLAGS) $(FREETYPE_CFLAGS) $(CAIRO_FT_CFLAGS)
348test_ot_color_LDADD = libharfbuzz.la $(HBLIBS) $(FREETYPE_LIBS) $(CAIRO_LIBS) $(CAIRO_FT_LIBS)
349endif # HAVE_CAIRO_FT
350endif # HAVE_FREETYPE
351
352dist_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)
360TESTS += $(dist_check_SCRIPTS)
361
362if !WITH_LIBSTDCXX
363dist_check_SCRIPTS += \
364	check-libstdc++.sh \
365	$(NULL)
366endif
367
368check_PROGRAMS += \
369	dump-indic-data \
370	dump-khmer-data \
371	dump-myanmar-data \
372	dump-use-data \
373	$(NULL)
374dump_indic_data_SOURCES = dump-indic-data.cc hb-ot-shape-complex-indic-table.cc
375dump_indic_data_CPPFLAGS = $(HBCFLAGS)
376dump_indic_data_LDADD = libharfbuzz.la $(HBLIBS)
377dump_khmer_data_SOURCES = dump-khmer-data.cc hb-ot-shape-complex-indic-table.cc
378dump_khmer_data_CPPFLAGS = $(HBCFLAGS)
379dump_khmer_data_LDADD = libharfbuzz.la $(HBLIBS)
380dump_myanmar_data_SOURCES = dump-myanmar-data.cc hb-ot-shape-complex-indic-table.cc
381dump_myanmar_data_CPPFLAGS = $(HBCFLAGS)
382dump_myanmar_data_LDADD = libharfbuzz.la $(HBLIBS)
383dump_use_data_SOURCES = dump-use-data.cc hb-ot-shape-complex-use-table.cc
384dump_use_data_CPPFLAGS = $(HBCFLAGS)
385dump_use_data_LDADD = libharfbuzz.la $(HBLIBS)
386
387check_PROGRAMS += test-ot-tag test-unicode-ranges
388TESTS += test-ot-tag test-unicode-ranges
389
390test_ot_tag_SOURCES = hb-ot-tag.cc
391test_ot_tag_CPPFLAGS = $(HBCFLAGS) -DMAIN
392test_ot_tag_LDADD = libharfbuzz.la $(HBLIBS)
393
394test_unicode_ranges_SOURCES = test-unicode-ranges.cc
395test_unicode_ranges_LDADD = libharfbuzz.la $(HBLIBS)
396
397TESTS_ENVIRONMENT = \
398	srcdir="$(srcdir)" \
399	MAKE="$(MAKE) $(AM_MAKEFLAGS)" \
400	HBSOURCES="$(HBSOURCES)" \
401	HBHEADERS="$(HBHEADERS)" \
402	$(NULL)
403
404if HAVE_INTROSPECTION
405
406-include $(INTROSPECTION_MAKEFILE)
407INTROSPECTION_GIRS = HarfBuzz-0.0.gir # What does the 0 mean anyway?!
408INTROSPECTION_SCANNER_ARGS = -I$(srcdir) -n hb --identifier-prefix=hb_ --warn-all
409INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
410INTROSPECTION_SCANNER_ENV = CC="$(CC)"
411
412HarfBuzz-0.0.gir: libharfbuzz.la libharfbuzz-gobject.la
413HarfBuzz_0_0_gir_INCLUDES = GObject-2.0
414HarfBuzz_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)
427HarfBuzz_0_0_gir_LIBS = \
428	libharfbuzz.la \
429	libharfbuzz-gobject.la \
430	$(NULL)
431HarfBuzz_0_0_gir_FILES = \
432	$(HBHEADERS) \
433	$(HBSOURCES) \
434	$(HB_GOBJECT_sources) \
435	$(HB_GOBJECT_headers) \
436	$(NULL)
437
438girdir = $(datadir)/gir-1.0
439gir_DATA = $(INTROSPECTION_GIRS)
440
441typelibdir = $(libdir)/girepository-1.0
442typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
443
444CLEANFILES += $(gir_DATA) $(typelib_DATA)
445
446endif
447
448-include $(top_srcdir)/git.mk
449