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