112803Samjiang## Process this file with automake to produce Makefile.in
217252Siignatyev## $Id: Makefile.am,v 1.155 2008/10/24 00:37:13 rleigh Exp $
312803Samjiang## Copyright (C) 2000-2004 Roger Leigh
412803Samjiang##
512803Samjiang## This program is free software; you can redistribute it and/or modify
612803Samjiang## it under the terms of the GNU General Public License as published by
712803Samjiang## the Free Software Foundation; either version 2, or (at your option)
812803Samjiang## any later version.
912803Samjiang##
1012803Samjiang## This program is distributed in the hope that it will be useful,
1112803Samjiang## but WITHOUT ANY WARRANTY; without even the implied warranty of
1212803Samjiang## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1312803Samjiang## GNU General Public License for more details.
1412803Samjiang##
1512803Samjiang## You should have received a copy of the GNU General Public License
1612803Samjiang## along with this program; if not, write to the Free Software
1712803Samjiang## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1812803Samjiang
1912803Samjiang## Process this file with automake to produce Makefile.in.
2012803Samjiang
2112803Samjiang@SET_MAKE@
2212803Samjiang
2312803SamjiangACLOCAL_AMFLAGS = -I m4 -I m4local
2412803Samjiang
2512803Samjianginclude $(top_srcdir)/scripts/global.mk
2612803Samjiang
2712803Samjiang
2812803Samjiang## Variables
2912803Samjiang
3017252SiignatyevSUBDIRS = include src samples test po man doc scripts
3112803SamjiangDISTDIRS = m4 m4extra
3212803Samjiang
3312803Samjiangdocdir = $(datadir)/$(PACKAGE)/doc
3412803Samjiang
3512803Samjiang## Rules
3617252Siignatyev
3717330Siignatyev# Libtool dependency
3812803Samjianglibtool: $(LIBTOOL_DEPS)
3912803Samjiang	cd $(srcdir); \
4012803Samjiang	$(SHELL) ./config.status --recheck
4112803Samjiang
4212803Samjiang# Don't list ChangeLog as a dependency here because it forces network
4312803Samjiang# access, and because it usually runs as superuser rather than the user
4412803Samjiang# who normally builds Gutenprint.
4512803Samjianginstall-data-local: NEWS AUTHORS COPYING README
4612803Samjiang	$(mkdir_p) $(DESTDIR)$(docdir)
4712803Samjiang	$(INSTALL_DATA) $(srcdir)/NEWS $(DESTDIR)$(docdir)
4812803Samjiang	$(INSTALL_DATA) $(srcdir)/ChangeLog $(DESTDIR)$(docdir)
4912803Samjiang	$(INSTALL_DATA) $(srcdir)/AUTHORS $(DESTDIR)$(docdir)
5012803Samjiang	$(INSTALL_DATA) $(srcdir)/COPYING $(DESTDIR)$(docdir)
5112803Samjiang	$(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(docdir)
5212803Samjiang
5312803Samjiang# This rather strange-looking code ensures that the change log is only
5412803Samjiang# rebuilt if any of the CVS/Entries files have changed since the change log
5512803Samjiang# was last built.
5612803Samjiang
5712803SamjiangChangeLogPhony:
5812803Samjiang	@cd $(top_srcdir) ; \
5912803Samjiang	for f in `find . -name Entries -print | grep CVS` ; do \
6012803Samjiang	  if @TEST@ ! -f ChangeLogStamp -o ChangeLogStamp -ot $$f ; then \
6112803Samjiang	    rm -f ChangeLogStamp ; \
6212803Samjiang	    touch ChangeLogStamp ; \
6312803Samjiang	  fi ; \
6412803Samjiang	done
6512803Samjiang
6612803SamjiangChangeLogStamp: ChangeLogPhony
6712803Samjiang	@@TRUE@
6812803Samjiang
6912803SamjiangChangeLog: ChangeLogStamp
7012803Samjiang	@cd $(top_srcdir) ; \
7112803Samjiang	if test -f $(top_builddir)/.noupdate ; then \
7212803Samjiang	  echo "$@: .noupdate found: NOT updating $@ from CVS" ; \
7312803Samjiang	elif test -d CVS ; then \
7412803Samjiang	  echo "$@: Updating $@ from CVS" ; \
7512803Samjiang	  cvs log | $(PERL) scripts/mkchlog -e @sourceforge.net -X src/xml/escp2/resolutions -s '^(guten|gimp-|)print-[0-9]+_' > $@.tmp ; \
7612803Samjiang	  if test -s $@.tmp ; then \
7712803Samjiang	    mv $@.tmp $@ ; \
7812803Samjiang	  else \
7912803Samjiang	    echo "$@: Failed to update $@ ['touch .noupdate' to skip]" ; \
8012803Samjiang	    $(RM) $@.tmp ; \
8112803Samjiang	    exit 1 ; \
8212803Samjiang	  fi \
8312803Samjiang	elif test -s $@ ; then \
8412803Samjiang	  echo "$@: This is not a CVS version of Gutenprint" ; \
8512803Samjiang	  echo "$@: Not updating $@ from CVS!" ; \
8612803Samjiang	else \
8712803Samjiang	  echo "$@: No $@ or $@ of zero size found!" ; \
8812803Samjiang	  echo "$@: Failed to update $@ ['touch .noupdate' to skip]" ; \
8912803Samjiang	  exit 1 ; \
9012803Samjiang	fi
9112803Samjiang
9212803Samjiangconfigure.in:
9312803Samjiang	$(LN_S) $(srcdir)/configure.ac $(srcdir)/configure.in
9412803Samjiang
9512803Samjiangdist-time-check:
9612803Samjiang	@current_date=`date +%Y%m%d`; \
9712803Samjiang	configure_date=`ls -l --time-style=+%Y%m%d $(top_builddir)/configure | awk '{print $$6}'`; \
9812803Samjiang	echo "Checking that 'configure' was built today."; \
9912803Samjiang	if test "$$current_date" != "$$configure_date" ; then \
10012803Samjiang	  echo "configure is out of date -- rerun ./autogen.sh first!"; \
10112803Samjiang	  exit 1; \
10212803Samjiang	fi
10312803Samjiang
10412803Samjiangdist-hook: dist-time-check
10512803Samjiang	for dir in $(DISTDIRS) ; do \
10612803Samjiang	  if test -d $(srcdir)/$$dir ; then \
10712803Samjiang	    mkdir $(distdir)/$$dir; \
10812803Samjiang	    for dirfile in $(srcdir)/$$dir/*; do \
10912803Samjiang	      if test -f $$dirfile ; then \
11012803Samjiang	        cp -p $$dirfile $(distdir)/$$dir; \
11112803Samjiang	      fi \
11212803Samjiang	    done \
11312803Samjiang	  fi \
11412803Samjiang	done
115# Remove configure.in (libtool bug workaround)
116	$(RM) -f $(distdir)/configure.in
117# Remove any backup files found in distdir
118	$(FIND) $(distdir) -name '.*' -print | xargs $(RM) -rf
119	$(FIND) $(distdir) -name '#*' -print | xargs $(RM) -rf
120	$(FIND) $(distdir) -name '*~' -print | xargs $(RM) -rf
121
122install-cups: all
123	cd src/cups ; \
124	$(MAKE) install
125
126install-ghost: all
127	cd src/ghost ; \
128	$(MAKE) install
129
130install-gimp: all
131	cd src/gimp ; \
132	$(MAKE) install
133
134docs:
135	cd doc ; \
136	$(MAKE) docs
137
138html:
139	cd doc ; \
140	$(MAKE) html
141
142ps:
143	cd doc ; \
144	$(MAKE) ps
145
146pdf:
147	cd doc ; \
148	$(MAKE) pdf
149
150snapshot:
151	$(MAKE) dist distdir=$(PACKAGE)`date +"%Y%m%d"`
152
153## Clean
154
155CLEANSCRIPTS = \
156	scripts/depcomp \
157	scripts/install-sh \
158	scripts/ltconfig \
159	scripts/mdate-sh \
160	scripts/missing \
161	scripts/mkinstalldirs
162
163CLEANMFOUR = \
164	m4/codeset.m4 \
165	m4/gettext.m4 \
166	m4/glibc21.m4 \
167	m4/iconv.m4 \
168	m4/intdiv0.m4 \
169	m4/inttypes_h.m4 \
170	m4/inttypes.m4 \
171	m4/inttypes-pri.m4 \
172	m4/isc-posix.m4 \
173	m4/lcmessage.m4 \
174	m4/lib-ld.m4 \
175	m4/lib-link.m4 \
176	m4/lib-prefix.m4 \
177	m4/progtest.m4 \
178	m4/stdint_h.m4 \
179	m4/uintmax_t.m4 \
180	m4/ulonglong.m4
181
182CLEANPO = \
183	po/boldquot.sed \
184	po/en@boldquot.header \
185	po/en@quot.header \
186	po/insert-header.sin \
187	po/Makevars.template \
188	po/quot.sed \
189	po/remove-potcdate.sin \
190	po/Rules-quot
191
192CLEANFILES = .noupdate ChangeLog.tmp
193
194MAINTAINERCLEANFILES = \
195	ABOUT-NLS \
196	INSTALL \
197	aclocal.m4 \
198	config.h.in \
199	configure \
200	configure.in \
201	Makefile.in \
202	stamp-h.in \
203	stamp-h1.in \
204	stamp-h2.in \
205	stamp-h3.in \
206	stamp-h4.in \
207	$(CLEANSCRIPTS) \
208	$(CLEANMFOUR) \
209	$(CLEANPO)
210
211EXTRA_DIST = autogen.sh ChangeLogStamp README.package
212
213.PHONY: deb html install-cups install-gimp install-ghost snapshot ChangeLog Phony dist-time-check
214
215