• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Process this file with automake to produce Makefile.in
2
3SUBDIRS =
4DIST_SUBDIRS =
5BUILT_SOURCES =
6EXTRA_DIST =
7CLEANFILES =
8DISTCLEANFILES =
9MAINTAINERCLEANFILES =
10DISTCHECK_CONFIGURE_FLAGS = --enable-introspection
11
12# The following warning options are useful for debugging: -Wpadded
13#AM_CXXFLAGS =
14
15# Convenience targets:
16lib: $(BUILT_SOURCES) libharfbuzz.la
17fuzzing: $(BUILT_SOURCES) libharfbuzz-fuzzing.la
18
19lib_LTLIBRARIES = libharfbuzz.la
20
21include Makefile.sources
22
23HBCFLAGS =
24HBLIBS =
25HBNONPCLIBS =
26HBDEPS =
27HBSOURCES =  $(HB_BASE_sources)
28HBHEADERS = $(HB_BASE_headers)
29HBNODISTHEADERS = $(HB_NODIST_headers)
30
31if HAVE_OT
32HBSOURCES += $(HB_OT_sources)
33HBHEADERS += $(HB_OT_headers)
34endif
35
36if HAVE_FALLBACK
37HBSOURCES += $(HB_FALLBACK_sources)
38endif
39
40if HAVE_PTHREAD
41HBCFLAGS += $(PTHREAD_CFLAGS)
42HBNONPCLIBS += $(PTHREAD_LIBS)
43endif
44
45if HAVE_GLIB
46HBCFLAGS += $(GLIB_CFLAGS)
47HBLIBS   += $(GLIB_LIBS)
48HBDEPS   += $(GLIB_DEPS)
49HBSOURCES += $(HB_GLIB_sources)
50HBHEADERS += $(HB_GLIB_headers)
51endif
52
53if HAVE_FREETYPE
54HBCFLAGS += $(FREETYPE_CFLAGS)
55HBLIBS   += $(FREETYPE_LIBS)
56# XXX
57# The following creates a recursive dependency on FreeType if FreeType is
58# built with HarfBuzz support enabled.  Newer pkg-config handles that just
59# fine but pkg-config 0.26 as shipped in Ubuntu 14.04 crashes.  Remove
60# in a year or two, or otherwise work around it...
61#HBDEPS   += $(FREETYPE_DEPS)
62HBSOURCES += $(HB_FT_sources)
63HBHEADERS += $(HB_FT_headers)
64endif
65
66if HAVE_GRAPHITE2
67HBCFLAGS += $(GRAPHITE2_CFLAGS)
68HBLIBS   += $(GRAPHITE2_LIBS)
69HBDEPS   += $(GRAPHITE2_DEPS)
70HBSOURCES += $(HB_GRAPHITE2_sources)
71HBHEADERS += $(HB_GRAPHITE2_headers)
72endif
73
74if HAVE_UNISCRIBE
75HBCFLAGS += $(UNISCRIBE_CFLAGS)
76HBNONPCLIBS += $(UNISCRIBE_LIBS)
77HBSOURCES += $(HB_UNISCRIBE_sources)
78HBHEADERS += $(HB_UNISCRIBE_headers)
79endif
80
81if HAVE_DIRECTWRITE
82HBCFLAGS += $(DIRECTWRITE_CXXFLAGS)
83HBNONPCLIBS += $(DIRECTWRITE_LIBS)
84HBSOURCES += $(HB_DIRECTWRITE_sources)
85HBHEADERS += $(HB_DIRECTWRITE_headers)
86endif
87
88if HAVE_CORETEXT
89HBCFLAGS += $(CORETEXT_CFLAGS)
90HBNONPCLIBS += $(CORETEXT_LIBS)
91HBSOURCES += $(HB_CORETEXT_sources)
92HBHEADERS += $(HB_CORETEXT_headers)
93endif
94
95if HAVE_UCDN
96SUBDIRS += hb-ucdn
97HBCFLAGS += -I$(srcdir)/hb-ucdn
98HBLIBS   += hb-ucdn/libhb-ucdn.la
99HBSOURCES += $(HB_UCDN_sources)
100endif
101DIST_SUBDIRS += hb-ucdn
102
103
104# Put the library together
105
106HBLIBS += $(HBNONPCLIBS)
107
108if OS_WIN32
109export_symbols = -export-symbols harfbuzz.def
110harfbuzz_def_dependency = harfbuzz.def
111libharfbuzz_la_LINK = $(CXXLINK) $(libharfbuzz_la_LDFLAGS)
112else
113# Use a C linker for GCC, not C++; Don't link to libstdc++
114if HAVE_GCC
115libharfbuzz_la_LINK = $(LINK) $(libharfbuzz_la_LDFLAGS)
116else
117libharfbuzz_la_LINK = $(CXXLINK) $(libharfbuzz_la_LDFLAGS)
118endif
119endif
120
121libharfbuzz_la_SOURCES = $(HBSOURCES) $(HBHEADERS) $(HBNODISTHEADERS)
122libharfbuzz_la_CPPFLAGS = $(HBCFLAGS)
123libharfbuzz_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(HB_LIBTOOL_VERSION_INFO) $(export_symbols) -no-undefined
124libharfbuzz_la_LIBADD = $(HBLIBS)
125EXTRA_libharfbuzz_la_DEPENDENCIES = $(harfbuzz_def_dependency)
126pkginclude_HEADERS = $(HBHEADERS)
127nodist_pkginclude_HEADERS = $(HBNODISTHEADERS)
128pkgconfigdir = $(libdir)/pkgconfig
129pkgconfig_DATA = harfbuzz.pc
130EXTRA_DIST += harfbuzz.pc.in
131
132FUZZING_CPPFLAGS= \
133	-DHB_NDEBUG \
134	-DHB_MAX_NESTING_LEVEL=3 \
135	-DHB_SANITIZE_MAX_EDITS=3 \
136	-DHB_BUFFER_MAX_EXPANSION_FACTOR=3 \
137	-DHB_BUFFER_MAX_LEN_MIN=8 \
138	-DHB_BUFFER_MAX_LEN_DEFAULT=128 \
139	$(NULL)
140EXTRA_LTLIBRARIES = libharfbuzz-fuzzing.la
141libharfbuzz_fuzzing_la_LINK = $(libharfbuzz_la_LINK)
142libharfbuzz_fuzzing_la_SOURCES = $(libharfbuzz_la_SOURCES)
143libharfbuzz_fuzzing_la_CPPFLAGS = $(libharfbuzz_la_CPPFLAGS) $(FUZZING_CPPFLAGS)
144libharfbuzz_fuzzing_la_LDFLAGS = $(libharfbuzz_la_LDFLAGS)
145libharfbuzz_fuzzing_la_LIBADD = $(libharfbuzz_la_LIBADD)
146EXTRA_libharfbuzz_fuzzing_la_DEPENDENCIES = $(EXTRA_libharfbuzz_la_DEPENDENCIES)
147CLEANFILES += libharfbuzz-fuzzing.la
148
149if HAVE_ICU
150if HAVE_ICU_BUILTIN
151HBCFLAGS += $(ICU_CFLAGS)
152HBLIBS += $(ICU_LIBS)
153HBSOURCES += $(HB_ICU_sources)
154HBHEADERS += $(HB_ICU_headers)
155else
156lib_LTLIBRARIES += libharfbuzz-icu.la
157libharfbuzz_icu_la_SOURCES = $(HB_ICU_sources)
158libharfbuzz_icu_la_CPPFLAGS = $(ICU_CFLAGS)
159libharfbuzz_icu_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(HB_LIBTOOL_VERSION_INFO) -no-undefined
160libharfbuzz_icu_la_LIBADD = $(ICU_LIBS) libharfbuzz.la
161pkginclude_HEADERS += $(HB_ICU_headers)
162pkgconfig_DATA += harfbuzz-icu.pc
163endif
164endif
165EXTRA_DIST += harfbuzz-icu.pc.in
166
167if HAVE_GOBJECT
168lib_LTLIBRARIES += libharfbuzz-gobject.la
169libharfbuzz_gobject_la_SOURCES = $(HB_GOBJECT_sources)
170nodist_libharfbuzz_gobject_la_SOURCES = $(HB_GOBJECT_ENUM_sources)
171libharfbuzz_gobject_la_CPPFLAGS = $(GOBJECT_CFLAGS)
172libharfbuzz_gobject_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(HB_LIBTOOL_VERSION_INFO) -no-undefined
173libharfbuzz_gobject_la_LIBADD = $(GOBJECT_LIBS) libharfbuzz.la
174pkginclude_HEADERS += $(HB_GOBJECT_headers)
175nodist_pkginclude_HEADERS += $(HB_GOBJECT_ENUM_headers)
176pkgconfig_DATA += harfbuzz-gobject.pc
177
178BUILT_SOURCES += \
179	$(HB_GOBJECT_ENUM_sources) \
180	$(HB_GOBJECT_ENUM_headers) \
181	$(NULL)
182DISTCLEANFILES += \
183	$(HB_GOBJECT_ENUM_sources) \
184	$(HB_GOBJECT_ENUM_headers) \
185	$(NULL)
186hb-gobject-enums.%: hb-gobject-enums.%.tmpl $(HBHEADERS)
187	$(AM_V_GEN) $(GLIB_MKENUMS) \
188		--identifier-prefix hb_ --symbol-prefix hb_gobject \
189		--template $^ | \
190	sed 's/_t_get_type/_get_type/g; s/_T (/ (/g' > "$@" \
191	|| ($(RM) "$@"; false)
192endif
193EXTRA_DIST += \
194	harfbuzz-gobject.pc.in \
195	hb-gobject-enums.cc.tmpl \
196	hb-gobject-enums.h.tmpl \
197	$(NULL)
198
199
200%.pc: %.pc.in $(top_builddir)/config.status
201	$(AM_V_GEN) \
202	$(SED)	-e 's@%prefix%@$(prefix)@g' \
203		-e 's@%exec_prefix%@$(exec_prefix)@g' \
204		-e 's@%libdir%@$(libdir)@g' \
205		-e 's@%includedir%@$(includedir)@g' \
206		-e 's@%libs_private%@$(HBNONPCLIBS)@g' \
207		-e 's@%requires_private%@$(HBDEPS)@g' \
208		-e 's@%VERSION%@$(VERSION)@g' \
209	"$<" > "$@" \
210	|| ($(RM) "$@"; false)
211
212CLEANFILES += $(pkgconfig_DATA)
213
214
215CLEANFILES += harfbuzz.def
216harfbuzz.def: $(HBHEADERS) $(HBNODISTHEADERS)
217	$(AM_V_GEN) (echo EXPORTS; \
218	(cat $^ || echo 'hb_ERROR ()' ) | \
219	$(EGREP) '^hb_.* \(' | \
220	sed -e 's/ (.*//' | \
221	LANG=C sort; \
222	echo LIBRARY libharfbuzz-0.dll; \
223	) >"$@"
224	@ ! grep -q hb_ERROR "$@" \
225	|| ($(RM) "$@"; false)
226
227
228GENERATORS = \
229	gen-arabic-table.py \
230	gen-indic-table.py \
231	gen-use-table.py \
232	$(NULL)
233EXTRA_DIST += $(GENERATORS)
234
235unicode-tables: arabic-table indic-table use-table
236
237arabic-table: gen-arabic-table.py ArabicShaping.txt UnicodeData.txt Blocks.txt
238	$(AM_V_GEN) $(builddir)/$^ > hb-ot-shape-complex-arabic-table.hh \
239	|| ($(RM) hb-ot-shape-complex-arabic-table.hh; false)
240
241indic-table: gen-indic-table.py IndicSyllabicCategory-7.0.0.txt IndicMatraCategory-7.0.0.txt Blocks.txt
242	$(AM_V_GEN) $(builddir)/$^ > hb-ot-shape-complex-indic-table.cc \
243	|| ($(RM) hb-ot-shape-complex-indic-table.cc; false)
244
245use-table: gen-use-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt UnicodeData.txt Blocks.txt
246	$(AM_V_GEN) $(builddir)/$^ > hb-ot-shape-complex-use-table.cc \
247	|| ($(RM) hb-ot-shape-complex-use-table.cc; false)
248
249built-sources: $(BUILT_SOURCES)
250
251.PHONY: unicode-tables arabic-table indic-table use-table built-sources
252
253RAGEL_GENERATED = \
254	$(srcdir)/hb-buffer-deserialize-json.hh \
255	$(srcdir)/hb-buffer-deserialize-text.hh \
256	$(srcdir)/hb-ot-shape-complex-indic-machine.hh \
257	$(srcdir)/hb-ot-shape-complex-myanmar-machine.hh \
258	$(srcdir)/hb-ot-shape-complex-use-machine.hh \
259	$(NULL)
260BUILT_SOURCES += $(RAGEL_GENERATED)
261EXTRA_DIST += \
262	hb-buffer-deserialize-json.rl \
263	hb-buffer-deserialize-text.rl \
264	hb-ot-shape-complex-indic-machine.rl \
265	hb-ot-shape-complex-myanmar-machine.rl \
266	hb-ot-shape-complex-use-machine.rl \
267	$(NULL)
268MAINTAINERCLEANFILES += $(RAGEL_GENERATED)
269$(srcdir)/%.hh: $(srcdir)/%.rl
270	$(AM_V_GEN)(cd $(srcdir) && $(RAGEL) -e -F1 -o "$*.hh" "$*.rl") \
271	|| ($(RM) "$@"; false)
272
273noinst_PROGRAMS = \
274	main \
275	test \
276	test-buffer-serialize \
277	test-size-params \
278	test-would-substitute \
279	$(NULL)
280bin_PROGRAMS =
281
282main_SOURCES = main.cc
283main_CPPFLAGS = $(HBCFLAGS)
284main_LDADD = libharfbuzz.la $(HBLIBS)
285
286test_SOURCES = test.cc
287test_CPPFLAGS = $(HBCFLAGS) $(FREETYPE_CFLAGS)
288test_LDADD = libharfbuzz.la $(HBLIBS) $(FREETYPE_LIBS)
289
290test_would_substitute_SOURCES = test-would-substitute.cc
291test_would_substitute_CPPFLAGS = $(HBCFLAGS) $(FREETYPE_CFLAGS)
292test_would_substitute_LDADD = libharfbuzz.la $(HBLIBS) $(FREETYPE_LIBS)
293
294test_size_params_SOURCES = test-size-params.cc
295test_size_params_CPPFLAGS = $(HBCFLAGS)
296test_size_params_LDADD = libharfbuzz.la $(HBLIBS)
297
298test_buffer_serialize_SOURCES = test-buffer-serialize.cc
299test_buffer_serialize_CPPFLAGS = $(HBCFLAGS)
300test_buffer_serialize_LDADD = libharfbuzz.la $(HBLIBS)
301
302check: harfbuzz.def # For check-defs.sh
303
304dist_check_SCRIPTS = \
305	check-c-linkage-decls.sh \
306	check-defs.sh \
307	check-header-guards.sh \
308	check-includes.sh \
309	check-libstdc++.sh \
310	check-static-inits.sh \
311	check-symbols.sh \
312	$(NULL)
313
314check_PROGRAMS = \
315	test-ot-tag \
316	$(NULL)
317test_ot_tag_SOURCES = hb-ot-tag.cc
318test_ot_tag_CPPFLAGS = $(HBCFLAGS) -DMAIN
319test_ot_tag_LDADD = libharfbuzz.la $(HBLIBS)
320
321TESTS = $(dist_check_SCRIPTS) $(check_PROGRAMS)
322TESTS_ENVIRONMENT = \
323	srcdir="$(srcdir)" \
324	MAKE="$(MAKE) $(AM_MAKEFLAGS)" \
325	HBSOURCES="$(HBSOURCES)" \
326	HBHEADERS="$(HBHEADERS) $(HBNODISTHEADERS)" \
327	$(NULL)
328
329if HAVE_INTROSPECTION
330
331-include $(INTROSPECTION_MAKEFILE)
332INTROSPECTION_GIRS = HarfBuzz-0.0.gir # What does the 0 mean anyway?!
333INTROSPECTION_SCANNER_ARGS = -I$(srcdir) -n hb --identifier-prefix=hb_ --warn-all
334INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
335INTROSPECTION_SCANNER_ENV = CC="$(CC)"
336
337HarfBuzz-0.0.gir: libharfbuzz.la libharfbuzz-gobject.la
338HarfBuzz_0_0_gir_INCLUDES = GObject-2.0
339HarfBuzz_0_0_gir_CFLAGS = \
340	$(INCLUDES) \
341	$(HBCFLAGS) \
342	-DHB_H \
343	-DHB_H_IN \
344	-DHB_OT_H \
345	-DHB_OT_H_IN \
346	-DHB_GOBJECT_H \
347	-DHB_GOBJECT_H_IN \
348	-DHB_EXTERN= \
349	$(NULL)
350HarfBuzz_0_0_gir_LIBS = \
351	libharfbuzz.la \
352	libharfbuzz-gobject.la \
353	$(NULL)
354HarfBuzz_0_0_gir_FILES = \
355	$(HBHEADERS) \
356	$(HBNODISTHEADERS) \
357	$(HBSOURCES) \
358	$(HB_GOBJECT_ENUM_sources) \
359	$(HB_GOBJECT_ENUM_headers) \
360	$(HB_GOBJECT_sources) \
361	$(HB_GOBJECT_STRUCTS_headers) \
362	$(NULL)
363
364girdir = $(datadir)/gir-1.0
365gir_DATA = $(INTROSPECTION_GIRS)
366
367typelibdir = $(libdir)/girepository-1.0
368typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
369
370CLEANFILES += $(gir_DATA) $(typelib_DATA)
371
372endif
373
374-include $(top_srcdir)/git.mk
375