xref: /titanic_50/usr/src/cmd/Makefile (revision ba4e3c84e6b9390bbf7df80b5f1d11dec34cc525)
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#
23#
24# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
25# Use is subject to license terms.
26#
27# ident	"%Z%%M%	%I%	%E% SMI"
28
29include ../Makefile.master
30
31#
32#	Note that the commands 'agents', 'lp', 'perl', and 'man' 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	agents		\
53	availdevs	\
54	lp		\
55	perl		\
56	man		\
57	Adm		\
58	abi		\
59	adbgen		\
60	acct		\
61	acctadm		\
62	arch		\
63	asa		\
64	audio		\
65	auths		\
66	autopush	\
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	dfs.cmds	\
124	diff		\
125	diff3		\
126	diffmk		\
127	dircmp		\
128	dirname		\
129	dis		\
130	diskmgtd	\
131	dispadmin	\
132	dladm		\
133	dmesg		\
134	dtrace		\
135	du		\
136	dumpadm		\
137	dumpcs		\
138	echo		\
139	ed		\
140	eeprom		\
141	egrep		\
142	emul64ioctl	\
143	enhance		\
144	env		\
145	eqn		\
146	expand		\
147	expr		\
148	exstr		\
149	factor		\
150	false		\
151	fdetach		\
152	fdformat	\
153	fdisk		\
154	filesync	\
155	fgrep		\
156	file		\
157	find		\
158	fm		\
159	fmli		\
160	fmt		\
161	fmthard		\
162	fmtmsg		\
163	fold		\
164	format		\
165	fstyp		\
166	fs.d		\
167	fuser		\
168	gcore		\
169	gencat		\
170	geniconvtbl	\
171	genmsg		\
172	getconf		\
173	getdevpolicy	\
174	getent		\
175	getfacl		\
176	getmajor	\
177	getopt		\
178	gettext		\
179	gettxt		\
180	graph		\
181	grep		\
182	grep_xpg4	\
183	groups		\
184	grpck		\
185	gss		\
186	halt		\
187	head		\
188	hostid		\
189	hostname	\
190	id		\
191	infocmp		\
192	init		\
193	initpkg		\
194	install.d	\
195	intrd		\
196	intrstat	\
197	ipcrm		\
198	ipcs		\
199	ipf		\
200	isainfo		\
201	isalist		\
202	iscsi		\
203	java		\
204	join		\
205	kbd		\
206	keyserv		\
207	killall		\
208	krb5		\
209	kstat		\
210	last		\
211	lastcomm	\
212	ldap		\
213	ldapcachemgr	\
214	line		\
215	link		\
216	listen		\
217	loadkeys	\
218	locale		\
219	lockstat	\
220	locator		\
221	lofiadm		\
222	logadm		\
223	logger		\
224	login		\
225	logins		\
226	logname		\
227	look		\
228	ls		\
229	lvm		\
230	mach		\
231	machid		\
232	mail		\
233	mailx		\
234	makekey		\
235	mdb		\
236	mesg		\
237	mkdir		\
238	mkfifo		\
239	mkfile		\
240	mkmsgs		\
241	mknod		\
242	mkpwdict	\
243	mktemp		\
244	modload		\
245	more		\
246	msgfmt		\
247	msgid		\
248	mt		\
249	mv		\
250	mvdir		\
251	netadm		\
252	netfiles	\
253	newform		\
254	newgrp		\
255	news		\
256	newtask		\
257	nice		\
258	nispasswd	\
259	nl		\
260	nlsadmin	\
261	nohup		\
262	nsadmin		\
263	nscd		\
264	oamuser		\
265	oawk		\
266	openssl		\
267	pack		\
268	pagesize	\
269	passmgmt	\
270	passwd		\
271	paste		\
272	pathchk		\
273	pbind		\
274	pcidr		\
275	pcmciad		\
276	pfexec		\
277	pgrep		\
278	picl		\
279	plimit		\
280	pools		\
281	power		\
282	ppgsz		\
283	pg		\
284	plockstat	\
285	pr		\
286	prctl		\
287	print		\
288	priocntl	\
289	profiles	\
290	projadd		\
291	projects	\
292	prstat		\
293	prtconf		\
294	prtdiag		\
295	prtvtoc		\
296	ps		\
297	psradm		\
298	psrinfo		\
299	psrset		\
300	pt_chmod	\
301	ptools		\
302	pwck		\
303	pwconv		\
304	pwd		\
305	raidctl		\
306	ramdiskadm	\
307	rcap		\
308	rcm_daemon	\
309	rctladm		\
310	refer		\
311	regcmp		\
312	renice		\
313	rexd		\
314	rm		\
315	rmdir		\
316	rmformat	\
317	rmt		\
318	roles		\
319	rpcbind		\
320	rpcgen		\
321	rpcinfo		\
322	rpcsvc		\
323	rpld		\
324	runat		\
325	sa		\
326	saf		\
327	savecore	\
328	script		\
329	sdiff		\
330	sendmail	\
331	setfacl		\
332	setmnt		\
333	setpgrp		\
334	setuname	\
335	sgs		\
336	sh		\
337	sleep		\
338	smbios		\
339	smserverd	\
340	soelim		\
341	sort		\
342	spell		\
343	spline		\
344	split		\
345	srchtxt		\
346	ssh		\
347	stat		\
348	streams		\
349	strings		\
350	su		\
351	sulogin		\
352	sum		\
353	sunpc		\
354	svc		\
355	swap		\
356	sync		\
357	sysdef		\
358	syseventadm	\
359	syslogd		\
360	tabs		\
361	tar		\
362	tbl		\
363	tcopy		\
364	tcpd		\
365	tee		\
366	terminfo	\
367	th_tools	\
368	tic		\
369	time		\
370	tip		\
371	tnf		\
372	touch		\
373	tplot		\
374	tput		\
375	trapstat	\
376	troff		\
377	true		\
378	truss		\
379	tty		\
380	ttymon		\
381	uadmin		\
382	ul		\
383	uname		\
384	uniq		\
385	units		\
386	unlink		\
387	unpack		\
388	users		\
389	utmp_update	\
390	utmpd		\
391	valtools	\
392	vgrind		\
393	vi		\
394	volmgt		\
395	w		\
396	wall		\
397	wbem		\
398	wc		\
399	which		\
400	who		\
401	whodo		\
402	wracct		\
403	write		\
404	xntpd		\
405	xargs		\
406	xstr		\
407	yes		\
408	ypcmd		\
409	yppasswd	\
410	zdb		\
411	zdump		\
412	zfs		\
413	zic		\
414	zinject		\
415	zlogin		\
416	zoneadm		\
417	zoneadmd	\
418	zonecfg		\
419	zonename	\
420	zpool		\
421	ztest
422
423$(CLOSED_BUILD)COMMON_SUBDIRS += \
424	$(CLOSED)/cmd/dodatadm	\
425	$(CLOSED)/cmd/iconv	\
426	$(CLOSED)/cmd/ksh	\
427	$(CLOSED)/cmd/llc2	\
428	$(CLOSED)/cmd/localedef	\
429	$(CLOSED)/cmd/more_xpg4	\
430	$(CLOSED)/cmd/mtst	\
431	$(CLOSED)/cmd/od	\
432	$(CLOSED)/cmd/patch	\
433	$(CLOSED)/cmd/pax	\
434	$(CLOSED)/cmd/pcitool	\
435	$(CLOSED)/cmd/printf	\
436	$(CLOSED)/cmd/sed	\
437	$(CLOSED)/cmd/sed_xpg4	\
438	$(CLOSED)/cmd/smartcard	\
439	$(CLOSED)/cmd/tail	\
440	$(CLOSED)/cmd/tr	\
441	$(CLOSED)/cmd/tr_xpg4
442
443i386_SUBDIRS=		\
444	addbadsec	\
445	biosdev		\
446	diskscan	\
447	OWconfig	\
448	rtc
449
450sparc_SUBDIRS=		\
451	cvcd		\
452	dcs		\
453	drd		\
454	fruadm		\
455	oplhpd		\
456	prtdscp		\
457	prtfru		\
458	scadm		\
459	sckmd		\
460	sf880drd	\
461	stmsboot	\
462	vntsd		\
463	wrsmconf	\
464	wrsmstat
465
466#
467# Commands that are messaged.  Note that 'lp' and 'man' come first
468# (see previous comment about 'lp' and 'man').
469#
470MSGSUBDIRS=		\
471	lp		\
472	man		\
473	abi		\
474	acctadm		\
475	allocate	\
476	asa		\
477	audio		\
478	audit		\
479	auditd		\
480	auths		\
481	autopush	\
482	awk		\
483	awk_xpg4	\
484	backup		\
485	banner		\
486	bart		\
487	basename	\
488	bnu		\
489	bsmconv		\
490	bsmrecord	\
491	bsmunconv	\
492	busstat		\
493	cal		\
494	cat		\
495	cdrw		\
496	cfgadm		\
497	checkeq		\
498	checknr		\
499	chgrp		\
500	chmod		\
501	chown		\
502	cksum		\
503	cmd-crypto	\
504	cmd-inet	\
505	cmp		\
506	col		\
507	comm		\
508	compress	\
509	consadm		\
510	coreadm		\
511	cpio		\
512	cpc		\
513	cron		\
514	csh		\
515	csplit		\
516	ctrun		\
517	ctstat		\
518	ctwatch		\
519	cut		\
520	datadm		\
521	date		\
522	dc		\
523	dcs		\
524	dd		\
525	deroff		\
526	devfsadm	\
527	diff		\
528	diffmk		\
529	dladm		\
530	du		\
531	dumpcs		\
532	ed		\
533	env		\
534	eqn		\
535	expand		\
536	expr		\
537	fgrep		\
538	file		\
539	filesync	\
540	find		\
541	fm		\
542	fold		\
543	fs.d		\
544	geniconvtbl	\
545	genmsg		\
546	getconf		\
547	getent		\
548	gettext		\
549	gettxt		\
550	grep		\
551	grep_xpg4	\
552	grpck		\
553	gss		\
554	halt		\
555	head		\
556	hostname	\
557	id		\
558	isaexec		\
559	iscsi		\
560	join		\
561	krb5		\
562	kstat		\
563	last		\
564	ldap		\
565	ldapcachemgr	\
566	locale		\
567	lofiadm		\
568	logadm		\
569	logger		\
570	logins		\
571	logname		\
572	ls		\
573	lvm		\
574	mailx		\
575	mesg		\
576	mkdir		\
577	mkpwdict	\
578	mktemp		\
579	more		\
580	msgfmt		\
581	mv		\
582	newgrp		\
583	newtask		\
584	nice		\
585	nispasswd	\
586	nohup		\
587	oawk		\
588	pack		\
589	passwd		\
590	passmgmt	\
591	paste		\
592	pathchk		\
593	pfexec		\
594	pg		\
595	pgrep		\
596	picl            \
597	pools		\
598	power		\
599	pr		\
600	praudit		\
601	print		\
602	profiles	\
603	projadd		\
604	projects	\
605	prstat		\
606	prtdiag		\
607	ps		\
608	psrinfo		\
609	pwconv		\
610	pwd		\
611	raidctl		\
612	ramdiskadm	\
613	rcap		\
614	rcm_daemon	\
615	refer		\
616	regcmp		\
617	renice		\
618	roles		\
619	rm		\
620	rmdir		\
621	rmformat	\
622	scadm		\
623	script		\
624	sdiff		\
625	sgs		\
626	sh		\
627	sleep		\
628	sort		\
629	split		\
630	ssh		\
631	stat		\
632	strings		\
633	su		\
634	sum		\
635	svc		\
636	swap		\
637	syseventadm	\
638	syseventd	\
639	tabs		\
640	tar		\
641	tbl		\
642	tee		\
643	time		\
644	tnf		\
645	touch		\
646	tput		\
647	troff		\
648	tty		\
649	ttymon		\
650	ul		\
651	uname		\
652	uniq		\
653	units		\
654	unlink		\
655	unpack		\
656	valtools	\
657	vgrind		\
658	vi		\
659	volmgt		\
660	w		\
661	wbem		\
662	wc		\
663	who		\
664	whodo		\
665	wracct		\
666	write		\
667	xargs		\
668	yppasswd	\
669	zdump		\
670	zfs		\
671	zic		\
672	zlogin		\
673	zoneadm		\
674	zoneadmd	\
675	zonecfg		\
676	zonename	\
677	zpool
678
679$(CLOSED_BUILD)MSGSUBDIRS += \
680	$(CLOSED)/cmd/iconv	\
681	$(CLOSED)/cmd/ksh	\
682	$(CLOSED)/cmd/llc2	\
683	$(CLOSED)/cmd/localedef	\
684	$(CLOSED)/cmd/more_xpg4	\
685	$(CLOSED)/cmd/od	\
686	$(CLOSED)/cmd/patch	\
687	$(CLOSED)/cmd/pax	\
688	$(CLOSED)/cmd/printf	\
689	$(CLOSED)/cmd/sed	\
690	$(CLOSED)/cmd/sed_xpg4	\
691	$(CLOSED)/cmd/tail	\
692	$(CLOSED)/cmd/tr	\
693	$(CLOSED)/cmd/tr_xpg4
694
695sparc_MSGSUBDIRS=	\
696	fruadm		\
697	prtdscp		\
698	prtfru		\
699	stmsboot	\
700	vntsd		\
701	wrsmconf	\
702	wrsmstat
703
704#
705# commands that use dcgettext for localized time, LC_TIME
706#
707DCSUBDIRS=		\
708	cal		\
709	cfgadm		\
710	diff		\
711	ls		\
712	pr		\
713	tar		\
714	w		\
715	who		\
716	whodo		\
717	write
718
719$(CLOSED_BUILD)DCSUBDIRS += \
720	$(CLOSED)/cmd/pax
721
722#
723# commands that belong only to the basic security module
724#
725BSMSUBDIRS=		\
726	allocate	\
727	amt		\
728	audit		\
729	audit_warn	\
730	auditconfig	\
731	auditd		\
732	auditreduce	\
733	auditstat	\
734	praudit		\
735	bsmconv		\
736	bsmrecord	\
737	bsmunconv
738
739#
740# commands not owned by the systems group
741#
742BWOSDIRS=
743
744#
745# Commands providing manifests must offer a check target.  A recursive check
746# target across all commands directories is not currently provided.
747#
748MANIFEST_TOPDIRS=			\
749	auditd				\
750	bnu				\
751	consadm				\
752	coreadm				\
753	cron				\
754	cvcd				\
755	dispadmin			\
756	drd				\
757	dumpadm				\
758	eeprom				\
759	fm				\
760	intrd				\
761	ipf				\
762	keyserv				\
763	ldapcachemgr			\
764	nscd				\
765	oplhpd				\
766	power				\
767	rexd				\
768	rpcbind				\
769	rpcsvc				\
770	saf				\
771	sf880drd			\
772	smserverd			\
773	syseventd			\
774	syslogd				\
775	utmpd				\
776	vntsd				\
777	ypcmd				\
778	zoneadmd
779
780MANIFEST_SUBDIRS=			\
781	boot/scripts			\
782	cmd-crypto/scripts		\
783	cmd-inet/usr.lib/in.chargend	\
784	cmd-inet/usr.lib/in.daytimed	\
785	cmd-inet/usr.lib/in.dhcpd	\
786	cmd-inet/usr.lib/in.discardd	\
787	cmd-inet/usr.lib/in.echod	\
788	cmd-inet/usr.lib/in.timed	\
789	cmd-inet/usr.lib/inetd		\
790	cmd-inet/usr.lib/slpd		\
791	cmd-inet/usr.sbin		\
792	cmd-inet/usr.sbin/in.ftpd	\
793	cmd-inet/usr.sbin/in.talkd	\
794	dcs/sparc/sun4u			\
795	fs.d/autofs			\
796	fs.d/cachefs			\
797	fs.d/nfs/svc			\
798	gss/gssd			\
799	krb5/kadmin/server		\
800	krb5/krb5kdc			\
801	krb5/kwarn			\
802	krb5/slave			\
803	lp/cmd/lpsched			\
804	lvm/rpc.metad			\
805	lvm/rpc.metamedd		\
806	lvm/rpc.metamhd			\
807	lvm/md_monitord			\
808	lvm/metassist/sysfiles		\
809	lvm/util			\
810	picl/picld			\
811	print/gateway			\
812	print/lp			\
813	rcap/rcapd			\
814	rpcsvc/rpc.bootparamd		\
815	sendmail/lib			\
816	smartcard/daemon		\
817	ssh/etc				\
818	svc/milestone			\
819	ypcmd/yppasswd			\
820	ypcmd/ypupdated			\
821	xntpd/xntpd
822
823all :=		TARGET = all
824install :=	TARGET = install
825clean :=	TARGET = clean
826clobber :=	TARGET = clobber
827lint :=		TARGET = lint
828check :=	TARGET = check
829_msg :=		TARGET = _msg
830_dc :=		TARGET = _dc
831
832.KEEP_STATE:
833
834SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
835
836.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(BSMSUBDIRS) \
837		$(MANIFEST_SUBDIRS)
838
839all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) $(BSMSUBDIRS)
840
841check: svccfg_check .WAIT $(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS)
842
843svccfg_check:
844	@$(ECHO) "building requirements for svccfg check ..."; \
845	(cd $(SRC)/cmd/svc/svccfg && pwd && $(MAKE) $(MFLAGS) native)
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$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(BSMSUBDIRS) $(MANIFEST_SUBDIRS): FRC
858	@if [ -f $@/Makefile  ]; then \
859		cd $@; pwd; $(MAKE) $(TARGET); \
860	else \
861		true; \
862	fi
863
864FRC:
865