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