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