1#
2# fontconfig/src/Makefile.am
3#
4# Copyright © 2003 Keith Packard
5#
6# Permission to use, copy, modify, distribute, and sell this software and its
7# documentation for any purpose is hereby granted without fee, provided that
8# the above copyright notice appear in all copies and that both that
9# copyright notice and this permission notice appear in supporting
10# documentation, and that the name of the author(s) not be used in
11# advertising or publicity pertaining to distribution of the software without
12# specific, written prior permission.  The authors make no
13# representations about the suitability of this software for any purpose.  It
14# is provided "as is" without express or implied warranty.
15#
16# THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18# EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22# PERFORMANCE OF THIS SOFTWARE.
23
24EXTRA_DIST =
25
26if OS_WIN32
27
28export_symbols = -export-symbols fontconfig.def
29
30fontconfig_def_dependency = fontconfig.def
31
32# gcc import library install/uninstall
33
34install-libtool-import-lib: libfontconfig.la
35	$(MKDIR_P) $(DESTDIR)$(libdir)
36	$(INSTALL) .libs/libfontconfig.dll.a $(DESTDIR)$(libdir)/libfontconfig.dll.a
37	$(INSTALL) fontconfig.def $(DESTDIR)$(libdir)/fontconfig.def
38
39uninstall-libtool-import-lib:
40	$(RM) $(DESTDIR)$(libdir)/libfontconfig.dll.a $(DESTDIR)$(libdir)/fontconfig.def
41
42else
43
44install-libtool-import-lib:
45uninstall-libtool-import-lib:
46
47fontconfig_def_dependency =
48
49endif
50
51if MS_LIB_AVAILABLE
52
53# Microsoft import library install/uninstall
54
55noinst_DATA = fontconfig.lib
56
57fontconfig.lib : libfontconfig.la
58	lib -name:libfontconfig-@LIBT_CURRENT_MINUS_AGE@.dll -def:fontconfig.def -out:$@
59
60install-ms-import-lib:
61	$(INSTALL) fontconfig.lib $(DESTDIR)$(libdir)
62
63uninstall-ms-import-lib:
64	$(RM) $(DESTDIR)$(libdir)/fontconfig.lib
65
66else
67
68install-ms-import-lib:
69uninstall-ms-import-lib:
70
71endif
72
73AM_CPPFLAGS = 						\
74	-I$(top_srcdir)					\
75	-I$(top_srcdir)/src				\
76	$(FREETYPE_CFLAGS)				\
77	$(ICONV_CFLAGS)					\
78	$(LIBXML2_CFLAGS)				\
79	$(EXPAT_CFLAGS)					\
80	$(WARN_CFLAGS)					\
81	-DFC_CACHEDIR='"$(FC_CACHEDIR)"'                \
82	-DFONTCONFIG_PATH='"$(BASECONFIGDIR)"'
83
84EXTRA_DIST += makealias
85
86noinst_HEADERS=fcint.h fcftint.h fcdeprecate.h fcstdint.h
87
88ALIAS_FILES = fcalias.h fcaliastail.h fcftalias.h fcftaliastail.h
89
90BUILT_SOURCES = $(ALIAS_FILES) \
91	../fc-case/fccase.h \
92	../fc-glyphname/fcglyphname.h \
93	../fc-lang/fclang.h \
94	stamp-fcstdint \
95	fcobjshash.h \
96	fcobjshash.gperf
97
98noinst_PROGRAMS = fcarch
99
100../fc-case/fccase.h:
101	cd ../fc-case && $(MAKE) $(AM_MAKEFLAGS) fccase.h
102../fc-glyphname/fcglyphname.h:
103	cd ../fc-glyphname && $(MAKE) $(AM_MAKEFLAGS) fcglyphname.h
104../fc-lang/fclang.h:
105	cd ../fc-lang && $(MAKE) $(AM_MAKEFLAGS) fclang.h
106
107fcobjshash.gperf: fcobjshash.gperf.h fcobjs.h
108	$(AM_V_GEN) $(CPP) -I$(top_srcdir) $< | \
109	$(SED) 's/^ *//;s/ *, */,/' | \
110	$(GREP) '^[^#]' | \
111	awk ' \
112		/CUT_OUT_BEGIN/ { no_write=1; next; }; \
113		/CUT_OUT_END/ { no_write=0; next; }; \
114		{ if (!no_write) print; next; }; \
115	' - > $@.tmp && \
116	mv -f $@.tmp $@ || ( $(RM) $@.tmp && false )
117
118fcobjshash.h: fcobjshash.gperf
119	$(AM_V_GEN) $(GPERF) -m 100 $< > $@.tmp && \
120	mv -f $@.tmp $@ || ( $(RM) $@.tmp && false )
121
122EXTRA_DIST += \
123	fcobjshash.gperf.h \
124	fcobjshash.gperf \
125	fcobjshash.h
126
127libfontconfig_la_SOURCES = \
128	fcarch.h \
129	fcatomic.c \
130	fcatomic.h \
131	fcblanks.c \
132	fccache.c \
133	fccfg.c \
134	fccharset.c \
135	fccompat.c \
136	fcdbg.c \
137	fcdefault.c \
138	fcdir.c \
139	fcformat.c \
140	fcfreetype.c \
141	fcfs.c \
142	fchash.c \
143	fcinit.c \
144	fclang.c \
145	fclist.c \
146	fcmatch.c \
147	fcmatrix.c \
148	fcmutex.h \
149	fcname.c \
150	fcobjs.c \
151	fcobjs.h \
152	fcobjshash.h \
153	fcpat.c \
154	fcserialize.c \
155	fcstat.c \
156	fcstr.c \
157	fcwindows.h \
158	fcxml.c \
159	ftglue.h \
160	ftglue.c
161
162lib_LTLIBRARIES = libfontconfig.la
163
164libfontconfig_la_LDFLAGS =			\
165	-version-info @LIBT_VERSION_INFO@ -no-undefined $(export_symbols)
166
167libfontconfig_la_LIBADD = $(ICONV_LIBS) $(FREETYPE_LIBS) $(LIBXML2_LIBS) $(EXPAT_LIBS)
168
169libfontconfig_la_DEPENDENCIES = $(fontconfig_def_dependency)
170
171if ENABLE_SHARED
172install-data-local: install-ms-import-lib install-libtool-import-lib
173
174uninstall-local: uninstall-ms-import-lib uninstall-libtool-import-lib
175endif
176
177PUBLIC_FILES = \
178	$(top_srcdir)/fontconfig/fontconfig.h \
179	$(top_srcdir)/src/fcdeprecate.h \
180	$(top_srcdir)/fontconfig/fcprivate.h
181
182PUBLIC_FT_FILES = \
183	$(top_srcdir)/fontconfig/fcfreetype.h
184
185fcaliastail.h: fcalias.h
186
187fcalias.h: $(top_srcdir)/src/makealias $(PUBLIC_FILES)
188	$(AM_V_GEN) sh $(top_srcdir)/src/makealias "$(top_srcdir)/src" fcalias.h fcaliastail.h $(PUBLIC_FILES)
189
190fcftaliastail.h: fcftalias.h
191
192fcftalias.h: $(top_srcdir)/src/makealias $(PUBLIC_FT_FILES)
193	$(AM_V_GEN) sh $(top_srcdir)/src/makealias "$(top_srcdir)/src" fcftalias.h fcftaliastail.h $(PUBLIC_FT_FILES)
194
195stamp-fcstdint: $(top_builddir)/config.status
196	$(AM_V_GEN) cd $(top_builddir) &&	\
197	$(SHELL) ./config.status src/fcstdint.h
198	@touch $@
199
200CLEANFILES = $(ALIAS_FILES) fontconfig.def
201DISTCLEANFILES = stamp-fcstdint fcstdint.h
202
203fontconfig.def: $(PUBLIC_FILES) $(PUBLIC_FT_FILES)
204	echo Generating $@
205	(echo EXPORTS; \
206	(cat $(PUBLIC_FILES) $(PUBLIC_FT_FILES) || echo 'FcERROR ()' ) | \
207	$(GREP) '^Fc[^ ]* *(' | $(SED) -e 's/ *(.*$$//' -e 's/^/	/' | \
208	sort; \
209	echo LIBRARY libfontconfig-@LIBT_CURRENT_MINUS_AGE@.dll; \
210	echo VERSION @LIBT_CURRENT@.@LIBT_REVISION@) >$@
211	@ ! $(GREP) -q FcERROR $@ || ($(RM) $@; false)
212
213-include $(top_srcdir)/git.mk
214