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