Makefile.am 5.15 KB
Newer Older
Keith Packard's avatar
Keith Packard committed
1
# 
Behdad Esfahbod's avatar
Behdad Esfahbod committed
2
#  fontconfig/Makefile.am
Keith Packard's avatar
Keith Packard committed
3
# 
4
#  Copyright © 2003 Keith Packard
Keith Packard's avatar
Keith Packard committed
5 6 7 8 9
# 
#  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
Keith Packard's avatar
Keith Packard committed
11
#  advertising or publicity pertaining to distribution of the software without
12
#  specific, written prior permission.  The authors make no
Keith Packard's avatar
Keith Packard committed
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,
Keith Packard's avatar
Keith Packard committed
17
#  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18
#  EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
Keith Packard's avatar
Keith Packard committed
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
SUBDIRS=fontconfig fc-case fc-lang src \
25 26
	fc-cache fc-cat fc-conflist fc-list fc-match \
	fc-pattern fc-query fc-scan fc-validate conf.d \
27
	its po po-conf test
28 29 30
if ENABLE_DOCS
SUBDIRS += doc
endif
31

32
ACLOCAL_AMFLAGS = -I m4
33

34
EXTRA_DIST = config.rpath  \
35 36
	fontconfig.pc.in \
	fonts.conf.in \
Keith Packard's avatar
Keith Packard committed
37
	fonts.dtd \
38 39
	fontconfig.spec.in \
	fontconfig.spec \
40 41
	fontconfig-zip.in \
	config-fixups.h
42
CLEANFILES = fonts.conf
43
DISTCLEANFILES = config.cache doltcompile
44 45 46 47 48 49 50 51 52 53 54 55 56
MAINTAINERCLEANFILES = \
	$(srcdir)/aclocal.m4 \
	$(srcdir)/autoscan.log \
	$(srcdir)/compile \
	$(srcdir)/config.guess \
	$(srcdir)/config.h.in \
	$(srcdir)/config.sub \
	$(srcdir)/configure.scan \
	$(srcdir)/depcomp \
	$(srcdir)/install-sh \
	$(srcdir)/ltmain.sh \
	$(srcdir)/missing \
	$(srcdir)/mkinstalldirs \
Akira TAGOH's avatar
Akira TAGOH committed
57
	$(srcdir)/test-driver \
58
	`find "$(srcdir)" -type f -name Makefile.in -print`
Keith Packard's avatar
Keith Packard committed
59 60 61

pkgconfig_DATA = fontconfig.pc

62 63 64 65 66
baseconfigdir = $(BASECONFIGDIR)
configdir = $(CONFIGDIR)

xmldir = $(XMLDIR)
xml_DATA = fonts.dtd
Keith Packard's avatar
Keith Packard committed
67

68 69 70 71 72 73
if CROSS_COMPILING
  RUN_FC_CACHE_TEST=false
else
  RUN_FC_CACHE_TEST=test -z "$(DESTDIR)"
endif

74 75
# Creating ChangeLog from git log:

Behdad Esfahbod's avatar
Behdad Esfahbod committed
76
MAINTAINERCLEANFILES += $(srcdir)/ChangeLog
77
EXTRA_DIST += ChangeLog
Behdad Esfahbod's avatar
Behdad Esfahbod committed
78 79
ChangeLog: $(srcdir)/ChangeLog
$(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 85 86 87 88 89 90 91
	      echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
	      (test -f $@ || echo git-log is required to generate this file >> $@)); \
	else \
	  test -f $@ || \
	  (echo A git checkout and git-log is required to generate ChangeLog >&2 && \
	  echo A git checkout and git-log is required to generate this file >> $@); \
	fi

92
.PHONY: ChangeLog
93

94 95
FC_CONFIGDIR = $(subst $(BASECONFIGDIR)/,,$(CONFIGDIR))

96 97 98 99 100
fonts.conf: fonts.conf.in Makefile
	sed \
		-e 's,@FC_CACHEDIR\@,$(FC_CACHEDIR),g' \
		-e 's,@FC_DEFAULT_FONTS\@,$(FC_DEFAULT_FONTS),g' \
		-e 's,@FC_FONTPATH\@,$(FC_FONTPATH),g' \
101
		-e 's,@CONFIGDIR\@,$(FC_CONFIGDIR),g' \
102 103
		-e 's,@PACKAGE\@,$(PACKAGE),g' \
		-e 's,@VERSION\@,$(VERSION),g' \
104
		$(srcdir)/$@.in > $@.tmp && \
105 106 107
	mv $@.tmp $@

install-data-local: fonts.conf
108 109 110 111
	$(mkinstalldirs) $(DESTDIR)$(baseconfigdir) $(DESTDIR)$(fc_cachedir)
	if [ -f $(DESTDIR)$(baseconfigdir)/fonts.conf ]; then \
	  echo "backing up existing $(DESTDIR)$(baseconfigdir)/fonts.conf"; \
	  mv $(DESTDIR)$(baseconfigdir)/fonts.conf $(DESTDIR)$(baseconfigdir)/fonts.conf.bak; \
112 113
	fi
	if [ -f $(srcdir)/fonts.conf ]; then \
114 115
	  echo " $(INSTALL_DATA) $(srcdir)/fonts.conf $(DESTDIR)$(baseconfigdir)/fonts.conf"; \
	  $(INSTALL_DATA) $(srcdir)/fonts.conf $(DESTDIR)$(baseconfigdir)/fonts.conf; \
116
	else if [ -f fonts.conf ]; then \
117 118
	  echo " $(INSTALL_DATA) fonts.conf $(DESTDIR)$(baseconfigdir)/fonts.conf"; \
	  $(INSTALL_DATA) fonts.conf $(DESTDIR)$(baseconfigdir)/fonts.conf; \
119
	fi; fi
120
	@(if $(RUN_FC_CACHE_TEST); then \
121 122
	    echo "fc-cache$(EXEEXT) -s -f -v"; \
	    fc-cache/fc-cache$(EXEEXT) -s -f -v; \
123
	else \
Patrick Lam's avatar
Patrick Lam committed
124 125 126 127 128 129
	    echo "***"; \
	    echo "*** Warning: fonts.cache not built"; \
	    echo "***"; \
	    echo "*** Generate this file manually on host system using fc-cache"; \
	    echo "***"; \
	fi)
130 131 132

uninstall-local:
	if [ -f $(srcdir)/fonts.conf ]; then \
133 134 135
	  if cmp -s $(srcdir)/fonts.conf $(DESTDIR)$(baseconfigdir)/fonts.conf; then \
	     echo " uninstall standard $(DESTDIR)$(baseconfigdir)/fonts.conf"; \
	     $(RM) $(DESTDIR)$(baseconfigdir)/fonts.conf; \
136 137
	  fi; \
	else if [ -f fonts.conf ]; then \
138 139 140
	  if cmp -s fonts.conf $(DESTDIR)$(baseconfigdir)/fonts.conf; then \
	     echo " uninstall standard $(DESTDIR)$(baseconfigdir)/fonts.conf"; \
	     $(RM) $(DESTDIR)$(baseconfigdir)/fonts.conf; \
141 142
	  fi; \
	fi; fi
143 144 145 146 147 148 149 150

debuild debuild-signed: debuild-dirs
	(cd $(distdir)/debian && debuild)

debuild-unsigned: debuild-dirs
	(cd $(distdir)/debian && debuild -us -uc)

debuild-dirs: distdir
151 152
	$(RM) $(PACKAGE)_$(VERSION).orig.tar.gz
	$(RM) -r $(distdir).orig
153
	cp -a $(distdir) $(distdir).orig
154
	$(RM) -r $(distdir).orig/debian
155

156 157
DISTCHECK_CONFIGURE_FLAGS =

158
-include $(top_srcdir)/git.mk