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