Makefile.am 5.82 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
	$(WARN_CFLAGS)					\
81
	-DFC_CACHEDIR='"$(FC_CACHEDIR)"'                \
82 83
	-DFONTCONFIG_PATH='"$(BASECONFIGDIR)"'		\
	-DFC_TEMPLATEDIR='"$(TEMPLATEDIR)"'
84
LDADD  = $(LIBINTL)
Tor Lillqvist's avatar
Tor Lillqvist committed
85

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

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

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

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

99 100
noinst_PROGRAMS = fcarch

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

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

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

EXTRA_DIST += \
126
	fcobjshash.gperf.h
127

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

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

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

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

171 172
libfontconfig_la_DEPENDENCIES = $(fontconfig_def_dependency)

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

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

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

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

187 188 189
fcaliastail.h: fcalias.h

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

fcftaliastail.h: fcftalias.h

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

197 198 199 200 201
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
202 203 204 205 206
CLEANFILES =		\
	$(ALIAS_FILES)	\
	fontconfig.def	\
	$(builddir)/fcobjshash.h

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

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

-include $(top_srcdir)/git.mk