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