• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# IPP tools makefile for CUPS.
3#
4# Copyright © 2020-2024 by OpenPrinting.
5# Copyright © 2007-2019 by Apple Inc.
6# Copyright © 1997-2006 by Easy Software Products, all rights reserved.
7#
8# Licensed under Apache License v2.0.  See the file "LICENSE" for more
9# information.
10#
11
12include ../Makedefs
13
14
15OBJS		=	\
16			ippevepcl.o \
17			ippeveprinter.o \
18			ippeveps.o \
19			ippfind.o \
20			ipptool.o
21IPPTOOLS	=	\
22			ippeveprinter \
23			$(IPPFIND_BIN) \
24			ipptool
25TARGETS		=	\
26			$(IPPEVECOMMANDS) \
27			$(IPPTOOLS) \
28			$(LOCALTARGET)
29
30
31#
32# Make all targets...
33#
34
35all:		$(TARGETS)
36
37
38#
39# Make library targets...
40#
41
42libs:
43
44
45#
46# Make unit tests...
47#
48
49unittests:
50
51
52#
53# Clean all object files...
54#
55
56clean:
57	$(RM) $(IPPTOOLS) $(IPPEVECOMMANDS) $(OBJS)
58	$(RM) ippeveprinter-static ippfind-static ipptool-static
59
60
61#
62# Update dependencies (without system header dependencies...)
63#
64
65depend:
66	$(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies
67
68
69#
70# Install all targets...
71#
72
73install:	all install-data install-headers install-libs install-exec
74
75
76#
77# Install data files...
78#
79
80install-data:
81
82
83#
84# Install programs...
85#
86
87install-exec:
88	echo Installing IPP tools in $(BINDIR)...
89	$(INSTALL_DIR) -m 755 $(BINDIR)
90	for file in $(IPPTOOLS); do \
91		$(INSTALL_BIN) $$file $(BINDIR); \
92	done
93	echo Installing printer commands in $(SERVERBIN)/command...
94	$(INSTALL_DIR) -m 755 $(SERVERBIN)/command
95	for file in $(IPPEVECOMMANDS); do \
96		$(INSTALL_BIN) $$file $(SERVERBIN)/command; \
97	done
98	if test "x$(SYMROOT)" != "x"; then \
99		$(INSTALL_DIR) $(SYMROOT); \
100		for file in $(IPPTOOLS) $(IPPEVECOMMANDS); do \
101			cp $$file $(SYMROOT); \
102			dsymutil $(SYMROOT)/$$file; \
103		done; \
104	fi
105
106
107#
108# Install headers...
109#
110
111install-headers:
112
113
114#
115# Install libraries...
116#
117
118install-libs:
119
120
121#
122# Unnstall all targets...
123#
124
125uninstall:
126	echo Uninstalling IPP tools from $(BINDIR)...
127	for file in $(IPPTOOLS); do \
128		$(RM) $(BINDIR)/$$file; \
129	done
130	-$(RMDIR) $(BINDIR)
131	echo Uninstalling print commands from $(SERVERBIN)/command...
132	for file in $(IPPEVECOMMANDS); do \
133		$(RM) $(SERVERBIN)/command/$$file; \
134	done
135	-$(RMDIR) $(SERVERBIN)/ippeveprinter
136
137
138#
139# Local programs (not built when cross-compiling...)
140#
141
142local:	ippeveprinter-static ipptool-static
143
144
145#
146# ippeveprinter
147#
148
149ippeveprinter:	ippeveprinter.o ../cups/$(LIBCUPS)
150	echo Linking $@...
151	$(LD_CC) $(ALL_LDFLAGS) -o $@ ippeveprinter.o $(DNSSDLIBS) $(PAMLIBS) $(LINKCUPS)
152	$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
153
154
155#
156# ippeveprinter-static
157#
158
159ippeveprinter-static:	ippeveprinter.o ../cups/$(LIBCUPSSTATIC)
160	echo Linking $@...
161	$(LD_CC) $(ALL_LDFLAGS) -o $@ ippeveprinter.o $(PAMLIBS) $(LINKCUPSSTATIC)
162	$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
163
164
165#
166# ippevepcl
167#
168
169ippevepcl:	ippevepcl.o ../cups/$(LIBCUPS)
170	echo Linking $@...
171	$(LD_CC) $(ALL_LDFLAGS) -o $@ ippevepcl.o $(LINKCUPS)
172	$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
173
174
175#
176# ippeveps
177#
178
179ippeveps:	ippeveps.o ../cups/$(LIBCUPS)
180	echo Linking $@...
181	$(LD_CC) $(ALL_LDFLAGS) -o $@ ippeveps.o $(LINKCUPS)
182	$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
183
184
185#
186# ippfind
187#
188
189ippfind:	ippfind.o ../cups/$(LIBCUPS)
190	echo Linking $@...
191	$(LD_CC) $(ALL_LDFLAGS) -o $@ ippfind.o $(DNSSDLIBS) $(LINKCUPS)
192	$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
193
194
195#
196# ippfind-static
197#
198
199ippfind-static:	ippfind.o ../cups/$(LIBCUPSSTATIC)
200	echo Linking $@
201	$(LD_CC) $(ALL_LDFLAGS) -o $@ ippfind.o $(LINKCUPSSTATIC)
202	$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
203
204
205#
206# ipptool
207#
208
209ipptool:	ipptool.o ../cups/$(LIBCUPS)
210	echo Linking $@...
211	$(LD_CC) $(ALL_LDFLAGS) -o $@ ipptool.o $(LINKCUPS)
212	$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
213
214
215#
216# ipptool-static
217#
218
219ipptool-static:	ipptool.o ../cups/$(LIBCUPSSTATIC)
220	echo Linking $@...
221	$(LD_CC) $(ALL_LDFLAGS) -o $@ ipptool.o $(LINKCUPSSTATIC)
222	$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
223
224
225#
226# Generate the header containing the data for printer.png...
227#
228
229pngheader:
230	echo "Generating printer-png.h from printer.png..."
231	echo "static const unsigned char printer_png[] =" >printer-png.h
232	echo "{" >>printer-png.h
233	od -t x1 printer.png | cut -b12- | awk '{printf("  "); for (i = 1; i <= NF; i ++) printf("0x%s,", $$i); print "";}' >>printer-png.h
234	echo "};" >>printer-png.h
235
236
237#
238# Dependencies...
239#
240
241include Dependencies
242