xref: /titanic_41/usr/src/cmd/Makefile (revision 936260673937830abacea5e1c31988a86d2d9f0a)
1#
2# CDDL HEADER START
3#
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.
7#
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.
12#
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]
18#
19# CDDL HEADER END
20#
21
22# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
23# Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
24# Copyright (c) 2012 Joyent, Inc.  All rights reserved.
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
29include ../Makefile.master
30
31#
32#	Note that the commands 'lp', and 'perl' are first in
33#	the list, violating alphabetical order.  This is because they are very
34#	long-running and should be given the most wall-clock time for a
35#	parallel build.
36#
37#	Commands in the FIRST_SUBDIRS list are built before starting the build
38#	of other commands.  Currently this includes only 'isaexec' and
39#	'platexec'.  This is necessary because $(ROOT)/usr/lib/isaexec or
40#	$(ROOT)/usr/lib/platexec must exist when some other commands are built
41#	because their 'make install' creates a hard link to one of them.
42#
43#	Commands are listed one per line so that TeamWare can auto-merge most
44#	changes.
45#
46
47FIRST_SUBDIRS=		\
48	isaexec		\
49	platexec
50
51COMMON_SUBDIRS=		\
52	allocate	\
53	availdevs	\
54	lp		\
55	perl		\
56	Adm		\
57	abi		\
58	adbgen		\
59	acct		\
60	acctadm		\
61	arch		\
62	asa		\
63	ast		\
64	audio		\
65	auths		\
66	autopush	\
67	avs		\
68	awk		\
69	awk_xpg4	\
70	backup		\
71	banner		\
72	bart		\
73	basename	\
74	bc		\
75	bdiff		\
76	beadm		\
77	bfs		\
78	bnu		\
79	boot		\
80	busstat		\
81	cal		\
82	calendar	\
83	captoinfo	\
84	cat		\
85	cdrw		\
86	cfgadm		\
87	checkeq		\
88	checknr		\
89	chgrp		\
90	chmod		\
91	chown		\
92	chroot		\
93	clear		\
94	clinfo		\
95	cmd-crypto	\
96	cmd-inet	\
97	col		\
98	compress	\
99	consadm		\
100	coreadm		\
101	cpio		\
102	cpc		\
103	cron		\
104	crypt		\
105	csh		\
106	csplit		\
107	ctrun		\
108	ctstat		\
109	ctwatch		\
110	datadm		\
111	date		\
112	dc		\
113	dd		\
114	deroff		\
115	devfsadm	\
116	syseventd	\
117	devctl		\
118	devinfo		\
119	devmgmt		\
120	devprop		\
121	dfs.cmds	\
122	diff		\
123	diff3		\
124	diffmk		\
125	dircmp		\
126	dirname		\
127	dis		\
128	diskmgtd	\
129	dispadmin	\
130	dladm		\
131	dlstat		\
132	dmesg		\
133	dodatadm	\
134	dtrace		\
135	du		\
136	dumpadm		\
137	dumpcs		\
138	echo		\
139	ed		\
140	eeprom		\
141	egrep		\
142	eject		\
143	emul64ioctl	\
144	enhance		\
145	env		\
146	eqn		\
147	expand		\
148	expr		\
149	exstr		\
150	factor		\
151	false		\
152	fcinfo		\
153	fcoesvc		\
154	fdetach		\
155	fdformat	\
156	fdisk		\
157	filesync	\
158	fgrep		\
159	file		\
160	find		\
161	flowadm		\
162	flowstat	\
163	fm		\
164	fmt		\
165	fmthard		\
166	fmtmsg		\
167	fold		\
168	format		\
169	fs.d		\
170	fstyp		\
171	fuser		\
172	fwflash		\
173	gcore		\
174	gencat		\
175	geniconvtbl	\
176	genmsg		\
177	getconf		\
178	getdevpolicy	\
179	getent		\
180	getfacl		\
181	getmajor	\
182	getopt		\
183	gettext		\
184	gettxt		\
185	grep		\
186	grep_xpg4	\
187	groups		\
188	grpck		\
189	gss		\
190	hal		\
191	halt		\
192	head		\
193	hostid		\
194	hostname	\
195	hotplug		\
196	hotplugd	\
197	hwdata		\
198	ibd_upgrade	\
199	id		\
200	idmap		\
201	infocmp		\
202	init		\
203	initpkg		\
204	install.d	\
205	intrd		\
206	intrstat	\
207	ipcrm		\
208	ipcs		\
209	ipdadm		\
210	ipf		\
211	isainfo		\
212	isalist		\
213	itutools	\
214	iscsiadm	\
215	iscsid		\
216	iscsitsvc	\
217	isns		\
218	itadm		\
219	java		\
220	kbd		\
221	keyserv		\
222	killall		\
223	krb5		\
224	ksh		\
225	kvmstat		\
226	last		\
227	lastcomm	\
228	latencytop	\
229	ldap		\
230	ldapcachemgr	\
231	lgrpinfo	\
232	line		\
233	link		\
234	dlmgmtd		\
235	listen		\
236	loadkeys	\
237	locale		\
238	localedef	\
239	lockstat	\
240	locator		\
241	lofiadm		\
242	logadm		\
243	logger		\
244	login		\
245	logins		\
246	look		\
247	ls		\
248	luxadm		\
249	lvm		\
250	mach		\
251	machid		\
252	mail		\
253	mailwrapper	\
254	mailx		\
255	makekey		\
256	man		\
257	mandoc		\
258	mdb		\
259	mesg		\
260	mkdir		\
261	mkfifo		\
262	mkfile		\
263	mkmsgs		\
264	mknod		\
265	mkpwdict	\
266	mktemp		\
267	modload		\
268	more		\
269	mpathadm	\
270	msgfmt		\
271	msgid		\
272	mt		\
273	mv		\
274	mvdir		\
275	ndmpadm		\
276	ndmpd		\
277	ndmpstat	\
278	netadm		\
279	netfiles	\
280	newform		\
281	newgrp		\
282	news		\
283	newtask		\
284	nice		\
285	nl		\
286	nlsadmin	\
287	nohup		\
288	nsadmin		\
289	nscd		\
290	oamuser		\
291	oawk		\
292	od		\
293	pack		\
294	pagesize	\
295	passmgmt	\
296	passwd		\
297	pathchk		\
298	pbind		\
299	pcidr		\
300	pcitool		\
301	pfexec		\
302	pfexecd		\
303	pginfo		\
304	pgstat		\
305	pgrep		\
306	picl		\
307	plimit		\
308	policykit	\
309	pools		\
310	power		\
311	powertop	\
312	ppgsz		\
313	pg		\
314	plockstat	\
315	pr		\
316	prctl		\
317	print		\
318	printf		\
319	priocntl	\
320	profiles	\
321	projadd		\
322	projects	\
323	prstat		\
324	prtconf		\
325	prtdiag		\
326	prtvtoc		\
327	ps		\
328	psradm		\
329	psrinfo		\
330	psrset		\
331	ptools		\
332	pwck		\
333	pwconv		\
334	pwd		\
335	pyzfs		\
336	raidctl		\
337	ramdiskadm	\
338	rcap		\
339	rcm_daemon	\
340	rctladm		\
341	refer		\
342	regcmp		\
343	renice		\
344	rexd		\
345	rm		\
346	rmdir		\
347	rmformat	\
348	rmmount		\
349	rmt		\
350	rmvolmgr	\
351	roles		\
352	rpcbind		\
353	rpcgen		\
354	rpcinfo		\
355	rpcsvc		\
356	runat		\
357	sa		\
358	saf		\
359	sasinfo		\
360	savecore	\
361	sbdadm		\
362	script		\
363	scsi		\
364	sdiff		\
365	sdpadm		\
366	sed		\
367	sendmail	\
368	setfacl		\
369	setmnt		\
370	setpgrp		\
371	setuname	\
372	sgs		\
373	sh		\
374	shcomp		\
375	smbios		\
376	smbsrv		\
377	smserverd	\
378	soelim		\
379	sort		\
380	spell		\
381	split		\
382	sqlite		\
383	srchtxt		\
384	srptadm		\
385	srptsvc		\
386	ssh		\
387	stat		\
388	stmfadm		\
389	stmfproxy	\
390	stmfsvc		\
391	stmsboot	\
392	streams		\
393	strings		\
394	su		\
395	sulogin		\
396	sunpc		\
397	svc		\
398	svr4pkg		\
399	swap		\
400	sync		\
401	sysdef		\
402	syseventadm	\
403	syslogd		\
404	tabs		\
405	tail		\
406	tar		\
407	tbl		\
408	tcopy		\
409	tcpd		\
410	terminfo	\
411	th_tools	\
412	tic		\
413	time		\
414	tip		\
415	tnf		\
416	touch		\
417	tput		\
418	tr		\
419	trapstat	\
420	troff		\
421	true		\
422	truss		\
423	tsol		\
424	tty		\
425	ttymon		\
426	tzreload	\
427	uadmin		\
428	ul		\
429	uname		\
430	units		\
431	unlink		\
432	unpack		\
433	userattr	\
434	users		\
435	utmp_update	\
436	utmpd		\
437	valtools	\
438	vgrind		\
439	vi		\
440	volcheck	\
441	volrmmount	\
442	vrrpadm		\
443	vscan		\
444	vt		\
445	w		\
446	wall		\
447	which		\
448	who		\
449	whodo		\
450	wracct		\
451	write		\
452	wusbadm		\
453	xargs		\
454	xstr		\
455	yes		\
456	ypcmd		\
457	yppasswd	\
458	zdb		\
459	zdump		\
460	zevadm		\
461	zfs		\
462	zhack		\
463	zic		\
464	zinject		\
465	zlogin		\
466	zoneadm		\
467	zoneadmd	\
468	zonecfg		\
469	zonename	\
470	zpool		\
471	zlook		\
472	zonestat	\
473	zstreamdump	\
474	ztest
475
476i386_SUBDIRS=		\
477	acpihpd		\
478	addbadsec	\
479	biosdev		\
480	diskscan	\
481	lms		\
482	rtc		\
483	ucodeadm	\
484	xvm
485
486sparc_SUBDIRS=		\
487	cvcd		\
488	dcs		\
489	device_remap	\
490	drd		\
491	fruadm		\
492	ldmad		\
493	oplhpd		\
494	prtdscp		\
495	prtfru		\
496	scadm		\
497	sckmd		\
498	sf880drd	\
499	virtinfo	\
500	vntsd
501
502#
503# Commands that are messaged.  Note that 'lp' comes first
504# (see previous comment about 'lp'.)
505#
506MSGSUBDIRS=		\
507	lp		\
508	abi		\
509	acctadm		\
510	allocate	\
511	asa		\
512	audio		\
513	audit		\
514	auditconfig	\
515	auditd		\
516	auditrecord	\
517	auditset	\
518	auths		\
519	autopush	\
520	avs		\
521	awk		\
522	awk_xpg4	\
523	backup		\
524	banner		\
525	bart		\
526	basename	\
527	beadm		\
528	bnu		\
529	busstat		\
530	cal		\
531	cat		\
532	cdrw		\
533	cfgadm		\
534	checkeq		\
535	checknr		\
536	chgrp		\
537	chmod		\
538	chown		\
539	cmd-crypto	\
540	cmd-inet	\
541	col		\
542	compress	\
543	consadm		\
544	coreadm		\
545	cpio		\
546	cpc		\
547	cron		\
548	csh		\
549	csplit		\
550	ctrun		\
551	ctstat		\
552	ctwatch		\
553	datadm		\
554	date		\
555	dc		\
556	dcs		\
557	dd		\
558	deroff		\
559	devfsadm	\
560	dfs.cmds	\
561	diff		\
562	diffmk		\
563	dladm		\
564	dlstat		\
565	du		\
566	dumpcs		\
567	ed		\
568	eject		\
569	env		\
570	eqn		\
571	expand		\
572	expr		\
573	fcinfo		\
574	fgrep		\
575	file		\
576	filesync	\
577	find		\
578	flowadm		\
579	flowstat	\
580	fm		\
581	fold		\
582	fs.d		\
583	fwflash		\
584	geniconvtbl	\
585	genmsg		\
586	getconf		\
587	getent		\
588	gettext		\
589	gettxt		\
590	grep		\
591	grep_xpg4	\
592	grpck		\
593	gss		\
594	halt		\
595	head		\
596	hostname	\
597	hotplug		\
598	id		\
599	idmap		\
600	isaexec		\
601	iscsiadm	\
602	iscsid		\
603	isns		\
604	itadm		\
605	kbd		\
606	krb5		\
607	ksh		\
608	last		\
609	ldap		\
610	ldapcachemgr	\
611	lgrpinfo	\
612	locale		\
613	lofiadm		\
614	logadm		\
615	logger		\
616	logins		\
617	ls		\
618	luxadm		\
619	lvm		\
620	mailx		\
621	man		\
622	mesg		\
623	mkdir		\
624	mkpwdict	\
625	mktemp		\
626	more		\
627	mpathadm	\
628	msgfmt		\
629	mv		\
630	ndmpadm		\
631	ndmpstat	\
632	newgrp		\
633	newtask		\
634	nice		\
635	nohup		\
636	oawk		\
637	pack		\
638	passwd		\
639	passmgmt	\
640	pathchk		\
641	pfexec		\
642	pg		\
643	pgrep		\
644	picl            \
645	pools		\
646	power		\
647	pr		\
648	praudit		\
649	print		\
650	profiles	\
651	projadd		\
652	projects	\
653	prstat		\
654	prtdiag		\
655	ps		\
656	psrinfo		\
657	ptools		\
658	pwconv		\
659	pwd		\
660	pyzfs		\
661	raidctl		\
662	ramdiskadm	\
663	rcap		\
664	rcm_daemon	\
665	refer		\
666	regcmp		\
667	renice		\
668	roles		\
669	rm		\
670	rmdir		\
671	rmformat	\
672	rmmount		\
673	rmvolmgr	\
674	sasinfo		\
675	sbdadm		\
676	scadm		\
677	script		\
678	scsi		\
679	sdiff		\
680	sdpadm		\
681	sgs		\
682	sh		\
683	shcomp		\
684	smbsrv		\
685	sort		\
686	split		\
687	srptadm		\
688	ssh		\
689	stat		\
690	stmfadm		\
691	stmsboot	\
692	strings		\
693	su		\
694	svc		\
695	svr4pkg		\
696	swap		\
697	syseventadm	\
698	syseventd	\
699	tabs		\
700	tar		\
701	tbl		\
702	time		\
703	tnf		\
704	touch		\
705	tput		\
706	troff		\
707	tsol		\
708	tty		\
709	ttymon		\
710	tzreload	\
711	ul		\
712	uname		\
713	units		\
714	unlink		\
715	unpack		\
716	userattr	\
717	valtools	\
718	vgrind		\
719	vi		\
720	volcheck	\
721	volrmmount	\
722	vrrpadm		\
723	vscan		\
724	w		\
725	who		\
726	whodo		\
727	wracct		\
728	write		\
729	wusbadm		\
730	xargs		\
731	yppasswd	\
732	zdump		\
733	zevadm		\
734	zfs		\
735	zic		\
736	zlogin		\
737	zoneadm		\
738	zoneadmd	\
739	zonecfg		\
740	zonename	\
741	zpool		\
742	zonestat
743
744sparc_MSGSUBDIRS=	\
745	fruadm		\
746	prtdscp		\
747	prtfru		\
748	virtinfo	\
749	vntsd
750
751i386_MSGSUBDIRS=	\
752	ucodeadm
753
754#
755# commands that use dcgettext for localized time, LC_TIME
756#
757DCSUBDIRS=		\
758	cal		\
759	cfgadm		\
760	diff		\
761	ls		\
762	pr		\
763	ps		\
764	tar		\
765	w		\
766	who		\
767	whodo		\
768	write
769
770#
771# commands that belong only to audit.
772#
773AUDITSUBDIRS=		\
774	amt		\
775	audit		\
776	audit_warn	\
777	auditconfig	\
778	auditd		\
779	auditrecord	\
780	auditreduce	\
781	auditset	\
782	auditstat	\
783	praudit
784
785#
786# commands not owned by the systems group
787#
788BWOSDIRS=
789
790
791all :=		TARGET = all
792install :=	TARGET = install
793clean :=	TARGET = clean
794clobber :=	TARGET = clobber
795lint :=		TARGET = lint
796_msg :=		TARGET = _msg
797_dc :=		TARGET = _dc
798
799.KEEP_STATE:
800
801SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
802
803.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
804
805all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
806	$(AUDITSUBDIRS)
807
808#
809# Manifests cannot be checked in parallel, because we are using
810# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
811# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
812# we spawn off a sub-make to perform the non-parallel 'make check'
813#
814check:
815	$(MAKE) -f Makefile.check check
816
817#
818# The .WAIT directive works around an apparent bug in parallel make.
819# Evidently make was getting the target _msg vs. _dc confused under
820# some level of parallelization, causing some of the _dc objects
821# not to be built.
822#
823_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
824
825_dc: $(DCSUBDIRS)
826
827#
828# Dependencies
829#
830fs.d: fstyp
831ksh:	shcomp isaexec
832mdb:	terminfo
833print:	lp
834fmt:	mailx
835
836$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
837	@if [ -f $@/Makefile  ]; then \
838		cd $@; pwd; $(MAKE) $(TARGET); \
839	else \
840		true; \
841	fi
842
843FRC:
844