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