du: move under bmake, remove XPG4 conditionals
[unleashed.git] / usr / src / cmd / Makefile
blob68cdaee2800a3eeefbfbabe668b4f23e7b0688b3
2 # CDDL HEADER START
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
19 # CDDL HEADER END
23 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright (c) 2018, Joyent, Inc.
25 # Copyright (c) 2012 by Delphix. All rights reserved.
26 # Copyright (c) 2013 DEY Storage Systems, Inc. All rights reserved.
27 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
28 # Copyright 2016 Toomas Soome <tsoome@me.com>
29 # Copyright 2018 Nexenta Systems, Inc.
30 # Copyright 2018 Gary Mills
33 include ../Makefile.master
36 # Note that the command 'perl' is first in the list, violating
37 # alphabetical order. This is because it is very long-running and
38 # should be given the most wall-clock time for a parallel build.
40 # Commands in the FIRST_SUBDIRS list are built before starting the build
41 # of other commands. Currently this includes only 'isaexec' and
42 # 'platexec'. This is necessary because $(ROOT)/usr/lib/isaexec or
43 # $(ROOT)/usr/lib/platexec must exist when some other commands are built
44 # because their 'make install' creates a hard link to one of them.
47 FIRST_SUBDIRS= \
48 isaexec \
49 platexec
51 COMMON_SUBDIRS= \
52 perl \
53 Adm \
54 abi \
55 acct \
56 acctadm \
57 ahciem \
58 ast \
59 audio \
60 auths \
61 autopush \
62 backup \
63 basename \
64 bc \
65 boot \
66 busstat \
67 cal \
68 cdrw \
69 cfgadm \
70 chgrp \
71 chmod \
72 chown \
73 chroot \
74 cmd-crypto \
75 cmd-inet \
76 col \
77 compress \
78 consadm \
79 coreadm \
80 cpio \
81 cpc \
82 cron \
83 crypt \
84 csplit \
85 ctrun \
86 ctstat \
87 ctwatch \
88 cxgbetool \
89 datadm \
90 date \
91 dc \
92 dd \
93 devfsadm \
94 syseventd \
95 devctl \
96 devinfo \
97 devmgmt \
98 devprop \
99 dfs.cmds \
100 diff \
101 diff3 \
102 dircmp \
103 dirname \
104 diskinfo \
105 diskmgtd \
106 dispadmin \
107 dladm \
108 dlstat \
109 dlutil \
110 dmesg \
111 dodatadm \
112 dtrace \
113 dumpadm \
114 dumpcs \
115 ed \
116 eeprom \
117 eject \
118 emul64ioctl \
119 enhance \
120 expand \
121 expr \
122 exstr \
123 factor \
124 fcinfo \
125 fcoesvc \
126 fdetach \
127 fdformat \
128 fdisk \
129 ficl \
130 filesync \
131 find \
132 flowadm \
133 flowstat \
134 fm \
135 fmt \
136 fmthard \
137 fmtmsg \
138 fold \
139 format \
140 fs.d \
141 fstyp \
142 fuser \
143 fwflash \
144 gcore \
145 gencat \
146 geniconvtbl \
147 genmsg \
148 getconf \
149 getdevpolicy \
150 getent \
151 getfacl \
152 getmajor \
153 getopt \
154 gettext \
155 gettxt \
156 groups \
157 growfs \
158 grpck \
159 gss \
160 hal \
161 halt \
162 head \
163 hostid \
164 hostname \
165 hotplug \
166 hotplugd \
167 ibd_upgrade \
168 iconv \
169 idmap \
170 init \
171 initpkg \
172 intrd \
173 intrstat \
174 ipcrm \
175 ipcs \
176 ipdadm \
177 ipf \
178 isainfo \
179 isalist \
180 itutools \
181 iscsiadm \
182 iscsid \
183 iscsitsvc \
184 isns \
185 itadm \
186 kbd \
187 keyserv \
188 killall \
189 krb5 \
190 ksh \
191 kvmstat \
192 last \
193 lastcomm \
194 latencytop \
195 ldap \
196 ldapcachemgr \
197 lgrpinfo \
198 line \
199 link \
200 dlmgmtd \
201 listen \
202 loadkeys \
203 locale \
204 lockstat \
205 lofiadm \
206 logadm \
207 logger \
208 login \
209 logins \
210 look \
211 ls \
212 luxadm \
213 mail \
214 mailx \
215 make \
216 mdb \
217 mesg \
218 mkdir \
219 mkfifo \
220 mkfile \
221 mkmsgs \
222 mknod \
223 mkpwdict \
224 mktemp \
225 modload \
226 mpathadm \
227 msgfmt \
228 msgid \
229 mt \
230 mv \
231 mvdir \
232 ndmpadm \
233 ndmpd \
234 ndmpstat \
235 netadm \
236 netfiles \
237 newform \
238 newgrp \
239 news \
240 newtask \
241 nice \
242 nl \
243 nlsadmin \
244 nohup \
245 nscd \
246 oamuser \
247 od \
248 pack \
249 pagesize \
250 passmgmt \
251 passwd \
252 pathchk \
253 pbind \
254 pcidr \
255 pcitool \
256 pfexec \
257 pfexecd \
258 pginfo \
259 pgstat \
260 pgrep \
261 plimit \
262 policykit \
263 pools \
264 power \
265 powertop \
266 ppgsz \
267 pg \
268 plockstat \
269 pr \
270 prctl \
271 printenv \
272 printf \
273 priocntl \
274 profiles \
275 projadd \
276 projects \
277 prstat \
278 prtconf \
279 prtdiag \
280 prtvtoc \
281 ps \
282 psradm \
283 psrinfo \
284 psrset \
285 ptools \
286 pwck \
287 raidctl \
288 ramdiskadm \
289 rcap \
290 rcm_daemon \
291 rctladm \
292 refer \
293 regcmp \
294 renice \
295 rm \
296 rmdir \
297 rmformat \
298 rmmount \
299 rmvolmgr \
300 roles \
301 rpcbind \
302 rpcgen \
303 rpcinfo \
304 rpcsvc \
305 runat \
306 sa \
307 saf \
308 sasinfo \
309 savecore \
310 sbdadm \
311 script \
312 scsi \
313 sdiff \
314 sdpadm \
315 setfacl \
316 setmnt \
317 setpgrp \
318 sgs \
319 smbios \
320 smbsrv \
321 smserverd \
322 sort \
323 spell \
324 split \
325 sqlite \
326 srchtxt \
327 srptadm \
328 srptsvc \
329 stat \
330 stmfadm \
331 stmfsvc \
332 stmsboot \
333 streams \
334 strings \
335 su \
336 sulogin \
337 sunpc \
338 svc \
339 swap \
340 sync \
341 sysdef \
342 syseventadm \
343 syslogd \
344 tail \
345 tar \
346 tcpd \
347 th_tools \
348 tip \
349 terminfo \
350 touch \
351 tr \
352 trapstat \
353 truss \
354 tty \
355 ttymon \
356 tzreload \
357 units \
358 unlink \
359 unpack \
360 userattr \
361 users \
362 utmpd \
363 uuidgen \
364 volcheck \
365 volrmmount \
366 vrrpadm \
367 vscan \
368 vt \
370 wall \
371 who \
372 whodo \
373 wracct \
374 write \
375 xargs \
376 xstr \
377 ypcmd \
378 yppasswd \
379 zdb \
380 zdump \
381 zfs \
382 zhack \
383 zinject \
384 zlogin \
385 zoneadm \
386 zoneadmd \
387 zonecfg \
388 zonename \
389 zpool \
390 zlook \
391 zonestat \
392 zstreamdump \
393 ztest
395 i386_SUBDIRS= \
396 acpi \
397 acpihpd \
398 biosdev \
399 diskscan \
400 nvmeadm \
401 rtc \
402 ucodeadm \
403 xhci
406 # Commands that are messaged.
408 MSGSUBDIRS= \
409 abi \
410 acctadm \
411 audio \
412 auths \
413 autopush \
414 backup \
415 basename \
416 busstat \
417 cal \
418 cdrw \
419 cfgadm \
420 chgrp \
421 chmod \
422 chown \
423 cmd-crypto \
424 cmd-inet \
425 col \
426 compress \
427 consadm \
428 coreadm \
429 cpio \
430 cpc \
431 cron \
432 csplit \
433 ctrun \
434 ctstat \
435 ctwatch \
436 datadm \
437 date \
438 dc \
439 dd \
440 devfsadm \
441 dfs.cmds \
442 diff \
443 dladm \
444 dlstat \
445 dumpcs \
446 ed \
447 eject \
448 expand \
449 expr \
450 fcinfo \
451 filesync \
452 find \
453 flowadm \
454 flowstat \
455 fm \
456 fold \
457 fs.d \
458 fwflash \
459 geniconvtbl \
460 genmsg \
461 getconf \
462 getent \
463 gettext \
464 gettxt \
465 grpck \
466 gss \
467 halt \
468 head \
469 hostname \
470 hotplug \
471 iconv \
472 idmap \
473 isaexec \
474 iscsiadm \
475 iscsid \
476 isns \
477 itadm \
478 kbd \
479 krb5 \
480 ksh \
481 last \
482 ldap \
483 ldapcachemgr \
484 lgrpinfo \
485 locale \
486 lofiadm \
487 logadm \
488 logger \
489 logins \
490 ls \
491 luxadm \
492 mailx \
493 make \
494 mesg \
495 mkdir \
496 mkpwdict \
497 mktemp \
498 mpathadm \
499 msgfmt \
500 mv \
501 ndmpadm \
502 ndmpstat \
503 newgrp \
504 newtask \
505 nice \
506 nohup \
507 pack \
508 passwd \
509 passmgmt \
510 pathchk \
511 pfexec \
512 pg \
513 pgrep \
514 pools \
515 power \
516 pr \
517 profiles \
518 projadd \
519 projects \
520 prstat \
521 prtdiag \
522 ps \
523 psrinfo \
524 ptools \
525 raidctl \
526 ramdiskadm \
527 rcap \
528 rcm_daemon \
529 refer \
530 regcmp \
531 renice \
532 roles \
533 rm \
534 rmdir \
535 rmformat \
536 rmmount \
537 rmvolmgr \
538 sasinfo \
539 sbdadm \
540 script \
541 scsi \
542 sdiff \
543 sdpadm \
544 sgs \
545 smbsrv \
546 sort \
547 split \
548 srptadm \
549 stat \
550 stmfadm \
551 stmsboot \
552 strings \
553 su \
554 svc \
555 swap \
556 syseventadm \
557 syseventd \
558 tar \
559 touch \
560 tty \
561 ttymon \
562 tzreload \
563 units \
564 unlink \
565 unpack \
566 userattr \
567 volcheck \
568 volrmmount \
569 vrrpadm \
570 vscan \
572 who \
573 whodo \
574 wracct \
575 write \
576 xargs \
577 yppasswd \
578 zdump \
579 zfs \
580 zlogin \
581 zoneadm \
582 zoneadmd \
583 zonecfg \
584 zonename \
585 zpool \
586 zonestat
588 i386_MSGSUBDIRS= \
589 ucodeadm
592 # commands that use dcgettext for localized time, LC_TIME
594 DCSUBDIRS= \
595 cal \
596 cfgadm \
597 diff \
598 ls \
599 pr \
600 ps \
601 tar \
603 who \
604 whodo \
605 write
608 # commands not owned by the systems group
610 BWOSDIRS=
613 all := TARGET = all
614 install := TARGET = install
615 clean := TARGET = clean
616 clobber := TARGET = clobber
617 _msg := TARGET = _msg
618 _dc := TARGET = _dc
620 .KEEP_STATE:
622 SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
624 .PARALLEL: $(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS)
626 all install clean clobber: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS)
629 # Manifests cannot be checked in parallel, because we are using
630 # the global repository that is in $(SRC)/cmd/svc/seed/global.db.
631 # For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
632 # we spawn off a sub-make to perform the non-parallel 'make check'
634 check:
635 $(MAKE) -f Makefile.check check
638 # The .WAIT directive works around an apparent bug in parallel make.
639 # Evidently make was getting the target _msg vs. _dc confused under
640 # some level of parallelization, causing some of the _dc objects
641 # not to be built.
643 _msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
645 _dc: $(DCSUBDIRS)
648 # Dependencies
650 fs.d: fstyp
651 ksh: isaexec
652 mdb: terminfo
653 fmt: mailx
655 $(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS): FRC
656 @if [ -f $@/Makefile ]; then \
657 cd $@; pwd; $(MAKE) $(TARGET); \
658 else \
659 true; \
661 FRC: