summaryrefslogtreecommitdiffstats
path: root/Makefile.in
blob: 94cd013314dd98d779c9818c053e333129f72fc2 (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
# $Id$
#
# Makefile.in
#
# Makefile for the lpr/lpd magic filter
#
# Copyright  1995 Yggdrasil Computing, Inc
# Copyright  1996-1998 H. Peter Anvin
#

#
# Define the following to suit your taste
# 

srcdir = @srcdir@
VPATH = @srcdir@

prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = ${exec_prefix}/bin
mansec=8
mandir = ${prefix}/man/man${mansec}

CC = @CC@
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
RM = rm -f
MV = mv -f
SED = sed
YACC = @YACC@
INSTALL = @INSTALL@
INSTALL_EXEC = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@

.SUFFIXES:	.c .o .y

#
# These defines control the sending of mail notices to people who submit
# bad jobs (PostScript to non-PS printers, or trying to print binaries.)
#
# This may not work if the hostname lpd knows about is not necessary a
# valid mail address (for example, if you can submit print jobs from
# non-mailer machines without MX records).  If so, define -DNOMAIL.
#
# -DNOMAIL		Disable sending of rejection mail notices 
# -DSENDMAIL="path"	Where is your mail transport agent?
# -DBANG_ADDRESS	To send to "host!user" instead of "user@host"
#
# If <paths.h> exist and contains _PATH_SENDMAIL, it will be used unless
# overridden here
#
SYSOPT=

.c.o:
	${CC} ${CFLAGS} ${SYSOPT} -c $<

.y.c:
	${YACC} $<
	${MV} y.tab.c $*.c

.PHONY: all filters clean distclean install install_filters

OBJS = magicfilter.o parseconfig.o loadconfig.o

all: magicfilter magicfilter.man filters

filters: filters/gsinfo.h # mfpp
	cd filters; make

install: magicfilter magicfilter.man
	${INSTALL_EXEC} magicfilter ${bindir}/magicfilter
	${INSTALL_DATA} magicfilter.man ${mandir}/magicfilter.${mansec}

install_filters:
	cd filters; make install

clean:
	-cd filters; make clean
	-${RM} *.o magicfilter magicfilter.man ghostprobe mfpp

distclean: clean
	-cd filters; make distclean
	-${RM} *~ *.s config.cache config.log config.status \#*\#
	-${RM} config.h y.tab.c y.output Makefile

spotless: distclean
	-${RM} mfpp.c

magicfilter: ${OBJS}
	${CC} ${LDFLAGS} -o magicfilter ${OBJS} ${LIBS}

magicfilter.o: magicfilter.c magicfilter.h config.h

parseconfig.o: parseconfig.c magicfilter.h config.h

loadconfig.o: loadconfig.c magicfilter.h config.h

filters/gsinfo.h: ghostprobe
	./ghostprobe > filters/gsinfo.h

ghostprobe: ghostprobe.o
	${CC} ${LDFLAGS} -o ghostprobe ghostprobe.o ${LIBS}

mfpp:	mfpp.o mfppact.o mfppmain.o
	${CC} ${LDFLAGS} -o mfpp mfpp.o mfppact.o mfppmain.o ${LIBS}

mfpp.o:	mfpp.c mfpp.h

mfppact.o: mfppact.c mfpp.h

mfppmain.o: mfppmain.c mfpp.h

mfpp.c: mfpp.y

magicfilter.man: magicfilter.man.in
	${SED} -e "s:XXX_BINDIR_XXX:${bindir}:g" < magicfilter.man.in | \
	${SED} -e "s:///*:/:g" > magicfilter.man