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-blanks fc-case fc-lang fc-glyphname src \
25
	fc-cache fc-cat fc-list fc-match fc-pattern fc-query fc-scan \
26
	fc-validate conf.d test
Behdad Esfahbod's avatar
Behdad Esfahbod committed
27 28 29
if ENABLE_DOCS
SUBDIRS += doc
endif
30

Akira TAGOH's avatar
Akira TAGOH committed
31
ACLOCAL_AMFLAGS = -I m4
32

Keith Packard's avatar
Keith Packard committed
33 34 35 36
EXTRA_DIST = \
        fontconfig.pc.in \
        fonts.conf.in \
	fonts.dtd \
37
        fontconfig.spec.in \
Tor Lillqvist's avatar
Tor Lillqvist committed
38
        fontconfig.spec \
39 40
	fontconfig-zip.in \
	config-fixups.h
41
CLEANFILES = fonts.conf
42
DISTCLEANFILES = config.cache doltcompile
43 44 45 46 47 48 49 50 51 52 53 54 55
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
56
	$(srcdir)/test-driver \
57
	`find "$(srcdir)" -type f -name Makefile.in -print`
Keith Packard's avatar
Keith Packard committed
58 59 60

pkgconfig_DATA = fontconfig.pc

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

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

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

73 74
# Creating ChangeLog from git log:

Behdad Esfahbod's avatar
Behdad Esfahbod committed
75
MAINTAINERCLEANFILES += $(srcdir)/ChangeLog
76
EXTRA_DIST += ChangeLog
Behdad Esfahbod's avatar
Behdad Esfahbod committed
77 78
ChangeLog: $(srcdir)/ChangeLog
$(srcdir)/ChangeLog:
79
	if test -d "$(srcdir)/.git"; then \
80
	  (GIT_DIR=$(top_srcdir)/.git $(GIT) log --stat) | fmt --split-only > $@.tmp \
81
	  && mv -f $@.tmp $@ \
82
	  || ($(RM) $@.tmp; \
83 84 85 86 87 88 89 90
	      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

91
.PHONY: ChangeLog
92

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

95 96 97 98 99
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' \
100
		-e 's,@CONFIGDIR\@,$(FC_CONFIGDIR),g' \
101 102
		-e 's,@PACKAGE\@,$(PACKAGE),g' \
		-e 's,@VERSION\@,$(VERSION),g' \
Akira TAGOH's avatar
Akira TAGOH committed
103
		$(srcdir)/$@.in > $@.tmp && \
104 105 106
	mv $@.tmp $@

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

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

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

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

debuild-dirs: distdir
150 151
	$(RM) $(PACKAGE)_$(VERSION).orig.tar.gz
	$(RM) -r $(distdir).orig
Keith Packard's avatar
Keith Packard committed
152
	cp -a $(distdir) $(distdir).orig
153
	$(RM) -r $(distdir).orig/debian
154

Behdad Esfahbod's avatar
Behdad Esfahbod committed
155 156
DISTCHECK_CONFIGURE_FLAGS =

157
-include $(top_srcdir)/git.mk