summaryrefslogtreecommitdiff
path: root/Makefile.am
blob: 576eea82759ea3ab168e37408bcff814adfdfe1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
## Process this file with automake to produce Makefile.in
## $Id: Makefile.am,v 1.151 2008/04/12 22:41:01 rlk Exp $
## Copyright (C) 2000-2004 Roger Leigh
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2, or (at your option)
## any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

## Process this file with automake to produce Makefile.in.

@SET_MAKE@

ACLOCAL_AMFLAGS = -I m4 -I m4local

include $(top_srcdir)/scripts/global.mk


## Variables

SUBDIRS = include src samples test po man doc scripts
DISTDIRS = m4 m4extra


## Rules

# Libtool dependency
libtool: $(LIBTOOL_DEPS)
	cd $(srcdir); \
	$(SHELL) ./config.status --recheck

# This rather strange-looking code ensures that the change log is only
# rebuilt if any of the CVS/Entries files have changed since the change log
# was last built.

ChangeLogPhony:
	@cd $(top_srcdir) ; \
	for f in `find . -name Entries -print | grep CVS` ; do \
	  if @TEST@ ! -f ChangeLogStamp -o ChangeLogStamp -ot $$f ; then \
	    rm -f ChangeLogStamp ; \
	    touch ChangeLogStamp ; \
	  fi ; \
	done

ChangeLogStamp: ChangeLogPhony
	@@TRUE@

ChangeLog: ChangeLogStamp
	@cd $(top_srcdir) ; \
	if test -f $(top_builddir)/.noupdate ; then \
	  echo "ChangeLog: .noupdate found: NOT updating ChangeLog from CVS" ; \
	elif test -d CVS ; then \
	  echo "ChangeLog: Updating ChangeLog from CVS" ; \
	  cvs log | $(PERL) scripts/mkchlog > ChangeLog.tmp ; \
	  if test -s ChangeLog.tmp ; then \
	    mv ChangeLog.tmp ChangeLog ; \
	  else \
	    echo "ChangeLog: Failed to update ChangeLog ['touch .noupdate' to skip]" ; \
	    $(RM) ChangeLog.tmp ; \
	    exit 1 ; \
	  fi \
	elif test -s ChangeLog ; then \
	  echo "ChangeLog: This is not a CVS version of Gutenprint" ; \
	  echo "ChangeLog: Not updating ChangeLog from CVS!" ; \
	else \
	  echo "ChangeLog: No ChangeLog or ChangeLog of zero size found!" ; \
	  echo "ChangeLog: Failed to update ChangeLog ['touch .noupdate' to skip]" ; \
	  exit 1 ; \
	fi

configure.in:
	$(LN_S) $(srcdir)/configure.ac $(srcdir)/configure.in

dist-time-check:
	@current_date=`date +%Y%m%d`; \
	configure_date=`ls -l --time-style=+%Y%m%d $(top_builddir)/configure | awk '{print $$6}'`; \
	echo "Checking that 'configure' was built today."; \
	if test "$$current_date" != "$$configure_date" ; then \
	  echo "configure is out of date -- rerun ./autogen.sh first!"; \
	  exit 1; \
	fi

dist-hook: dist-time-check
	for dir in $(DISTDIRS) ; do \
	  if test -d $(srcdir)/$$dir ; then \
	    mkdir $(distdir)/$$dir; \
	    for dirfile in $(srcdir)/$$dir/*; do \
	      if test -f $$dirfile ; then \
	        cp -p $$dirfile $(distdir)/$$dir; \
	      fi \
	    done \
	  fi \
	done
# Remove configure.in (libtool bug workaround)
	$(RM) -f $(distdir)/configure.in
# Remove any backup files found in distdir
	$(FIND) $(distdir) -name '.*' -print | xargs $(RM) -rf
	$(FIND) $(distdir) -name '#*' -print | xargs $(RM) -rf
	$(FIND) $(distdir) -name '*~' -print | xargs $(RM) -rf

install-cups: all
	cd src/cups ; \
	$(MAKE) install

install-ghost: all
	cd src/ghost ; \
	$(MAKE) install

install-gimp: all
	cd src/gimp ; \
	$(MAKE) install

docs:
	cd doc ; \
	$(MAKE) docs

html:
	cd doc ; \
	$(MAKE) html

ps:
	cd doc ; \
	$(MAKE) ps

pdf:
	cd doc ; \
	$(MAKE) pdf

snapshot:
	$(MAKE) dist distdir=$(PACKAGE)`date +"%Y%m%d"`

## Clean

CLEANSCRIPTS = \
	scripts/depcomp \
	scripts/install-sh \
	scripts/ltconfig \
	scripts/mdate-sh \
	scripts/missing \
	scripts/mkinstalldirs

CLEANMFOUR = \
	m4/codeset.m4 \
	m4/gettext.m4 \
	m4/glibc21.m4 \
	m4/iconv.m4 \
	m4/intdiv0.m4 \
	m4/inttypes_h.m4 \
	m4/inttypes.m4 \
	m4/inttypes-pri.m4 \
	m4/isc-posix.m4 \
	m4/lcmessage.m4 \
	m4/lib-ld.m4 \
	m4/lib-link.m4 \
	m4/lib-prefix.m4 \
	m4/progtest.m4 \
	m4/stdint_h.m4 \
	m4/uintmax_t.m4 \
	m4/ulonglong.m4

CLEANPO = \
	po/boldquot.sed \
	po/en@boldquot.header \
	po/en@quot.header \
	po/insert-header.sin \
	po/Makevars.template \
	po/quot.sed \
	po/remove-potcdate.sin \
	po/Rules-quot

CLEANFILES = .noupdate

MAINTAINERCLEANFILES = \
	ABOUT-NLS \
	INSTALL \
	aclocal.m4 \
	config.h.in \
	configure \
	configure.in \
	Makefile.in \
	stamp-h.in \
	stamp-h1.in \
	stamp-h2.in \
	stamp-h3.in \
	stamp-h4.in \
	$(CLEANSCRIPTS) \
	$(CLEANMFOUR) \
	$(CLEANPO)

EXTRA_DIST = autogen.sh ChangeLogStamp

.PHONY: deb html install-cups install-gimp install-ghost snapshot ChangeLogPhony dist-time-check