Makefile.am 5.86 KB
Newer Older
1
#
Behdad Esfahbod's avatar
Behdad Esfahbod committed
2
# fontconfig/src/Makefile.am
3 4 5 6 7 8 9
#
# Copyright © 2003 Keith Packard
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# 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 14 15
# representations about the suitability of this software for any purpose.  It
# is provided "as is" without express or implied warranty.
#
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 20 21 22 23
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.

24 25
EXTRA_DIST =

Tor Lillqvist's avatar
Tor Lillqvist committed
26 27 28 29
if OS_WIN32

export_symbols = -export-symbols fontconfig.def

30 31
fontconfig_def_dependency = fontconfig.def

Tor Lillqvist's avatar
Tor Lillqvist committed
32 33
# gcc import library install/uninstall

34 35 36
install-libtool-import-lib: libfontconfig.la
	$(MKDIR_P) $(DESTDIR)$(libdir)
	$(INSTALL) .libs/libfontconfig.dll.a $(DESTDIR)$(libdir)/libfontconfig.dll.a
Tor Lillqvist's avatar
Tor Lillqvist committed
37
	$(INSTALL) fontconfig.def $(DESTDIR)$(libdir)/fontconfig.def
Tor Lillqvist's avatar
Tor Lillqvist committed
38 39

uninstall-libtool-import-lib:
40
	$(RM) $(DESTDIR)$(libdir)/libfontconfig.dll.a $(DESTDIR)$(libdir)/fontconfig.def
Tor Lillqvist's avatar
Tor Lillqvist committed
41 42 43 44 45 46

else

install-libtool-import-lib:
uninstall-libtool-import-lib:

47 48
fontconfig_def_dependency = 

Tor Lillqvist's avatar
Tor Lillqvist committed
49 50 51 52 53 54 55 56 57
endif

if MS_LIB_AVAILABLE

# Microsoft import library install/uninstall

noinst_DATA = fontconfig.lib

fontconfig.lib : libfontconfig.la
58
	lib -name:libfontconfig-@LIBT_CURRENT_MINUS_AGE@.dll -def:fontconfig.def -out:$@
Tor Lillqvist's avatar
Tor Lillqvist committed
59 60 61 62 63

install-ms-import-lib:
	$(INSTALL) fontconfig.lib $(DESTDIR)$(libdir)

uninstall-ms-import-lib:
64
	$(RM) $(DESTDIR)$(libdir)/fontconfig.lib
Tor Lillqvist's avatar
Tor Lillqvist committed
65 66 67

else

68 69
install-ms-import-lib:
uninstall-ms-import-lib:
Tor Lillqvist's avatar
Tor Lillqvist committed
70 71 72

endif

73
AM_CPPFLAGS = 						\
74 75
	-I$(top_srcdir)					\
	-I$(top_srcdir)/src				\
Keith Packard's avatar
Keith Packard committed
76
	$(FREETYPE_CFLAGS)				\
77
	$(ICONV_CFLAGS)					\
78
	$(LIBXML2_CFLAGS)				\
Keith Packard's avatar
Keith Packard committed
79
	$(EXPAT_CFLAGS)					\
80
	$(UUID_CFLAGS)					\
81
	$(WARN_CFLAGS)					\
82
	-DFC_CACHEDIR='"$(FC_CACHEDIR)"'                \
83 84
	-DFONTCONFIG_PATH='"$(BASECONFIGDIR)"'		\
	-DFC_TEMPLATEDIR='"$(TEMPLATEDIR)"'
85
LDADD  = $(LIBINTL)
Tor Lillqvist's avatar
Tor Lillqvist committed
86

87
EXTRA_DIST += makealias
Tor Lillqvist's avatar
Tor Lillqvist committed
88

89
noinst_HEADERS=fcint.h fcftint.h fcdeprecate.h fcstdint.h
90

91
ALIAS_FILES = fcalias.h fcaliastail.h fcftalias.h fcftaliastail.h
92

93 94
BUILT_SOURCES = $(ALIAS_FILES) \
	../fc-case/fccase.h \
95
	../fc-lang/fclang.h \
96
	stamp-fcstdint \
Akira TAGOH's avatar
Akira TAGOH committed
97
	$(builddir)/fcobjshash.h \
Behdad Esfahbod's avatar
Behdad Esfahbod committed
98
	fcobjshash.gperf
99

100 101
noinst_PROGRAMS = fcarch

102 103 104 105
../fc-case/fccase.h:
	cd ../fc-case && $(MAKE) $(AM_MAKEFLAGS) fccase.h
../fc-lang/fclang.h:
	cd ../fc-lang && $(MAKE) $(AM_MAKEFLAGS) fclang.h
106

107 108 109 110 111
fcobjshash.gperf: Makefile stamp-fcobjshash.gperf
	-@$(RM) stamp-fcobjshash.gperf
	@$(MAKE) stamp-fcobjshash.gperf
	@touch -r stamp-fcobjshash.gperf $@
stamp-fcobjshash.gperf: fcobjshash.gperf.h fcobjs.h
112
	$(AM_V_GEN) $(CPP) -I$(top_srcdir) $(CPPFLAGS) $< | \
113 114 115 116
	$(SED) 's/^ *//;s/ *, */,/' | \
	awk ' \
		/CUT_OUT_BEGIN/ { no_write=1; next; }; \
		/CUT_OUT_END/ { no_write=0; next; }; \
117
		/^$$/||/^#/ { next; }; \
118 119
		{ if (!no_write) print; next; }; \
	' - > $@.tmp && \
120
	mv -f $@.tmp fcobjshash.gperf && touch $@ || ( $(RM) $@.tmp && false )
121

Akira TAGOH's avatar
Akira TAGOH committed
122
$(builddir)/fcobjshash.h: Makefile fcobjshash.gperf
Behdad Esfahbod's avatar
Behdad Esfahbod committed
123
	$(AM_V_GEN) $(GPERF) --pic -m 100 fcobjshash.gperf > $@.tmp && \
124
	mv -f $@.tmp $@ || ( $(RM) $@.tmp && false )
125 126

EXTRA_DIST += \
127
	fcobjshash.gperf.h
128

Keith Packard's avatar
Keith Packard committed
129
libfontconfig_la_SOURCES = \
130
	fcarch.h \
Keith Packard's avatar
Keith Packard committed
131
	fcatomic.c \
132
	fcatomic.h \
Keith Packard's avatar
Keith Packard committed
133 134 135
	fccache.c \
	fccfg.c \
	fccharset.c \
136
	fccompat.c \
Keith Packard's avatar
Keith Packard committed
137 138 139
	fcdbg.c \
	fcdefault.c \
	fcdir.c \
140
	fcformat.c \
Keith Packard's avatar
Keith Packard committed
141 142
	fcfreetype.c \
	fcfs.c \
143
	fcptrlist.c \
144
	fchash.c \
Keith Packard's avatar
Keith Packard committed
145 146 147 148 149
	fcinit.c \
	fclang.c \
	fclist.c \
	fcmatch.c \
	fcmatrix.c \
150
	fcmutex.h \
Keith Packard's avatar
Keith Packard committed
151
	fcname.c \
152 153
	fcobjs.c \
	fcobjs.h \
Keith Packard's avatar
Keith Packard committed
154
	fcpat.c \
155
	fcrange.c \
156
	fcserialize.c \
157
	fcstat.c \
Keith Packard's avatar
Keith Packard committed
158
	fcstr.c \
159
	fcweight.c \
160
	fcwindows.h \
161 162 163
	fcxml.c \
	ftglue.h \
	ftglue.c
Tor Lillqvist's avatar
Tor Lillqvist committed
164

Keith Packard's avatar
Keith Packard committed
165 166 167
lib_LTLIBRARIES = libfontconfig.la

libfontconfig_la_LDFLAGS =			\
168
	-version-info @LIBT_VERSION_INFO@ -no-undefined $(export_symbols)
Keith Packard's avatar
Keith Packard committed
169

170
libfontconfig_la_LIBADD = $(ICONV_LIBS) $(FREETYPE_LIBS) $(LIBXML2_LIBS) $(EXPAT_LIBS) $(UUID_LIBS) $(LTLIBINTL)
Keith Packard's avatar
Keith Packard committed
171

172 173
libfontconfig_la_DEPENDENCIES = $(fontconfig_def_dependency)

174
if ENABLE_SHARED
Tor Lillqvist's avatar
Tor Lillqvist committed
175 176 177
install-data-local: install-ms-import-lib install-libtool-import-lib

uninstall-local: uninstall-ms-import-lib uninstall-libtool-import-lib
178
endif
Tor Lillqvist's avatar
Tor Lillqvist committed
179

180 181
PUBLIC_FILES = \
	$(top_srcdir)/fontconfig/fontconfig.h \
182 183
	$(top_srcdir)/src/fcdeprecate.h \
	$(top_srcdir)/fontconfig/fcprivate.h
184

185 186 187
PUBLIC_FT_FILES = \
	$(top_srcdir)/fontconfig/fcfreetype.h

188 189 190
fcaliastail.h: fcalias.h

fcalias.h: $(top_srcdir)/src/makealias $(PUBLIC_FILES)
191
	$(AM_V_GEN) sh $(top_srcdir)/src/makealias "$(top_srcdir)/src" fcalias.h fcaliastail.h $(PUBLIC_FILES)
192 193 194 195

fcftaliastail.h: fcftalias.h

fcftalias.h: $(top_srcdir)/src/makealias $(PUBLIC_FT_FILES)
196
	$(AM_V_GEN) sh $(top_srcdir)/src/makealias "$(top_srcdir)/src" fcftalias.h fcftaliastail.h $(PUBLIC_FT_FILES)
197

198 199 200 201 202
stamp-fcstdint: $(top_builddir)/config.status
	$(AM_V_GEN) cd $(top_builddir) &&	\
	$(SHELL) ./config.status src/fcstdint.h
	@touch $@

Akira TAGOH's avatar
Akira TAGOH committed
203 204 205 206 207
CLEANFILES =		\
	$(ALIAS_FILES)	\
	fontconfig.def	\
	$(builddir)/fcobjshash.h

Akira TAGOH's avatar
Akira TAGOH committed
208 209 210 211 212
DISTCLEANFILES = 	\
	stamp-fcstdint	\
	fcstdint.h	\
	stamp-fcobjshash.gperf	\
	fcobjshash.gperf
213

214
fontconfig.def: $(PUBLIC_FILES) $(PUBLIC_FT_FILES)
215 216
	echo Generating $@
	(echo EXPORTS; \
217
	(cat $(PUBLIC_FILES) $(PUBLIC_FT_FILES) || echo 'FcERROR ()' ) | \
218
	$(GREP) '^Fc[^ ]* *(' | $(SED) -e 's/ *(.*$$//' -e 's/^/	/' | \
219
	sort; \
220 221
	echo LIBRARY libfontconfig-@LIBT_CURRENT_MINUS_AGE@.dll; \
	echo VERSION @LIBT_CURRENT@.@LIBT_REVISION@) >$@
222
	@ ! $(GREP) -q FcERROR $@ || ($(RM) $@; false)
223 224

-include $(top_srcdir)/git.mk