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