• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
15EXTRA_DIST += harfbuzz.cc
16EXTRA_DIST += meson.build
17EXTRA_DIST += fix_get_types.py
18
19# Convenience targets:
20lib: $(BUILT_SOURCES) libharfbuzz.la
21libs: $(BUILT_SOURCES) $(lib_LTLIBRARIES)
22tiny:
23	$(MAKE) $(AM_MAKEFLAGS) CPPFLAGS="-Os -DHB_TINY $(CPPFLAGS)" libs
24tinyz:
25	$(MAKE) $(AM_MAKEFLAGS) CPPFLAGS="-Oz -DHB_TINY $(CPPFLAGS)" libs
26
27lib_LTLIBRARIES = libharfbuzz.la
28
29include Makefile.sources
30
31HBCFLAGS =
32HBLIBS =
33HBNONPCLIBS =
34HBDEPS =
35HBSOURCES =  $(HB_BASE_sources)
36HBSOURCES += $(HB_BASE_RAGEL_GENERATED_sources)
37HBHEADERS = $(HB_BASE_headers)
38
39if HAVE_PTHREAD
40HBCFLAGS += $(PTHREAD_CFLAGS)
41HBNONPCLIBS += $(PTHREAD_LIBS)
42endif
43
44if HAVE_GLIB
45HBCFLAGS += $(GLIB_CFLAGS)
46HBLIBS   += $(GLIB_LIBS)
47HBDEPS   += $(GLIB_DEPS)
48HBSOURCES += $(HB_GLIB_sources)
49HBHEADERS += $(HB_GLIB_headers)
50endif
51
52if HAVE_FREETYPE
53HBCFLAGS += $(FREETYPE_CFLAGS)
54HBLIBS   += $(FREETYPE_LIBS)
55HBDEPS   += $(FREETYPE_DEPS)
56HBSOURCES += $(HB_FT_sources)
57HBHEADERS += $(HB_FT_headers)
58endif
59
60if HAVE_GRAPHITE2
61HBCFLAGS += $(GRAPHITE2_CFLAGS)
62HBLIBS   += $(GRAPHITE2_LIBS)
63HBDEPS   += $(GRAPHITE2_DEPS)
64HBSOURCES += $(HB_GRAPHITE2_sources)
65HBHEADERS += $(HB_GRAPHITE2_headers)
66endif
67
68if HAVE_UNISCRIBE
69HBCFLAGS += $(UNISCRIBE_CFLAGS)
70HBNONPCLIBS += $(UNISCRIBE_LIBS)
71HBSOURCES += $(HB_UNISCRIBE_sources)
72HBHEADERS += $(HB_UNISCRIBE_headers)
73endif
74
75if HAVE_DIRECTWRITE
76HBCFLAGS += $(DIRECTWRITE_CXXFLAGS)
77HBNONPCLIBS += $(DIRECTWRITE_LIBS)
78HBSOURCES += $(HB_DIRECTWRITE_sources)
79HBHEADERS += $(HB_DIRECTWRITE_headers)
80endif
81
82if HAVE_GDI
83HBCFLAGS += $(GDI_CXXFLAGS)
84HBNONPCLIBS += $(GDI_LIBS)
85HBSOURCES += $(HB_GDI_sources)
86HBHEADERS += $(HB_GDI_headers)
87endif
88
89if HAVE_CORETEXT
90HBCFLAGS += $(CORETEXT_CFLAGS)
91HBNONPCLIBS += $(CORETEXT_LIBS)
92HBSOURCES += $(HB_CORETEXT_sources)
93HBHEADERS += $(HB_CORETEXT_headers)
94endif
95
96
97BUILT_SOURCES += \
98	hb-version.h
99
100$(srcdir)/hb-version.h: hb-version.h.in $(top_srcdir)/configure.ac
101	$(AM_V_GEN) $(SED) \
102		-e 's/[@]HB_VERSION_MAJOR@/$(HB_VERSION_MAJOR)/' \
103		-e 's/[@]HB_VERSION_MINOR@/$(HB_VERSION_MINOR)/' \
104		-e 's/[@]HB_VERSION_MICRO@/$(HB_VERSION_MICRO)/' \
105		-e 's/[@]HB_VERSION@/$(HB_VERSION)/' \
106		"$<" > "$@" || ($(RM) "$@"; false)
107
108# Put the library together
109
110HBLIBS += $(HBNONPCLIBS)
111
112if OS_WIN32
113export_symbols = -export-symbols harfbuzz.def
114harfbuzz_def_dependency = harfbuzz.def
115export_symbols_subset = -export-symbols harfbuzz-subset.def
116harfbuzz_subset_def_dependency = harfbuzz-subset.def
117export_symbols_icu = -export-symbols harfbuzz-icu.def
118harfbuzz_icu_def_dependency = harfbuzz-icu.def
119export_symbols_gobject = -export-symbols harfbuzz-gobject.def
120harfbuzz_gobject_def_dependency = harfbuzz-gobject.def
121chosen_linker = $(CXXLINK)
122else
123if WITH_LIBSTDCXX
124chosen_linker = $(CXXLINK)
125else
126if HAVE_GCC
127# Use a C linker for GCC, not C++; Don't link to libstdc++
128chosen_linker = $(LINK)
129else
130chosen_linker = $(CXXLINK)
131endif
132endif
133endif
134
135@CODE_COVERAGE_RULES@
136
137base_link_flags = $(AM_LDFLAGS) -lm -version-info $(HB_LIBTOOL_VERSION_INFO) -no-undefined
138libharfbuzz_la_LINK = $(chosen_linker) $(libharfbuzz_la_LDFLAGS)
139libharfbuzz_la_SOURCES = $(HBSOURCES) $(HBHEADERS)
140libharfbuzz_la_CPPFLAGS = $(HBCFLAGS) $(CODE_COVERAGE_CFLAGS)
141libharfbuzz_la_LDFLAGS = $(base_link_flags) $(export_symbols) $(CODE_COVERAGE_LDFLAGS)
142libharfbuzz_la_LIBADD = $(HBLIBS)
143EXTRA_libharfbuzz_la_DEPENDENCIES = $(harfbuzz_def_dependency)
144pkginclude_HEADERS = $(HBHEADERS)
145nodist_pkginclude_HEADERS =
146pkgconfigdir = $(libdir)/pkgconfig
147pkgconfig_DATA = harfbuzz.pc
148cmakedir = $(libdir)/cmake/harfbuzz
149cmake_DATA = harfbuzz-config.cmake
150EXTRA_DIST += hb-version.h.in harfbuzz.pc.in harfbuzz-config.cmake.in
151
152lib_LTLIBRARIES += libharfbuzz-subset.la
153libharfbuzz_subset_la_LINK = $(chosen_linker) $(libharfbuzz_subset_la_LDFLAGS)
154libharfbuzz_subset_la_SOURCES = $(HB_SUBSET_sources)
155libharfbuzz_subset_la_CPPFLAGS = $(HBCFLAGS) $(CODE_COVERAGE_CFLAGS)
156libharfbuzz_subset_la_LDFLAGS = $(base_link_flags) $(export_symbols_subset) $(CODE_COVERAGE_LDFLAGS)
157libharfbuzz_subset_la_LIBADD = libharfbuzz.la
158EXTRA_libharfbuzz_subset_la_DEPENDENCIES = $(harfbuzz_subset_def_dependency)
159pkginclude_HEADERS += $(HB_SUBSET_headers)
160pkgconfig_DATA += harfbuzz-subset.pc
161EXTRA_DIST += harfbuzz-subset.pc.in
162
163if HAVE_ICU
164if HAVE_ICU_BUILTIN
165HBCFLAGS += $(ICU_CFLAGS)
166HBLIBS += $(ICU_LIBS)
167HBSOURCES += $(HB_ICU_sources)
168HBHEADERS += $(HB_ICU_headers)
169else
170lib_LTLIBRARIES += libharfbuzz-icu.la
171libharfbuzz_icu_la_SOURCES = $(HB_ICU_sources)
172libharfbuzz_icu_la_CPPFLAGS = $(HBCFLAGS) $(ICU_CFLAGS) $(CODE_COVERAGE_CFLAGS)
173libharfbuzz_icu_la_LDFLAGS = $(base_link_flags) $(export_symbols_icu) $(CODE_COVERAGE_LDFLAGS)
174libharfbuzz_icu_la_LIBADD = $(ICU_LIBS) libharfbuzz.la
175EXTRA_libharfbuzz_icu_la_DEPENDENCIES = $(harfbuzz_icu_def_dependency)
176pkginclude_HEADERS += $(HB_ICU_headers)
177pkgconfig_DATA += harfbuzz-icu.pc
178endif
179endif
180EXTRA_DIST += harfbuzz-icu.pc.in
181
182if HAVE_GOBJECT
183lib_LTLIBRARIES += libharfbuzz-gobject.la
184libharfbuzz_gobject_la_LINK = $(chosen_linker) $(libharfbuzz_gobject_la_LDFLAGS)
185libharfbuzz_gobject_la_SOURCES = $(HB_GOBJECT_DIST_sources)
186nodist_libharfbuzz_gobject_la_SOURCES = $(HB_GOBJECT_NODIST_sources)
187libharfbuzz_gobject_la_CPPFLAGS = $(HBCFLAGS) $(GOBJECT_CFLAGS) $(CODE_COVERAGE_CFLAGS)
188libharfbuzz_gobject_la_LDFLAGS = $(base_link_flags) $(CODE_COVERAGE_LDFLAGS)
189libharfbuzz_gobject_la_LIBADD = $(GOBJECT_LIBS) libharfbuzz.la
190EXTRA_libharfbuzz_gobject_la_DEPENDENCIES = $(harfbuzz_gobject_def_dependency)
191pkginclude_HEADERS += $(HB_GOBJECT_DIST_headers)
192nodist_pkginclude_HEADERS += $(HB_GOBJECT_NODIST_headers)
193pkgconfig_DATA += harfbuzz-gobject.pc
194
195BUILT_SOURCES += \
196	$(HB_GOBJECT_ENUM_sources) \
197	$(HB_GOBJECT_ENUM_headers) \
198	$(NULL)
199DISTCLEANFILES += \
200	$(HB_GOBJECT_ENUM_sources) \
201	$(HB_GOBJECT_ENUM_headers) \
202	$(NULL)
203hb-gobject-enums.%: hb-gobject-enums.%.tmpl $(HBHEADERS)
204	$(AM_V_GEN) PYTHONIOENCODING=UTF-8 $(GLIB_MKENUMS) \
205		--identifier-prefix hb_ --symbol-prefix hb_gobject \
206		--template $^ | \
207	sed 's/_t_get_type/_get_type/g; s/_T (/ (/g' > "$@" \
208	|| ($(RM) "$@"; false)
209endif
210EXTRA_DIST += \
211	harfbuzz-gobject.pc.in \
212	hb-gobject-enums.cc.tmpl \
213	hb-gobject-enums.h.tmpl \
214	$(NULL)
215
216
217%.pc: %.pc.in $(top_builddir)/config.status
218	$(AM_V_GEN) \
219	$(SED)	-e 's@%prefix%@$(prefix)@g' \
220		-e 's@%exec_prefix%@$(exec_prefix)@g' \
221		-e 's@%libdir%@$(libdir)@g' \
222		-e 's@%includedir%@$(includedir)@g' \
223		-e 's@%libs_private%@$(HBNONPCLIBS)@g' \
224		-e 's@%requires_private%@$(HBDEPS)@g' \
225		-e 's@%VERSION%@$(VERSION)@g' \
226	"$<" > "$@" \
227	|| ($(RM) "$@"; false)
228
229CLEANFILES += $(pkgconfig_DATA)
230
231
232DEF_FILES = harfbuzz.def harfbuzz-subset.def harfbuzz-icu.def harfbuzz-deprecated-symbols.txt
233if HAVE_GOBJECT
234DEF_FILES += harfbuzz-gobject.def
235endif
236check: $(DEF_FILES) # For check-symbols.sh
237CLEANFILES += $(DEF_FILES)
238harfbuzz.def: $(top_builddir)/config.status
239harfbuzz.def: $(HBHEADERS)
240	$(AM_V_GEN) $(srcdir)/gen-def.py "$@" $^
241harfbuzz-subset.def: $(HB_SUBSET_headers)
242	$(AM_V_GEN) $(srcdir)/gen-def.py "$@" $^
243harfbuzz-icu.def: $(HB_ICU_headers)
244	$(AM_V_GEN) $(srcdir)/gen-def.py "$@" $^
245harfbuzz-gobject.def: $(HB_GOBJECT_headers)
246	$(AM_V_GEN) $(srcdir)/gen-def.py "$@" $^
247harfbuzz-deprecated-symbols.txt: $(srcdir)/hb-deprecated.h
248	$(AM_V_GEN) PLAIN_LIST=1 $(srcdir)/gen-def.py "$@" $^
249
250
251GENERATORS = \
252	gen-arabic-joining-list.py \
253	gen-arabic-table.py \
254	gen-def.py \
255	gen-emoji-table.py \
256	gen-harfbuzzcc.py \
257	gen-hb-version.py \
258	gen-indic-table.py \
259	gen-os2-unicode-ranges.py \
260	gen-ragel-artifacts.py \
261	gen-tag-table.py \
262	gen-ucd-table.py \
263	gen-use-table.py \
264	gen-vowel-constraints.py \
265	$(NULL)
266EXTRA_DIST += $(GENERATORS)
267
268built-sources: $(BUILT_SOURCES)
269
270.PHONY: built-sources
271
272RAGEL_GENERATED = \
273	$(patsubst %,$(srcdir)/%,$(HB_BASE_RAGEL_GENERATED_sources)) \
274	$(NULL)
275BUILT_SOURCES += $(RAGEL_GENERATED)
276EXTRA_DIST += \
277	$(HB_BASE_RAGEL_sources) \
278	$(NULL)
279# We decided to add ragel-generated files to git...
280#MAINTAINERCLEANFILES += $(RAGEL_GENERATED)
281$(srcdir)/%.hh: $(srcdir)/%.rl
282	$(AM_V_GEN)(cd $(srcdir) && $(RAGEL) -e -F1 -o "$*.hh" "$*.rl") \
283	|| ($(RM) "$@"; false)
284
285harfbuzz.cc: Makefile.sources
286	$(AM_V_GEN) \
287	for f in \
288		$(HB_BASE_sources) \
289		$(HB_GLIB_sources) \
290		$(HB_FT_sources) \
291		$(HB_GRAPHITE2_sources) \
292		$(HB_UNISCRIBE_sources) \
293		$(HB_GDI_sources) \
294		$(HB_DIRECTWRITE_sources) \
295		$(HB_CORETEXT_sources) \
296		; do echo '#include "'$$f'"'; done | \
297	grep '[.]cc"' > $(srcdir)/harfbuzz.cc \
298	|| ($(RM) $(srcdir)/harfbuzz.cc; false)
299BUILT_SOURCES += harfbuzz.cc
300
301noinst_PROGRAMS = \
302	main \
303	test \
304	test-buffer-serialize \
305	test-ot-meta \
306	test-ot-name \
307	test-ot-glyphname \
308	test-gpos-size-params \
309	test-gsub-would-substitute \
310	$(NULL)
311bin_PROGRAMS =
312
313main_SOURCES = main.cc
314main_CPPFLAGS = $(HBCFLAGS)
315main_LDADD = libharfbuzz.la $(HBLIBS)
316
317test_SOURCES = test.cc
318test_CPPFLAGS = $(HBCFLAGS) $(FREETYPE_CFLAGS)
319test_LDADD = libharfbuzz.la $(HBLIBS) $(FREETYPE_LIBS)
320
321test_buffer_serialize_SOURCES = test-buffer-serialize.cc
322test_buffer_serialize_CPPFLAGS = $(HBCFLAGS)
323test_buffer_serialize_LDADD = libharfbuzz.la $(HBLIBS)
324
325test_ot_meta_SOURCES = test-ot-meta.cc
326test_ot_meta_CPPFLAGS = $(HBCFLAGS)
327test_ot_meta_LDADD = libharfbuzz.la $(HBLIBS)
328
329test_ot_name_SOURCES = test-ot-name.cc
330test_ot_name_CPPFLAGS = $(HBCFLAGS)
331test_ot_name_LDADD = libharfbuzz.la $(HBLIBS)
332
333test_ot_glyphname_SOURCES = test-ot-glyphname.cc
334test_ot_glyphname_CPPFLAGS = $(HBCFLAGS)
335test_ot_glyphname_LDADD = libharfbuzz.la $(HBLIBS)
336
337test_gpos_size_params_SOURCES = test-gpos-size-params.cc
338test_gpos_size_params_CPPFLAGS = $(HBCFLAGS)
339test_gpos_size_params_LDADD = libharfbuzz.la $(HBLIBS)
340
341test_gsub_would_substitute_SOURCES = test-gsub-would-substitute.cc
342test_gsub_would_substitute_CPPFLAGS = $(HBCFLAGS) $(FREETYPE_CFLAGS)
343test_gsub_would_substitute_LDADD = libharfbuzz.la $(HBLIBS) $(FREETYPE_LIBS)
344
345COMPILED_TESTS = test-algs test-array test-iter test-meta test-number test-ot-tag test-priority-queue test-unicode-ranges test-bimap test-repacker
346COMPILED_TESTS_CPPFLAGS = $(HBCFLAGS) -DMAIN -UNDEBUG
347COMPILED_TESTS_LDADD = libharfbuzz.la $(HBLIBS)
348check_PROGRAMS += $(COMPILED_TESTS)
349TESTS += $(COMPILED_TESTS)
350
351test_algs_SOURCES = test-algs.cc hb-static.cc
352test_algs_CPPFLAGS = $(COMPILED_TESTS_CPPFLAGS)
353test_algs_LDADD = $(COMPILED_TESTS_LDADD)
354
355test_array_SOURCES = test-array.cc
356test_array_CPPFLAGS = $(HBCFLAGS)
357test_array_LDADD = libharfbuzz.la $(HBLIBS)
358
359test_priority_queue_SOURCES = test-priority-queue.cc hb-static.cc
360test_priority_queue_CPPFLAGS = $(HBCFLAGS)
361test_priority_queue_LDADD = libharfbuzz.la $(HBLIBS)
362
363test_repacker_SOURCES = test-repacker.cc hb-static.cc
364test_repacker_CPPFLAGS = $(HBCFLAGS)
365test_repacker_LDADD = libharfbuzz.la libharfbuzz-subset.la $(HBLIBS)
366
367test_iter_SOURCES = test-iter.cc hb-static.cc
368test_iter_CPPFLAGS = $(COMPILED_TESTS_CPPFLAGS)
369test_iter_LDADD = $(COMPILED_TESTS_LDADD)
370
371test_meta_SOURCES = test-meta.cc hb-static.cc
372test_meta_CPPFLAGS = $(COMPILED_TESTS_CPPFLAGS)
373test_meta_LDADD = $(COMPILED_TESTS_LDADD)
374
375test_number_SOURCES = test-number.cc hb-number.cc
376test_number_CPPFLAGS = $(COMPILED_TESTS_CPPFLAGS)
377test_number_LDADD = $(COMPILED_TESTS_LDADD)
378
379test_ot_tag_SOURCES = hb-ot-tag.cc
380test_ot_tag_CPPFLAGS = $(COMPILED_TESTS_CPPFLAGS)
381test_ot_tag_LDADD = $(COMPILED_TESTS_LDADD)
382
383test_unicode_ranges_SOURCES = test-unicode-ranges.cc
384test_unicode_ranges_CPPFLAGS = $(COMPILED_TESTS_CPPFLAGS)
385test_unicode_ranges_LDADD = $(COMPILED_TESTS_LDADD)
386
387test_bimap_SOURCES = test-bimap.cc hb-static.cc
388test_bimap_CPPFLAGS = $(COMPILED_TESTS_CPPFLAGS)
389test_bimap_LDADD = $(COMPILED_TESTS_LDADD)
390
391dist_check_SCRIPTS = \
392	check-c-linkage-decls.py \
393	check-externs.py \
394	check-header-guards.py \
395	check-includes.py \
396	check-static-inits.py \
397	check-symbols.py \
398	$(NULL)
399TESTS += $(dist_check_SCRIPTS)
400
401if !WITH_LIBSTDCXX
402dist_check_SCRIPTS += \
403	check-libstdc++.py \
404	$(NULL)
405endif
406
407TESTS_ENVIRONMENT = \
408	srcdir="$(srcdir)" \
409	builddir="$(builddir)" \
410	MAKE="$(MAKE) $(AM_MAKEFLAGS)" \
411	HBSOURCES="$(HBSOURCES)" \
412	HBHEADERS="$(HBHEADERS)" \
413	$(NULL)
414
415if HAVE_INTROSPECTION
416
417-include $(INTROSPECTION_MAKEFILE)
418INTROSPECTION_GIRS = HarfBuzz-0.0.gir # What does the 0 mean anyway?!
419INTROSPECTION_SCANNER_ARGS = \
420	-I$(srcdir) \
421	--warn-all --verbose \
422	--namespace=HarfBuzz \
423	--nsversion=0.0 \
424	--symbol-prefix=hb \
425	--symbol-prefix=hb_gobject \
426	--identifier-prefix=hb_ \
427	--pkg-export=harfbuzz-gobject \
428	--c-include=hb-gobject.h
429INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
430INTROSPECTION_SCANNER_ENV = CC="$(CC)"
431
432HarfBuzz-0.0.gir: libharfbuzz.la libharfbuzz-gobject.la
433HarfBuzz_0_0_gir_INCLUDES = GObject-2.0
434HarfBuzz_0_0_gir_CFLAGS = \
435	$(INCLUDES) \
436	$(HBCFLAGS) \
437	-DHB_NO_SINGLE_HEADER_ERROR \
438	-DHAVE_GOBJECT \
439	-DHB_EXTERN= \
440	$(NULL)
441HarfBuzz_0_0_gir_LIBS = \
442	libharfbuzz.la \
443	libharfbuzz-gobject.la \
444	$(NULL)
445HarfBuzz_0_0_gir_FILES = \
446	$(HBHEADERS) \
447	$(HBSOURCES) \
448	$(HB_GOBJECT_sources) \
449	$(HB_GOBJECT_headers) \
450	$(NULL)
451
452girdir = $(datadir)/gir-1.0
453gir_DATA = $(INTROSPECTION_GIRS)
454
455typelibdir = $(libdir)/girepository-1.0
456typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
457
458CLEANFILES += $(gir_DATA) $(typelib_DATA)
459
460endif
461
462-include $(top_srcdir)/git.mk
463