File: Makefile

package info (click to toggle)
foomatic 0.20020408-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 16,940 kB
  • ctags: 456
  • sloc: xml: 300,403; perl: 14,168; ansic: 2,756; makefile: 247; sh: 179
file content (234 lines) | stat: -rw-r--r-- 6,890 bytes parent folder | download
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234

# Makefile to install foomatic
# $Revision: 1.32 $

# PREFIX defaults to /usr/local for manually installed progs, so that they
# are not messed up on a system upgrade.
#
# `architecture independent', static data files i.e. perl libs go into
#   $(PREFIX)/share/foomatic
# (user) executables into $(PREFIX)/bin/
# system binaries go into $(PREFIX)/sbin
# configuration files into /etc/foomatic/*.
# generated data files into /var/share/foomatic
#
# The PERLPREFIX allows a seperate prefix for the Perl libraries. Use this
# when Perl libraries in /usr/local are not found.

PREFIX=/usr/local
PERLPREFIX=$(PREFIX)

LIBDIR=$(PREFIX)/share/foomatic
BINDIR=$(PREFIX)/bin
SBINDIR=$(PREFIX)/sbin
MANDIR=$(PREFIX)/share/man
ETCDIR=/etc/foomatic
#CACHEDIR=/var/cache/foomatic

## Settings for the libxml C library
LIBXML=xml
LIBXMLCONFIG=/usr/bin/$(LIBXML)-config
LIBXMLCONFIGLINE=$(LIBXMLCONFIG) --cflags

## Settings for Perl
# Where to find the perl binary
PERL=/usr/bin/perl
# How to install the perl libs, may be either "site" or "perl" 
# details in the ExtUtils::MakeMaker manpage
PERL_INSTALLDIRS=site

## Settings for C
CC=gcc
CFLAGS=-O3

# Genereal paths for all filter scripts
EXEC_PATH=/usr/local/bin:/usr/bin:/bin
LOG_PATH=/tmp

# Paths for LPD and LPRng (without magicfilter)
LPD_SPOOL=/var/spool/lpd
LPD_LOG=/var/log/lp-errs
LPD_BIN=/usr/sbin/lpd
PRINTCAP=/etc/printcap
LPRNG_CONF=/etc/lpd.conf
LPD_LPR=/usr/bin/lpr
LPD_LPQ=/usr/bin/lpq
LPD_LPRM=/usr/bin/lprm
LPD_LPC=/usr/sbin/lpc
LPRNG_CHECKPC=/usr/sbin/checkpc

# Paths and other settings for CUPS
CUPS_ETC=/etc/cups
CUPS_ADMIN=/usr/sbin/lpadmin
CUPS_LPSTAT=/usr/bin/lpstat
CUPS_PPDS=/usr/share/cups/model
CUPS_FILTERS=/usr/lib/cups/filter
CUPS_BACKENDS=/usr/lib/cups/backend
CUPS_PCONF=$(CUPS_ETC)/printers.conf
CUPS_LPR=/usr/bin/lpr
CUPS_LPQ=/usr/bin/lpq
CUPS_LPRM=/usr/bin/lprm
CUPS_LPC=/usr/sbin/lpc
CUPS_LP=/usr/bin/lp
CUPS_CANCEL=/usr/bin/cancel
CUPS_ENABLE=/usr/bin/enable
CUPS_DISABLE=/usr/bin/disable
CUPS_ACCEPT=/usr/sbin/accept
CUPS_REJECT=/usr/sbin/reject
CUPS_LPMOVE=/usr/sbin/lpmove
CUPS_LPOPTIONS=/usr/bin/lpoptions

# Paths for PDQ
PDQ_CONF=/usr/lib/pdq
PDQ_PRINTRC=$(PDQ_CONF)/printrc
PDQ_FOOMATIC=$(PDQ_CONF)/drivers/foomatic
PDQ_PRINT=/usr/bin/pdq
PDQ_JOBDIR=~/.printjobs

# Paths for PPR
PPR_INTERFACES=/usr/lib/ppr/interfaces
PPR_PPDFILES=/usr/share/ppr/PPDFiles
PPR_ETC=/etc/ppr
PPR_PPR=/usr/bin/ppr
PPR_PPAD=/usr/bin/ppad
PPR_PPOP=/usr/bin/ppop

# Paths for direct, spoolerless printing
DIRECT_ETC=/etc/foomatic/direct
DIRECT_CONFIG=$(DIRECT_ETC)/.config

# Other paths
NC=/usr/bin/nc
RLPR=/usr/bin/rlpr
SMBCLIENT=/usr/bin/smbclient
NPRINT=/usr/bin/nprint
PTAL_CONNECT=/usr/bin/ptal-connect
CAT=/bin/cat

# This is mainly useful for building a binary foomatic package
INSTALLPREFIX=/

### Probably nothing to fiddle past here

# User programs and helper programs
BINFILES:=foomatic-gswrapper foomatic-printjob foomatic-configure \
	foomatic-combo-xml foomatic-perl-data directomatic \
	foomatic-datafile foomatic-compiledb

# Filters and administrative commands, only useful for admins
SBINFILES:=foomatic-kitload foomatic-ppdload \
	foomatic-getpjloptions foomatic-addpjloptions \
	foomatic-preferred-driver foomatic-fix-xml lpdomatic

# Masks for trash files which have to be removed before packaging Foomatic
TRASHFILES:="*~" "*\#*" ".??*" "*.rej"

all: build

# The install rule should check for kitloads and avoid stomping.  It doesn't
install: install-bin install-man install-db

check-config:
	@if [ -f .testing-stamp ] ; then \
	   echo 'Cowardly refusing to install testing Defaults.pm.' ;\
	   echo 'Use make testing_clean; make defaults to get a proper one.' ;\
	   exit 1 ;\
	fi

install-bin: check-config lib/Makefile
#	This is the only way to get the Perl-generated Makefile using
#	$(INSTALLPREFIX) properly
	( cd lib && \
	  $(MAKE) PREFIX=$(INSTALLPREFIX)$(PERLPREFIX) && \
	  $(MAKE) PREFIX=$(INSTALLPREFIX)$(PERLPREFIX) pure_install \
	)
	install -d $(INSTALLPREFIX)$(BINDIR)
	install -d $(INSTALLPREFIX)$(SBINDIR)
	install -d $(INSTALLPREFIX)$(ETCDIR)
	install -d $(INSTALLPREFIX)$(CUPS_FILTERS)
	install -d $(INSTALLPREFIX)$(PPR_INTERFACES)
	cp -f $(BINFILES) $(INSTALLPREFIX)$(BINDIR)
	cp -f $(SBINFILES) $(INSTALLPREFIX)$(SBINDIR)
	cp -f cupsomatic $(INSTALLPREFIX)$(CUPS_FILTERS)
	cp -f ppromatic $(INSTALLPREFIX)$(PPR_INTERFACES)
	cp -f filter.conf $(INSTALLPREFIX)$(ETCDIR)

install-man: check-config lib/Makefile
	install -d $(INSTALLPREFIX)$(MANDIR)
	install -d $(INSTALLPREFIX)$(MANDIR)/man1
	install -d $(INSTALLPREFIX)$(MANDIR)/man8
	cp -f *.1 $(INSTALLPREFIX)$(MANDIR)/man1
	cp -f *.8 $(INSTALLPREFIX)$(MANDIR)/man8

install-db: check-config lib/Makefile
	install -d $(INSTALLPREFIX)$(LIBDIR)
#	install -d $(INSTALLPREFIX)$(CACHEDIR)
	tar cf - --exclude=CVS db | ( cd $(INSTALLPREFIX)$(LIBDIR) && tar xf -)
#	( cd $(INSTALLPREFIX)$(LIBDIR)/db && ln -sf $(CACHEDIR)/compiled . )
#	( cd $(INSTALLPREFIX)$(LIBDIR)/db && ln -sf $(CACHEDIR)/pcache . )

build: defaults lib/Makefile foomatic-combo-xml foomatic-perl-data scripts man

lib/Makefile: lib/Makefile.PL
	( cd lib && $(PERL) Makefile.PL verbose INSTALLDIRS=$(PERL_INSTALLDIRS) )

foomatic-combo-xml: foomatic-combo-xml.c
	$(CC) $(CFLAGS) -o foomatic-combo-xml foomatic-combo-xml.c

foomatic-perl-data: foomatic-perl-data.c
	if [ ! -x $(LIBXMLCONFIG) ] ; then \
	   echo 'The configuration tool of libxml, $(LIBXMLCONFIG)' ;\
	   echo 'could not be found. Please check whether you have installed' ;\
	   echo 'libxml, please see the USAGE file for more info' ;\
	   exit 1 ;\
	fi ;\
	$(CC) $(CFLAGS) `$(LIBXMLCONFIGLINE)` -l$(LIBXML) -o foomatic-perl-data foomatic-perl-data.c

man:
	./makeMan

clean: lib/Makefile remove_trash
	$(MAKE) -C lib clean
	$(MAKE) -C src clean
	rm -f lib/Makefile.old
	rm -f lib/Foomatic/Defaults.pm
	rm -f *~ .testing-stamp
	rm -f foomatic-combo-xml
	rm -f foomatic-perl-data
	$(RM) $(BINFILES:=.1) $(SBINFILES:=.8)

# Various testing/debugging/etc targets
testing: INPLACE = --inplace
testing: defaults foomatic-combo-xml foomatic-perl-data scripts
	ln -sf lib/Foomatic .
#	mkdir -p cache
#	( cd db && ln -sf ../cache/compiled . )
#	( cd db && ln -sf ../cache/pcache . )

testing_clean: clean
	rm -f Foomatic
#	rm -rf cache
#	( cd db && rm -f compiled pcache )

# Remove editor backup and temporary files
remove_trash:
	for m in $(TRASHFILES); do \
	  find . -name "$$m" -exec rm "{}" \; ; \
	done

# We need to export all Variables for makeDefaults and the scripts target to
# work.
.EXPORT_ALL_VARIABLES:

scripts:
	$(MAKE) -C src scripts

# Use INPLACE=--inplace to get the special run-in-place Defaults.
defaults: lib/Foomatic/Defaults.pm

lib/Foomatic/Defaults.pm: Makefile makeDefaults
	./makeDefaults $(INPLACE)
	if [ x$(INPLACE) = x--inplace ] ; then touch .testing-stamp ; fi

.PHONY: all defaults check-config build install install-bin install-db \
	man testing clean testing_clean