Make FcInitDebug() idempotent
[platform/upstream/fontconfig.git] / Makefile.am
1
2 #  fontconfig/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 DOCSRC=@DOCSRC@
25 SUBDIRS=fontconfig fc-case fc-lang fc-glyphname src \
26         fc-cache fc-cat fc-list fc-match fc-pattern fc-query fc-scan \
27         conf.d $(DOCSRC) test
28
29 AUTOMAKE_OPTIONS = dist-bzip2
30 ACLOCAL_AMFLAGS = -I m4
31
32 EXTRA_DIST = \
33         fontconfig.pc.in \
34         fonts.conf.in \
35         fonts.dtd \
36         fontconfig.spec.in \
37         fontconfig.spec \
38         fontconfig-zip.in \
39         config-fixups.h
40 CLEANFILES = fonts.conf
41 DISTCLEANFILES = config.cache doltcompile
42 MAINTAINERCLEANFILES = \
43         $(srcdir)/aclocal.m4 \
44         $(srcdir)/autoscan.log \
45         $(srcdir)/compile \
46         $(srcdir)/config.guess \
47         $(srcdir)/config.h.in \
48         $(srcdir)/config.sub \
49         $(srcdir)/configure.scan \
50         $(srcdir)/depcomp \
51         $(srcdir)/install-sh \
52         $(srcdir)/ltmain.sh \
53         $(srcdir)/missing \
54         $(srcdir)/mkinstalldirs \
55         `find "$(srcdir)" -type f -name Makefile.in -print`
56
57 pkgconfigdir=$(libdir)/pkgconfig
58 pkgconfig_DATA = fontconfig.pc
59
60 baseconfigdir = $(BASECONFIGDIR)
61 configdir = $(CONFIGDIR)
62
63 xmldir = $(XMLDIR)
64 xml_DATA = fonts.dtd
65
66 if CROSS_COMPILING
67   RUN_FC_CACHE_TEST=false
68 else
69   RUN_FC_CACHE_TEST=test -z "$(DESTDIR)"
70 endif
71
72 # Creating ChangeLog from git log:
73
74 MAINTAINERCLEANFILES += $(srcdir)/ChangeLog
75 EXTRA_DIST += ChangeLog
76 ChangeLog: $(srcdir)/ChangeLog
77 $(srcdir)/ChangeLog:
78         if test -d "$(srcdir)/.git"; then \
79           (GIT_DIR=$(top_srcdir)/.git ./missing --run git log --stat) | fmt --split-only > $@.tmp \
80           && mv -f $@.tmp $@ \
81           || ($(RM) $@.tmp; \
82               echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
83               (test -f $@ || echo git-log is required to generate this file >> $@)); \
84         else \
85           test -f $@ || \
86           (echo A git checkout and git-log is required to generate ChangeLog >&2 && \
87           echo A git checkout and git-log is required to generate this file >> $@); \
88         fi
89
90 .PHONY: ChangeLog
91
92 fonts.conf: fonts.conf.in Makefile
93         sed \
94                 -e 's,@FC_CACHEDIR\@,$(FC_CACHEDIR),g' \
95                 -e 's,@FC_DEFAULT_FONTS\@,$(FC_DEFAULT_FONTS),g' \
96                 -e 's,@FC_FONTPATH\@,$(FC_FONTPATH),g' \
97                 -e 's,@CONFIGDIR\@,$(CONFIGDIR),g' \
98                 -e 's,@PACKAGE\@,$(PACKAGE),g' \
99                 -e 's,@VERSION\@,$(VERSION),g' \
100                 $(srcdir)/$@.in > $@.tmp && \
101         mv $@.tmp $@
102
103 install-data-local: fonts.conf
104         $(mkinstalldirs) $(DESTDIR)$(baseconfigdir) $(DESTDIR)$(fc_cachedir)
105         if [ -f $(DESTDIR)$(baseconfigdir)/fonts.conf ]; then \
106           echo "backing up existing $(DESTDIR)$(baseconfigdir)/fonts.conf"; \
107           mv $(DESTDIR)$(baseconfigdir)/fonts.conf $(DESTDIR)$(baseconfigdir)/fonts.conf.bak; \
108         fi
109         if [ -f $(srcdir)/fonts.conf ]; then \
110           echo " $(INSTALL_DATA) $(srcdir)/fonts.conf $(DESTDIR)$(baseconfigdir)/fonts.conf"; \
111           $(INSTALL_DATA) $(srcdir)/fonts.conf $(DESTDIR)$(baseconfigdir)/fonts.conf; \
112         else if [ -f fonts.conf ]; then \
113           echo " $(INSTALL_DATA) fonts.conf $(DESTDIR)$(baseconfigdir)/fonts.conf"; \
114           $(INSTALL_DATA) fonts.conf $(DESTDIR)$(baseconfigdir)/fonts.conf; \
115         fi; fi
116         @(if $(RUN_FC_CACHE_TEST); then \
117             echo "fc-cache$(EXEEXT) -s -f -v"; \
118             fc-cache/fc-cache$(EXEEXT) -s -f -v; \
119         else \
120             echo "***"; \
121             echo "*** Warning: fonts.cache not built"; \
122             echo "***"; \
123             echo "*** Generate this file manually on host system using fc-cache"; \
124             echo "***"; \
125         fi)
126
127 uninstall-local:
128         if [ -f $(srcdir)/fonts.conf ]; then \
129           if cmp -s $(srcdir)/fonts.conf $(DESTDIR)$(baseconfigdir)/fonts.conf; then \
130              echo " uninstall standard $(DESTDIR)$(baseconfigdir)/fonts.conf"; \
131              $(RM) $(DESTDIR)$(baseconfigdir)/fonts.conf; \
132           fi; \
133         else if [ -f fonts.conf ]; then \
134           if cmp -s fonts.conf $(DESTDIR)$(baseconfigdir)/fonts.conf; then \
135              echo " uninstall standard $(DESTDIR)$(baseconfigdir)/fonts.conf"; \
136              $(RM) $(DESTDIR)$(baseconfigdir)/fonts.conf; \
137           fi; \
138         fi; fi
139
140 debuild debuild-signed: debuild-dirs
141         (cd $(distdir)/debian && debuild)
142
143 debuild-unsigned: debuild-dirs
144         (cd $(distdir)/debian && debuild -us -uc)
145
146 debuild-dirs: distdir
147         $(RM) $(PACKAGE)_$(VERSION).orig.tar.gz
148         $(RM) -r $(distdir).orig
149         cp -a $(distdir) $(distdir).orig
150         $(RM) -r $(distdir).orig/debian
151
152 -include $(top_srcdir)/git.mk