dba42065a6fca7c07fbd2168895d633ef1c2819a
[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: 
35         $(INSTALL) .libs/libfontconfig.dll.a $(DESTDIR)$(libdir)
36         $(INSTALL) fontconfig.def $(DESTDIR)$(libdir)/fontconfig.def
37
38 uninstall-libtool-import-lib:
39         $(RM) $(DESTDIR)$(libdir)/libfontconfig.dll.a $(DESTDIR)$(libdir)/fontconfig.def
40
41 else
42
43 install-libtool-import-lib:
44 uninstall-libtool-import-lib:
45
46 fontconfig_def_dependency = 
47
48 endif
49
50 if MS_LIB_AVAILABLE
51
52 # Microsoft import library install/uninstall
53
54 noinst_DATA = fontconfig.lib
55
56 fontconfig.lib : libfontconfig.la
57         lib -name:libfontconfig-@LIBT_CURRENT_MINUS_AGE@.dll -def:fontconfig.def -out:$@
58
59 install-ms-import-lib:
60         $(INSTALL) fontconfig.lib $(DESTDIR)$(libdir)
61
62 uninstall-ms-import-lib:
63         $(RM) $(DESTDIR)$(libdir)/fontconfig.lib
64
65 else
66
67 install-ms-import-lib:
68 uninstall-ms-import-lib:
69
70 endif
71
72 INCLUDES =                                              \
73         -I$(top_srcdir)                                 \
74         -I$(top_srcdir)/src                             \
75         $(FREETYPE_CFLAGS)                              \
76         $(ICONV_CFLAGS)                                 \
77         $(LIBXML2_CFLAGS)                               \
78         $(EXPAT_CFLAGS)                                 \
79         $(WARN_CFLAGS)                                  \
80         -DFC_CACHEDIR='"$(FC_CACHEDIR)"'                \
81         -DFONTCONFIG_PATH='"$(BASECONFIGDIR)"'
82
83 EXTRA_DIST += makealias
84
85 noinst_HEADERS=fcint.h fcftint.h fcdeprecate.h fcstdint.h
86
87 ALIAS_FILES = fcalias.h fcaliastail.h fcftalias.h fcftaliastail.h
88
89 BUILT_SOURCES = $(ALIAS_FILES) \
90         ../fc-case/fccase.h \
91         ../fc-glyphname/fcglyphname.h \
92         ../fc-lang/fclang.h \
93         stamp-fcstdint \
94         fcobjshash.h \
95         fcobjshash.gperf
96
97 noinst_PROGRAMS = fcarch
98
99 ../fc-case/fccase.h:
100         cd ../fc-case && $(MAKE) $(AM_MAKEFLAGS) fccase.h
101 ../fc-glyphname/fcglyphname.h:
102         cd ../fc-glyphname && $(MAKE) $(AM_MAKEFLAGS) fcglyphname.h
103 ../fc-lang/fclang.h:
104         cd ../fc-lang && $(MAKE) $(AM_MAKEFLAGS) fclang.h
105
106 fcobjshash.gperf: fcobjshash.gperf.h fcobjs.h
107         $(AM_V_GEN) $(CPP) -I$(top_srcdir) $< | \
108         $(SED) 's/^ *//;s/ *, */,/' | \
109         $(GREP) '^[^#]' | \
110         awk ' \
111                 /CUT_OUT_BEGIN/ { no_write=1; next; }; \
112                 /CUT_OUT_END/ { no_write=0; next; }; \
113                 { if (!no_write) print; next; }; \
114         ' - > $@.tmp && \
115         mv -f $@.tmp $@ || ( $(RM) $@.tmp && false )
116
117 fcobjshash.h: fcobjshash.gperf
118         $(AM_V_GEN) $(top_srcdir)/missing --run gperf -m 100 $< > $@.tmp && \
119         mv -f $@.tmp $@ || ( $(RM) $@.tmp && false )
120
121 EXTRA_DIST += \
122         fcobjshash.gperf.h \
123         fcobjshash.gperf \
124         fcobjshash.h
125
126 libfontconfig_la_SOURCES = \
127         fcarch.h \
128         fcatomic.c \
129         fcatomic.h \
130         fcblanks.c \
131         fccache.c \
132         fccfg.c \
133         fccharset.c \
134         fccompat.c \
135         fcdbg.c \
136         fcdefault.c \
137         fcdir.c \
138         fcformat.c \
139         fcfreetype.c \
140         fcfs.c \
141         fcinit.c \
142         fclang.c \
143         fclist.c \
144         fcmatch.c \
145         fcmatrix.c \
146         fcmutex.h \
147         fcname.c \
148         fcobjs.c \
149         fcobjs.h \
150         fcobjshash.h \
151         fcpat.c \
152         fcserialize.c \
153         fcstat.c \
154         fcstr.c \
155         fcwindows.h \
156         fcxml.c \
157         ftglue.h \
158         ftglue.c
159
160 lib_LTLIBRARIES = libfontconfig.la
161
162 libfontconfig_la_LDFLAGS =                      \
163         -version-info @LIBT_VERSION_INFO@ -no-undefined $(export_symbols)
164
165 libfontconfig_la_LIBADD = $(ICONV_LIBS) $(FREETYPE_LIBS) $(LIBXML2_LIBS) $(EXPAT_LIBS)
166
167 libfontconfig_la_DEPENDENCIES = $(fontconfig_def_dependency)
168
169 if ENABLE_SHARED
170 install-data-local: install-ms-import-lib install-libtool-import-lib
171
172 uninstall-local: uninstall-ms-import-lib uninstall-libtool-import-lib
173 endif
174
175 PUBLIC_FILES = \
176         $(top_srcdir)/fontconfig/fontconfig.h \
177         $(top_srcdir)/src/fcdeprecate.h \
178         $(top_srcdir)/fontconfig/fcprivate.h
179
180 PUBLIC_FT_FILES = \
181         $(top_srcdir)/fontconfig/fcfreetype.h
182
183 fcaliastail.h: fcalias.h
184
185 fcalias.h: $(top_srcdir)/src/makealias $(PUBLIC_FILES)
186         $(AM_V_GEN) sh $(top_srcdir)/src/makealias "$(top_srcdir)/src" fcalias.h fcaliastail.h $(PUBLIC_FILES)
187
188 fcftaliastail.h: fcftalias.h
189
190 fcftalias.h: $(top_srcdir)/src/makealias $(PUBLIC_FT_FILES)
191         $(AM_V_GEN) sh $(top_srcdir)/src/makealias "$(top_srcdir)/src" fcftalias.h fcftaliastail.h $(PUBLIC_FT_FILES)
192
193 stamp-fcstdint: $(top_builddir)/config.status
194         $(AM_V_GEN) cd $(top_builddir) &&       \
195         $(SHELL) ./config.status src/fcstdint.h
196         @touch $@
197
198 CLEANFILES = $(ALIAS_FILES) fontconfig.def
199 DISTCLEANFILES = stamp-fcstdint fcstdint.h
200
201 fontconfig.def: $(PUBLIC_FILES) $(PUBLIC_FT_FILES)
202         echo Generating $@
203         (echo EXPORTS; \
204         (cat $(PUBLIC_FILES) $(PUBLIC_FT_FILES) || echo 'FcERROR ()' ) | \
205         $(GREP) '^Fc[^ ]* *(' | $(SED) -e 's/ *(.*$$//' -e 's/^/        /' | \
206         sort; \
207         echo LIBRARY libfontconfig-@LIBT_CURRENT_MINUS_AGE@.dll; \
208         echo VERSION @LIBT_CURRENT@.@LIBT_REVISION@) >$@
209         @ ! $(GREP) -q FcERROR $@ || ($(RM) $@; false)
210
211 -include $(top_srcdir)/git.mk