xref: /titanic_50/usr/src/cmd/Makefile (revision 9acbbeaf2a1ffe5c14b244867d427714fab43c5c)
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	fs.d		\
166	fstyp		\
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	lgrpinfo	\
215	line		\
216	link		\
217	listen		\
218	loadkeys	\
219	locale		\
220	lockstat	\
221	locator		\
222	lofiadm		\
223	logadm		\
224	logger		\
225	login		\
226	logins		\
227	logname		\
228	look		\
229	ls		\
230	lvm		\
231	mach		\
232	machid		\
233	mail		\
234	mailx		\
235	makekey		\
236	mdb		\
237	mesg		\
238	mkdir		\
239	mkfifo		\
240	mkfile		\
241	mkmsgs		\
242	mknod		\
243	mkpwdict	\
244	mktemp		\
245	modload		\
246	more		\
247	msgfmt		\
248	msgid		\
249	mt		\
250	mv		\
251	mvdir		\
252	netadm		\
253	netfiles	\
254	newform		\
255	newgrp		\
256	news		\
257	newtask		\
258	nice		\
259	nispasswd	\
260	nl		\
261	nlsadmin	\
262	nohup		\
263	nsadmin		\
264	nscd		\
265	oamuser		\
266	oawk		\
267	openssl		\
268	pack		\
269	pagesize	\
270	passmgmt	\
271	passwd		\
272	paste		\
273	pathchk		\
274	pbind		\
275	pcidr		\
276	pcmciad		\
277	pfexec		\
278	pgrep		\
279	picl		\
280	plimit		\
281	pools		\
282	power		\
283	ppgsz		\
284	pg		\
285	plockstat	\
286	pr		\
287	prctl		\
288	print		\
289	priocntl	\
290	profiles	\
291	projadd		\
292	projects	\
293	prstat		\
294	prtconf		\
295	prtdiag		\
296	prtvtoc		\
297	ps		\
298	psradm		\
299	psrinfo		\
300	psrset		\
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	lgrpinfo	\
567	locale		\
568	lofiadm		\
569	logadm		\
570	logger		\
571	logins		\
572	logname		\
573	ls		\
574	lvm		\
575	mailx		\
576	mesg		\
577	mkdir		\
578	mkpwdict	\
579	mktemp		\
580	more		\
581	msgfmt		\
582	mv		\
583	newgrp		\
584	newtask		\
585	nice		\
586	nispasswd	\
587	nohup		\
588	oawk		\
589	pack		\
590	passwd		\
591	passmgmt	\
592	paste		\
593	pathchk		\
594	pfexec		\
595	pg		\
596	pgrep		\
597	picl            \
598	pools		\
599	power		\
600	pr		\
601	praudit		\
602	print		\
603	profiles	\
604	projadd		\
605	projects	\
606	prstat		\
607	prtdiag		\
608	ps		\
609	psrinfo		\
610	ptools		\
611	pwconv		\
612	pwd		\
613	raidctl		\
614	ramdiskadm	\
615	rcap		\
616	rcm_daemon	\
617	refer		\
618	regcmp		\
619	renice		\
620	roles		\
621	rm		\
622	rmdir		\
623	rmformat	\
624	scadm		\
625	script		\
626	sdiff		\
627	sgs		\
628	sh		\
629	sleep		\
630	sort		\
631	split		\
632	ssh		\
633	stat		\
634	strings		\
635	su		\
636	sum		\
637	svc		\
638	swap		\
639	syseventadm	\
640	syseventd	\
641	tabs		\
642	tar		\
643	tbl		\
644	tee		\
645	time		\
646	tnf		\
647	touch		\
648	tput		\
649	troff		\
650	tty		\
651	ttymon		\
652	ul		\
653	uname		\
654	uniq		\
655	units		\
656	unlink		\
657	unpack		\
658	valtools	\
659	vgrind		\
660	vi		\
661	volmgt		\
662	w		\
663	wbem		\
664	wc		\
665	who		\
666	whodo		\
667	wracct		\
668	write		\
669	xargs		\
670	yppasswd	\
671	zdump		\
672	zfs		\
673	zic		\
674	zlogin		\
675	zoneadm		\
676	zoneadmd	\
677	zonecfg		\
678	zonename	\
679	zpool
680
681$(CLOSED_BUILD)MSGSUBDIRS += \
682	$(CLOSED)/cmd/iconv	\
683	$(CLOSED)/cmd/ksh	\
684	$(CLOSED)/cmd/llc2	\
685	$(CLOSED)/cmd/localedef	\
686	$(CLOSED)/cmd/more_xpg4	\
687	$(CLOSED)/cmd/od	\
688	$(CLOSED)/cmd/patch	\
689	$(CLOSED)/cmd/pax	\
690	$(CLOSED)/cmd/printf	\
691	$(CLOSED)/cmd/sed	\
692	$(CLOSED)/cmd/sed_xpg4	\
693	$(CLOSED)/cmd/tail	\
694	$(CLOSED)/cmd/tr	\
695	$(CLOSED)/cmd/tr_xpg4
696
697sparc_MSGSUBDIRS=	\
698	fruadm		\
699	prtdscp		\
700	prtfru		\
701	stmsboot	\
702	vntsd		\
703	wrsmconf	\
704	wrsmstat
705
706#
707# commands that use dcgettext for localized time, LC_TIME
708#
709DCSUBDIRS=		\
710	cal		\
711	cfgadm		\
712	diff		\
713	ls		\
714	pr		\
715	tar		\
716	w		\
717	who		\
718	whodo		\
719	write
720
721$(CLOSED_BUILD)DCSUBDIRS += \
722	$(CLOSED)/cmd/pax
723
724#
725# commands that belong only to the basic security module
726#
727BSMSUBDIRS=		\
728	allocate	\
729	amt		\
730	audit		\
731	audit_warn	\
732	auditconfig	\
733	auditd		\
734	auditreduce	\
735	auditstat	\
736	praudit		\
737	bsmconv		\
738	bsmrecord	\
739	bsmunconv
740
741#
742# commands not owned by the systems group
743#
744BWOSDIRS=
745
746#
747# Commands providing manifests must offer a check target.  A recursive check
748# target across all commands directories is not currently provided.
749#
750MANIFEST_TOPDIRS=			\
751	auditd				\
752	bnu				\
753	consadm				\
754	coreadm				\
755	cron				\
756	cvcd				\
757	dispadmin			\
758	drd				\
759	dumpadm				\
760	eeprom				\
761	fm				\
762	intrd				\
763	ipf				\
764	keyserv				\
765	ldapcachemgr			\
766	nscd				\
767	oplhpd				\
768	power				\
769	rexd				\
770	rpcbind				\
771	rpcsvc				\
772	saf				\
773	sf880drd			\
774	smserverd			\
775	syseventd			\
776	syslogd				\
777	utmpd				\
778	vntsd				\
779	ypcmd				\
780	zoneadmd
781
782MANIFEST_SUBDIRS=			\
783	boot/scripts			\
784	cmd-crypto/scripts		\
785	cmd-inet/usr.lib/in.chargend	\
786	cmd-inet/usr.lib/in.daytimed	\
787	cmd-inet/usr.lib/in.dhcpd	\
788	cmd-inet/usr.lib/in.discardd	\
789	cmd-inet/usr.lib/in.echod	\
790	cmd-inet/usr.lib/in.timed	\
791	cmd-inet/usr.lib/inetd		\
792	cmd-inet/usr.lib/slpd		\
793	cmd-inet/usr.sbin		\
794	cmd-inet/usr.sbin/in.ftpd	\
795	cmd-inet/usr.sbin/in.talkd	\
796	dcs/sparc/sun4u			\
797	fs.d/autofs			\
798	fs.d/cachefs			\
799	fs.d/nfs/svc			\
800	gss/gssd			\
801	krb5/kadmin/server		\
802	krb5/krb5kdc			\
803	krb5/kwarn			\
804	krb5/slave			\
805	lp/cmd/lpsched			\
806	lvm/rpc.metad			\
807	lvm/rpc.metamedd		\
808	lvm/rpc.metamhd			\
809	lvm/md_monitord			\
810	lvm/metassist/sysfiles		\
811	lvm/util			\
812	picl/picld			\
813	print/gateway			\
814	print/lp			\
815	rcap/rcapd			\
816	rpcsvc/rpc.bootparamd		\
817	sendmail/lib			\
818	smartcard/daemon		\
819	ssh/etc				\
820	svc/milestone			\
821	ypcmd/yppasswd			\
822	ypcmd/ypupdated			\
823	xntpd/xntpd
824
825all :=		TARGET = all
826install :=	TARGET = install
827clean :=	TARGET = clean
828clobber :=	TARGET = clobber
829lint :=		TARGET = lint
830check :=	TARGET = check
831_msg :=		TARGET = _msg
832_dc :=		TARGET = _dc
833
834.KEEP_STATE:
835
836SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
837
838.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(BSMSUBDIRS) \
839		$(MANIFEST_SUBDIRS)
840
841all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) $(BSMSUBDIRS)
842
843check: svccfg_check .WAIT $(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS)
844
845svccfg_check:
846	@$(ECHO) "building requirements for svccfg check ..."; \
847	(cd $(SRC)/cmd/svc/svccfg && pwd && $(MAKE) $(MFLAGS) native)
848
849#
850# The .WAIT directive works around an apparent bug in parallel make.
851# Evidently make was getting the target _msg vs. _dc confused under
852# some level of parallelization, causing some of the _dc objects
853# not to be built.
854#
855_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
856
857_dc: $(DCSUBDIRS)
858
859#
860# Dependencies
861#
862fs.d: fstyp
863
864$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(BSMSUBDIRS) $(MANIFEST_SUBDIRS): FRC
865	@if [ -f $@/Makefile  ]; then \
866		cd $@; pwd; $(MAKE) $(TARGET); \
867	else \
868		true; \
869	fi
870
871FRC:
872