]> git.ipfire.org Git - thirdparty/cups.git/blob - Makefile
Merge changes from CUPS 1.5svn-r9105.
[thirdparty/cups.git] / Makefile
1 #
2 # "$Id: Makefile 7961 2008-09-17 19:52:46Z mike $"
3 #
4 # Top-level Makefile for CUPS.
5 #
6 # Copyright 2007-2010 by Apple Inc.
7 # Copyright 1997-2007 by Easy Software Products, all rights reserved.
8 #
9 # These coded instructions, statements, and computer programs are the
10 # property of Apple Inc. and are protected by Federal copyright
11 # law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 # which should have been included with this file. If this file is
13 # file is missing or damaged, see the license at "http://www.cups.org/".
14 #
15
16 include Makedefs
17
18
19 #
20 # Don't run top-level build targets in parallel...
21 #
22
23 .NOTPARALLEL:
24
25
26 #
27 # Directories to make...
28 #
29
30 DIRS = cups test $(BUILDDIRS) $(PHPDIR) $(FONTS)
31
32
33 #
34 # Make all targets...
35 #
36
37 all:
38 chmod +x cups-config
39 echo Using ARCHFLAGS="$(ARCHFLAGS)"
40 echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
41 echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
42 echo Using CC="$(CC)"
43 echo Using CXX="$(CC)"
44 echo Using DSOFLAGS="$(DSOFLAGS)"
45 echo Using LDFLAGS="$(LDFLAGS)"
46 echo Using LIBS="$(LIBS)"
47 for dir in $(DIRS); do\
48 echo Making all in $$dir... ;\
49 (cd $$dir ; $(MAKE) $(MFLAGS) all $(UNITTESTS)) || exit 1;\
50 done
51
52
53 #
54 # Make library targets...
55 #
56
57 libs:
58 echo Using ARCHFLAGS="$(ARCHFLAGS)"
59 echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
60 echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
61 echo Using CC="$(CC)"
62 echo Using CXX="$(CC)"
63 echo Using DSOFLAGS="$(DSOFLAGS)"
64 echo Using LDFLAGS="$(LDFLAGS)"
65 echo Using LIBS="$(LIBS)"
66 for dir in $(DIRS); do\
67 echo Making libraries in $$dir... ;\
68 (cd $$dir ; $(MAKE) $(MFLAGS) libs) || exit 1;\
69 done
70
71
72 #
73 # Make unit test targets...
74 #
75
76 unittests:
77 echo Using ARCHFLAGS="$(ARCHFLAGS)"
78 echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
79 echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
80 echo Using CC="$(CC)"
81 echo Using CXX="$(CC)"
82 echo Using DSOFLAGS="$(DSOFLAGS)"
83 echo Using LDFLAGS="$(LDFLAGS)"
84 echo Using LIBS="$(LIBS)"
85 for dir in $(DIRS); do\
86 echo Making all in $$dir... ;\
87 (cd $$dir ; $(MAKE) $(MFLAGS) unittests) || exit 1;\
88 done
89
90
91 #
92 # Remove object and target files...
93 #
94
95 clean:
96 for dir in $(DIRS); do\
97 echo Cleaning in $$dir... ;\
98 (cd $$dir; $(MAKE) $(MFLAGS) clean) || exit 1;\
99 done
100
101
102 #
103 # Remove all non-distribution files...
104 #
105
106 distclean: clean
107 $(RM) Makedefs config.h config.log config.status
108 $(RM) cups-config
109 $(RM) conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf
110 $(RM) doc/help/ref-cupsd-conf.html doc/help/standard.html doc/index.html
111 $(RM) man/client.conf.man
112 $(RM) man/cups-deviced.man man/cups-driverd.man
113 $(RM) man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man
114 $(RM) man/cupsd.conf.man man/drv.man man/lpoptions.man
115 $(RM) packaging/cups.list
116 $(RM) packaging/cups-desc.plist packaging/cups-info.plist
117 $(RM) templates/header.tmpl
118 $(RM) desktop/cups.desktop
119 $(RM) scheduler/cups.sh scheduler/cups-lpd.xinetd
120 $(RM) scheduler/org.cups.cups-lpd.plist scheduler/cups.xml
121 -$(RM) doc/*/index.html
122 -$(RM) templates/*/header.tmpl
123 -$(RM) -r autom4te*.cache clang cups/charmaps cups/locale driver/test
124
125
126 #
127 # Make dependencies
128 #
129
130 depend:
131 for dir in $(DIRS); do\
132 echo Making dependencies in $$dir... ;\
133 (cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1;\
134 done
135
136
137 #
138 # Run the clang.llvm.org static code analysis tool on the C sources.
139 # (at least checker-231 is required for scan-build to work this way)
140 #
141
142 .PHONY: clang clang-changes
143 clang:
144 $(RM) -r clang
145 scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all
146 clang-changes:
147 scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all
148
149
150 #
151 # Generate a ctags file...
152 #
153
154 ctags:
155 ctags -R .
156
157
158 #
159 # Install everything...
160 #
161
162 install: install-data install-headers install-libs install-exec
163
164
165 #
166 # Install data files...
167 #
168
169 install-data:
170 for dir in $(DIRS); do\
171 echo Installing data files in $$dir... ;\
172 (cd $$dir; $(MAKE) $(MFLAGS) install-data) || exit 1;\
173 done
174 echo Installing cups-config script...
175 $(INSTALL_DIR) -m 755 $(BINDIR)
176 $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config
177
178
179 #
180 # Install header files...
181 #
182
183 install-headers:
184 for dir in $(DIRS); do\
185 echo Installing header files in $$dir... ;\
186 (cd $$dir; $(MAKE) $(MFLAGS) install-headers) || exit 1;\
187 done
188 if test "x$(privateinclude)" != x; then \
189 echo Installing config.h into $(PRIVATEINCLUDE)...; \
190 $(INSTALL_DIR) -m 755 $(PRIVATEINCLUDE); \
191 $(INSTALL_DATA) config.h $(PRIVATEINCLUDE)/config.h; \
192 fi
193
194
195 #
196 # Install programs...
197 #
198
199 install-exec: all
200 for dir in $(DIRS); do\
201 echo Installing programs in $$dir... ;\
202 (cd $$dir; $(MAKE) $(MFLAGS) install-exec) || exit 1;\
203 done
204
205
206 #
207 # Install libraries...
208 #
209
210 install-libs: libs
211 for dir in $(DIRS); do\
212 echo Installing libraries in $$dir... ;\
213 (cd $$dir; $(MAKE) $(MFLAGS) install-libs) || exit 1;\
214 done
215
216
217 #
218 # Uninstall object and target files...
219 #
220
221 uninstall:
222 for dir in $(DIRS); do\
223 echo Uninstalling in $$dir... ;\
224 (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\
225 done
226 echo Uninstalling cups-config script...
227 $(RM) $(BINDIR)/cups-config
228 -$(RMDIR) $(BINDIR)
229
230
231 #
232 # Run the test suite...
233 #
234
235 test: all unittests
236 echo Running CUPS test suite...
237 cd test; ./run-stp-tests.sh
238
239
240 check: all unittests
241 echo Running CUPS test suite with defaults...
242 cd test; ./run-stp-tests.sh 1 0 n
243
244
245 #
246 # Create HTML documentation...
247 #
248
249 apihelp:
250 for dir in cgi-bin cups filter driver ppdc scheduler; do\
251 echo Generating API help in $$dir... ;\
252 (cd $$dir; $(MAKE) $(MFLAGS) apihelp) || exit 1;\
253 done
254
255 framedhelp:
256 for dir in cgi-bin cups filter driver ppdc scheduler; do\
257 echo Generating framed API help in $$dir... ;\
258 (cd $$dir; $(MAKE) $(MFLAGS) framedhelp) || exit 1;\
259 done
260
261
262 #
263 # Create an Xcode docset...
264 #
265
266 docset: apihelp
267 echo Generating docset directory tree...
268 $(RM) -r org.cups.docset
269 mkdir -p org.cups.docset/Contents/Resources/Documentation/help
270 mkdir -p org.cups.docset/Contents/Resources/Documentation/images
271 cd man; $(MAKE) $(MFLAGS) html
272 cd doc; $(MAKE) $(MFLAGS) docset
273 cd cgi-bin; $(MAKE) $(MFLAGS) makedocset
274 cgi-bin/makedocset org.cups.docset \
275 `svnversion . | sed -e '1,$$s/[a-zA-Z]//g'` \
276 doc/help/api-*.tokens
277 $(RM) doc/help/api-*.tokens
278 echo Indexing docset...
279 /Developer/usr/bin/docsetutil index org.cups.docset
280 echo Generating docset archive and feed...
281 $(RM) org.cups.docset.atom
282 /Developer/usr/bin/docsetutil package --output org.cups.docset.xar \
283 --atom org.cups.docset.atom \
284 --download-url http://www.cups.org/org.cups.docset.xar \
285 org.cups.docset
286
287
288 #
289 # Make software distributions using EPM (http://www.epmhome.org/)...
290 #
291
292 EPMFLAGS = -v --output-dir dist $(EPMARCH)
293
294 aix bsd deb depot inst pkg setld slackware swinstall tardist:
295 epm $(EPMFLAGS) -f $@ cups packaging/cups.list
296
297 epm:
298 epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list
299
300 osx:
301 epm $(EPMFLAGS) -f osx -s packaging/installer.tif cups packaging/cups.list
302
303 rpm:
304 epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list
305
306 .PHONEY: dist
307 dist: all
308 $(RM) -r dist
309 $(MAKE) $(MFLAGS) epm
310 case `uname` in \
311 *BSD*) $(MAKE) $(MFLAGS) bsd;; \
312 Darwin*) $(MAKE) $(MFLAGS) osx;; \
313 IRIX*) $(MAKE) $(MFLAGS) tardist;; \
314 Linux*) test ! -x /usr/bin/rpm || $(MAKE) $(MFLAGS) rpm;; \
315 SunOS*) $(MAKE) $(MFLAGS) pkg;; \
316 esac
317
318
319 #
320 # End of "$Id: Makefile 7961 2008-09-17 19:52:46Z mike $".
321 #