3757cf8f3e5f55b7fd49b559afec76a85c3725ac
[platform/upstream/fontconfig.git] / src / Makefile.am
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
24 EXTRA_DIST =
25
26 if OS_WIN32
27
28 export_symbols = -export-symbols fontconfig.def
29
30 fontconfig_def_dependency = fontconfig.def
31
32 # gcc import library install/uninstall
33
34 install-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
39 uninstall-libtool-import-lib:
40         $(RM) $(DESTDIR)$(libdir)/libfontconfig.dll.a $(DESTDIR)$(libdir)/fontconfig.def
41
42 else
43
44 install-libtool-import-lib:
45 uninstall-libtool-import-lib:
46
47 fontconfig_def_dependency = 
48
49 endif
50
51 if MS_LIB_AVAILABLE
52
53 # Microsoft import library install/uninstall
54
55 noinst_DATA = fontconfig.lib
56
57 fontconfig.lib : libfontconfig.la
58         lib -name:libfontconfig-@LIBT_CURRENT_MINUS_AGE@.dll -def:fontconfig.def -out:$@
59
60 install-ms-import-lib:
61         $(INSTALL) fontconfig.lib $(DESTDIR)$(libdir)
62
63 uninstall-ms-import-lib:
64         $(RM) $(DESTDIR)$(libdir)/fontconfig.lib
65
66 else
67
68 install-ms-import-lib:
69 uninstall-ms-import-lib:
70
71 endif
72
73 AM_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
84 EXTRA_DIST += makealias
85
86 noinst_HEADERS=fcint.h fcftint.h fcdeprecate.h fcstdint.h
87
88 ALIAS_FILES = fcalias.h fcaliastail.h fcftalias.h fcftaliastail.h
89
90 BUILT_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
98 noinst_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
107 fcobjshash.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
118 fcobjshash.h: fcobjshash.gperf
119         $(AM_V_GEN) $(GPERF) -m 100 $< > $@.tmp && \
120         mv -f $@.tmp $@ || ( $(RM) $@.tmp && false )
121
122 EXTRA_DIST += \
123         fcobjshash.gperf.h \
124         fcobjshash.gperf \
125         fcobjshash.h
126
127 libfontconfig_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         fcinit.c \
143         fclang.c \
144         fclist.c \
145         fcmatch.c \
146         fcmatrix.c \
147         fcmutex.h \
148         fcname.c \
149         fcobjs.c \
150         fcobjs.h \
151         fcobjshash.h \
152         fcpat.c \
153         fcrange.c \
154         fcserialize.c \
155         fcstat.c \
156         fcstr.c \
157         fcweight.c \
158         fcwindows.h \
159         fcxml.c \
160         ftglue.h \
161         ftglue.c
162
163 lib_LTLIBRARIES = libfontconfig.la
164
165 libfontconfig_la_LDFLAGS =                      \
166         -version-info @LIBT_VERSION_INFO@ -no-undefined $(export_symbols)
167
168 libfontconfig_la_LIBADD = $(ICONV_LIBS) $(FREETYPE_LIBS) $(LIBXML2_LIBS) $(EXPAT_LIBS)
169
170 libfontconfig_la_DEPENDENCIES = $(fontconfig_def_dependency)
171
172 if ENABLE_SHARED
173 install-data-local: install-ms-import-lib install-libtool-import-lib
174
175 uninstall-local: uninstall-ms-import-lib uninstall-libtool-import-lib
176 endif
177
178 PUBLIC_FILES = \
179         $(top_srcdir)/fontconfig/fontconfig.h \
180         $(top_srcdir)/src/fcdeprecate.h \
181         $(top_srcdir)/fontconfig/fcprivate.h
182
183 PUBLIC_FT_FILES = \
184         $(top_srcdir)/fontconfig/fcfreetype.h
185
186 fcaliastail.h: fcalias.h
187
188 fcalias.h: $(top_srcdir)/src/makealias $(PUBLIC_FILES)
189         $(AM_V_GEN) sh $(top_srcdir)/src/makealias "$(top_srcdir)/src" fcalias.h fcaliastail.h $(PUBLIC_FILES)
190
191 fcftaliastail.h: fcftalias.h
192
193 fcftalias.h: $(top_srcdir)/src/makealias $(PUBLIC_FT_FILES)
194         $(AM_V_GEN) sh $(top_srcdir)/src/makealias "$(top_srcdir)/src" fcftalias.h fcftaliastail.h $(PUBLIC_FT_FILES)
195
196 stamp-fcstdint: $(top_builddir)/config.status
197         $(AM_V_GEN) cd $(top_builddir) &&       \
198         $(SHELL) ./config.status src/fcstdint.h
199         @touch $@
200
201 CLEANFILES = $(ALIAS_FILES) fontconfig.def
202 DISTCLEANFILES = stamp-fcstdint fcstdint.h
203
204 fontconfig.def: $(PUBLIC_FILES) $(PUBLIC_FT_FILES)
205         echo Generating $@
206         (echo EXPORTS; \
207         (cat $(PUBLIC_FILES) $(PUBLIC_FT_FILES) || echo 'FcERROR ()' ) | \
208         $(GREP) '^Fc[^ ]* *(' | $(SED) -e 's/ *(.*$$//' -e 's/^/        /' | \
209         sort; \
210         echo LIBRARY libfontconfig-@LIBT_CURRENT_MINUS_AGE@.dll; \
211         echo VERSION @LIBT_CURRENT@.@LIBT_REVISION@) >$@
212         @ ! $(GREP) -q FcERROR $@ || ($(RM) $@; false)
213
214 -include $(top_srcdir)/git.mk