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