xref: /titanic_41/usr/src/cmd/Makefile (revision c04062bdc8dc59c4474832b0ca88e697ead10df2)
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	arcwatch	\
62	arch		\
63	asa		\
64	ast		\
65	audio		\
66	auths		\
67	autopush	\
68	avs		\
69	awk		\
70	awk_xpg4	\
71	backup		\
72	banner		\
73	bart		\
74	basename	\
75	bc		\
76	bdiff		\
77	beadm		\
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	kbd		\
220	keyserv		\
221	killall		\
222	krb5		\
223	ksh		\
224	kvmstat		\
225	last		\
226	lastcomm	\
227	latencytop	\
228	ldap		\
229	ldapcachemgr	\
230	lgrpinfo	\
231	line		\
232	link		\
233	dlmgmtd		\
234	listen		\
235	loadkeys	\
236	locale		\
237	localedef	\
238	lockstat	\
239	locator		\
240	lofiadm		\
241	logadm		\
242	logger		\
243	login		\
244	logins		\
245	look		\
246	ls		\
247	luxadm		\
248	lvm		\
249	mach		\
250	mail		\
251	mailwrapper	\
252	mailx		\
253	make		\
254	makekey		\
255	man		\
256	mandoc		\
257	mdb		\
258	mesg		\
259	mkdir		\
260	mkfifo		\
261	mkfile		\
262	mkmsgs		\
263	mknod		\
264	mkpwdict	\
265	mktemp		\
266	modload		\
267	more		\
268	mpathadm	\
269	msgfmt		\
270	msgid		\
271	mt		\
272	mv		\
273	mvdir		\
274	ndmpadm		\
275	ndmpd		\
276	ndmpstat	\
277	netadm		\
278	netfiles	\
279	newform		\
280	newgrp		\
281	news		\
282	newtask		\
283	nice		\
284	nl		\
285	nlsadmin	\
286	nohup		\
287	nsadmin		\
288	nscd		\
289	oamuser		\
290	oawk		\
291	od		\
292	pack		\
293	pagesize	\
294	passmgmt	\
295	passwd		\
296	pathchk		\
297	pbind		\
298	pcidr		\
299	pcitool		\
300	pfexec		\
301	pfexecd		\
302	pginfo		\
303	pgstat		\
304	pgrep		\
305	picl		\
306	plimit		\
307	policykit	\
308	pools		\
309	power		\
310	powertop	\
311	ppgsz		\
312	pg		\
313	plockstat	\
314	pr		\
315	prctl		\
316	print		\
317	printf		\
318	priocntl	\
319	profiles	\
320	projadd		\
321	projects	\
322	prstat		\
323	prtconf		\
324	prtdiag		\
325	prtvtoc		\
326	ps		\
327	psradm		\
328	psrinfo		\
329	psrset		\
330	ptools		\
331	pwck		\
332	pwconv		\
333	pwd		\
334	pyzfs		\
335	raidctl		\
336	ramdiskadm	\
337	rcap		\
338	rcm_daemon	\
339	rctladm		\
340	refer		\
341	regcmp		\
342	renice		\
343	rexd		\
344	rm		\
345	rmdir		\
346	rmformat	\
347	rmmount		\
348	rmt		\
349	rmvolmgr	\
350	roles		\
351	rpcbind		\
352	rpcgen		\
353	rpcinfo		\
354	rpcsvc		\
355	runat		\
356	sa		\
357	saf		\
358	sasinfo		\
359	savecore	\
360	sbdadm		\
361	script		\
362	scsi		\
363	sdiff		\
364	sdpadm		\
365	sed		\
366	sendmail	\
367	setfacl		\
368	setmnt		\
369	setpgrp		\
370	setuname	\
371	sgs		\
372	sh		\
373	shcomp		\
374	smbios		\
375	smbsrv		\
376	smserverd	\
377	soelim		\
378	sort		\
379	spell		\
380	split		\
381	sqlite		\
382	srchtxt		\
383	srptadm		\
384	srptsvc		\
385	ssh		\
386	stat		\
387	stmfadm		\
388	stmfproxy	\
389	stmfsvc		\
390	stmsboot	\
391	streams		\
392	strings		\
393	su		\
394	sulogin		\
395	sunpc		\
396	svc		\
397	svr4pkg		\
398	swap		\
399	sync		\
400	sysdef		\
401	syseventadm	\
402	syslogd		\
403	tabs		\
404	tail		\
405	tar		\
406	tbl		\
407	tcopy		\
408	tcpd		\
409	terminfo	\
410	th_tools	\
411	tic		\
412	time		\
413	tip		\
414	tnf		\
415	touch		\
416	tput		\
417	tr		\
418	trapstat	\
419	troff		\
420	true		\
421	truss		\
422	tsol		\
423	tty		\
424	ttymon		\
425	tzreload	\
426	uadmin		\
427	ul		\
428	uname		\
429	units		\
430	unlink		\
431	unpack		\
432	userattr	\
433	users		\
434	utmp_update	\
435	utmpd		\
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