xref: /titanic_41/usr/src/cmd/Makefile (revision fd9cb95cbb2f626355a60efb9d02c5f0a33c10e6)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27
28include ../Makefile.master
29
30#
31#	Note that the commands 'agents', 'lp', 'perl', and 'man' are first in
32#	the list, violating alphabetical order.  This is because they are very
33#	long-running and should be given the most wall-clock time for a
34#	parallel build.
35#
36#	Commands in the FIRST_SUBDIRS list are built before starting the build
37#	of other commands.  Currently this includes only 'isaexec' and
38#	'platexec'.  This is necessary because $(ROOT)/usr/lib/isaexec or
39#	$(ROOT)/usr/lib/platexec must exist when some other commands are built
40#	because their 'make install' creates a hard link to one of them.
41#
42#	Commands are listed one per line so that TeamWare can auto-merge most
43#	changes.
44#
45
46FIRST_SUBDIRS=		\
47	isaexec		\
48	platexec
49
50COMMON_SUBDIRS=		\
51	agents		\
52	availdevs	\
53	lp		\
54	perl		\
55	man		\
56	Adm		\
57	abi		\
58	adbgen		\
59	acct		\
60	acctadm		\
61	arch		\
62	asa		\
63	aset		\
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	diskmgtd	\
130	dispadmin	\
131	dladm		\
132	dmesg		\
133	dodatadm	\
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	iconv		\
191	id		\
192	infocmp		\
193	init		\
194	initpkg		\
195	install.d	\
196	intrd		\
197	intrstat	\
198	ipcrm		\
199	ipcs		\
200	ipf		\
201	isainfo		\
202	isalist		\
203	java		\
204	join		\
205	kbd		\
206	keyserv		\
207	killall		\
208	krb5		\
209	ksh		\
210	kstat		\
211	last		\
212	lastcomm	\
213	ldap		\
214	ldapcachemgr	\
215	line		\
216	link		\
217	listen		\
218	llc2		\
219	loadkeys	\
220	locale		\
221	localedef	\
222	lockstat	\
223	locator		\
224	lofiadm		\
225	logadm		\
226	logger		\
227	login		\
228	logins		\
229	logname		\
230	look		\
231	ls		\
232	lvm		\
233	mach		\
234	machid		\
235	mail		\
236	mailx		\
237	makekey		\
238	mdb		\
239	mesg		\
240	mkdir		\
241	mkfifo		\
242	mkfile		\
243	mkmsgs		\
244	mknod		\
245	mkpwdict	\
246	mktemp		\
247	modload		\
248	more		\
249	more_xpg4	\
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	od		\
271	openssl		\
272	pack		\
273	pagesize	\
274	passmgmt	\
275	passwd		\
276	paste		\
277	patch		\
278	pathchk		\
279	pax		\
280	pbind		\
281	pcitool		\
282	pcmciad		\
283	pfexec		\
284	pgrep		\
285	picl		\
286	plimit		\
287	pools		\
288	power		\
289	ppgsz		\
290	pg		\
291	plockstat	\
292	pr		\
293	prctl		\
294	print		\
295	printf		\
296	priocntl	\
297	profiles	\
298	projadd		\
299	projects	\
300	prstat		\
301	prtconf		\
302	prtdiag		\
303	prtvtoc		\
304	ps		\
305	psradm		\
306	psrinfo		\
307	psrset		\
308	pt_chmod	\
309	ptools		\
310	pwck		\
311	pwconv		\
312	pwd		\
313	raidctl		\
314	ramdiskadm	\
315	rcap		\
316	rcm_daemon	\
317	rctladm		\
318	refer		\
319	regcmp		\
320	renice		\
321	rexd		\
322	rm		\
323	rmdir		\
324	rmformat	\
325	rmt		\
326	roles		\
327	rpcbind		\
328	rpcgen		\
329	rpcinfo		\
330	rpcsvc		\
331	rpld		\
332	runat		\
333	sa		\
334	saf		\
335	savecore	\
336	script		\
337	sdiff		\
338	sed		\
339	sed_xpg4	\
340	sendmail	\
341	setfacl		\
342	setmnt		\
343	setpgrp		\
344	setuname	\
345	sgs		\
346	sh		\
347	sleep		\
348	smartcard	\
349	smbios		\
350	smserverd	\
351	soelim		\
352	sort		\
353	spell		\
354	spline		\
355	split		\
356	srchtxt		\
357	ssh		\
358	stat		\
359	streams		\
360	strings		\
361	su		\
362	sulogin		\
363	sum		\
364	sunpc		\
365	svc		\
366	swap		\
367	sync		\
368	sysdef		\
369	syseventadm	\
370	syslogd		\
371	tabs		\
372	tail		\
373	tar		\
374	tbl		\
375	tcopy		\
376	tcpd		\
377	tee		\
378	terminfo	\
379	th_tools	\
380	tic		\
381	time		\
382	tip		\
383	tnf		\
384	touch		\
385	tplot		\
386	tput		\
387	tr		\
388	tr_xpg4		\
389	trapstat	\
390	troff		\
391	true		\
392	truss		\
393	tty		\
394	ttymon		\
395	uadmin		\
396	ul		\
397	uname		\
398	uniq		\
399	units		\
400	unlink		\
401	unpack		\
402	users		\
403	utmp_update	\
404	utmpd		\
405	valtools	\
406	vgrind		\
407	vi		\
408	volmgt		\
409	w		\
410	wall		\
411	wbem		\
412	wc		\
413	which		\
414	who		\
415	whodo		\
416	wracct		\
417	write		\
418	xntpd		\
419	xargs		\
420	xstr		\
421	yes		\
422	ypcmd		\
423	yppasswd	\
424	zdb		\
425	zdump		\
426	zfs		\
427	zic		\
428	zlogin		\
429	zoneadm		\
430	zoneadmd	\
431	zonecfg		\
432	zonename	\
433	zpool		\
434	ztest
435
436i386_SUBDIRS=		\
437	addbadsec	\
438	biosdev		\
439	diskscan	\
440	OWconfig	\
441	rtc
442
443sparc_SUBDIRS=		\
444	cvcd		\
445	dcs		\
446	fruadm		\
447	mtst		\
448	prtfru		\
449	scadm		\
450	sckmd		\
451	sf880drd	\
452	stmsboot	\
453	wrsmconf	\
454	wrsmstat
455
456#
457# Commands that are messaged.  Note that 'lp' and 'man' come first
458# (see previous comment about 'lp' and 'man').
459#
460MSGSUBDIRS=		\
461	lp		\
462	man		\
463	abi		\
464	acctadm		\
465	allocate	\
466	asa		\
467	audio		\
468	audit		\
469	auditd		\
470	auths		\
471	autopush	\
472	awk		\
473	awk_xpg4	\
474	backup		\
475	banner		\
476	bart		\
477	basename	\
478	bnu		\
479	bsmconv		\
480	bsmrecord	\
481	bsmunconv	\
482	busstat		\
483	cal		\
484	cat		\
485	cdrw		\
486	cfgadm		\
487	checkeq		\
488	checknr		\
489	chgrp		\
490	chmod		\
491	chown		\
492	cksum		\
493	cmd-crypto	\
494	cmd-inet	\
495	cmp		\
496	col		\
497	comm		\
498	compress	\
499	consadm		\
500	coreadm		\
501	cpio		\
502	cpc		\
503	cron		\
504	csh		\
505	csplit		\
506	ctrun		\
507	ctstat		\
508	ctwatch		\
509	cut		\
510	datadm		\
511	date		\
512	dc		\
513	dcs		\
514	dd		\
515	deroff		\
516	devfsadm	\
517	diff		\
518	diffmk		\
519	dladm		\
520	du		\
521	dumpcs		\
522	ed		\
523	env		\
524	eqn		\
525	expand		\
526	expr		\
527	fgrep		\
528	file		\
529	filesync	\
530	find		\
531	fm		\
532	fold		\
533	fs.d		\
534	geniconvtbl	\
535	genmsg		\
536	getconf		\
537	getent		\
538	gettext		\
539	gettxt		\
540	grep		\
541	grep_xpg4	\
542	grpck		\
543	gss		\
544	halt		\
545	head		\
546	hostname	\
547	iconv		\
548	id		\
549	isaexec		\
550	join		\
551	krb5		\
552	ksh		\
553	kstat		\
554	last		\
555	ldap		\
556	ldapcachemgr	\
557	llc2		\
558	locale		\
559	localedef	\
560	lofiadm		\
561	logadm		\
562	logger		\
563	logins		\
564	logname		\
565	ls		\
566	lvm		\
567	mailx		\
568	mesg		\
569	mkdir		\
570	mkpwdict	\
571	mktemp		\
572	more		\
573	more_xpg4	\
574	msgfmt		\
575	mv		\
576	newgrp		\
577	newtask		\
578	nice		\
579	nispasswd	\
580	nohup		\
581	oawk		\
582	od		\
583	pack		\
584	passwd		\
585	passmgmt	\
586	paste		\
587	patch		\
588	pathchk		\
589	pax		\
590	pfexec		\
591	pg		\
592	pgrep		\
593	picl            \
594	pools		\
595	power		\
596	pr		\
597	praudit		\
598	print		\
599	printf		\
600	profiles	\
601	projadd		\
602	projects	\
603	prstat		\
604	prtdiag		\
605	ps		\
606	psrinfo		\
607	pwconv		\
608	pwd		\
609	raidctl		\
610	ramdiskadm	\
611	rcap		\
612	rcm_daemon	\
613	refer		\
614	regcmp		\
615	renice		\
616	roles		\
617	rm		\
618	rmdir		\
619	rmformat	\
620	scadm		\
621	script		\
622	sdiff		\
623	sed		\
624	sed_xpg4	\
625	sgs		\
626	sh		\
627	sleep		\
628	sort		\
629	split		\
630	ssh		\
631	strings		\
632	su		\
633	sum		\
634	svc		\
635	swap		\
636	syseventadm	\
637	syseventd	\
638	tabs		\
639	tail		\
640	tar		\
641	tbl		\
642	tee		\
643	time		\
644	tnf		\
645	touch		\
646	tput		\
647	tr		\
648	tr_xpg4		\
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
681sparc_MSGSUBDIRS=	\
682	fruadm		\
683	prtfru		\
684	stmsboot	\
685	wrsmconf	\
686	wrsmstat
687
688#
689# commands that use dcgettext for localized time, LC_TIME
690#
691DCSUBDIRS=		\
692	cal		\
693	cfgadm		\
694	diff		\
695	ls		\
696	pax		\
697	pr		\
698	tar		\
699	w		\
700	who		\
701	whodo		\
702	write
703
704#
705# commands that belong only to the basic security module
706#
707BSMSUBDIRS=		\
708	allocate	\
709	amt		\
710	audit		\
711	audit_warn	\
712	auditconfig	\
713	auditd		\
714	auditreduce	\
715	auditstat	\
716	dminfo		\
717	praudit		\
718	bsmconv		\
719	bsmrecord	\
720	bsmunconv
721
722#
723# commands not owned by the systems group
724#
725BWOSDIRS=
726
727#
728# Commands providing manifests must offer a check target.  A recursive check
729# target across all commands directories is not currently provided.
730#
731MANIFEST_TOPDIRS=			\
732	auditd				\
733	bnu				\
734	consadm				\
735	coreadm				\
736	cron				\
737	cvcd				\
738	dumpadm				\
739	eeprom				\
740	fm				\
741	intrd				\
742	ipf				\
743	keyserv				\
744	ldapcachemgr			\
745	nscd				\
746	power				\
747	rexd				\
748	rpcbind				\
749	rpcsvc				\
750	saf				\
751	sf880drd			\
752	smserverd			\
753	syseventd			\
754	syslogd				\
755	utmpd				\
756	ypcmd				\
757	zoneadmd
758
759MANIFEST_SUBDIRS=			\
760	cmd-crypto/scripts		\
761	cmd-inet/usr.lib/in.chargend	\
762	cmd-inet/usr.lib/in.daytimed	\
763	cmd-inet/usr.lib/in.dhcpd	\
764	cmd-inet/usr.lib/in.discardd	\
765	cmd-inet/usr.lib/in.echod	\
766	cmd-inet/usr.lib/in.timed	\
767	cmd-inet/usr.lib/inetd		\
768	cmd-inet/usr.lib/slpd		\
769	cmd-inet/usr.sbin		\
770	cmd-inet/usr.sbin/in.ftpd	\
771	cmd-inet/usr.sbin/in.talkd	\
772	dcs/sparc/sun4u			\
773	fs.d/autofs			\
774	fs.d/cachefs			\
775	fs.d/nfs/svc			\
776	gss/gssd			\
777	krb5/kadmin/server		\
778	krb5/krb5kdc			\
779	krb5/kwarn			\
780	krb5/slave			\
781	lp/cmd/lpsched			\
782	lvm/rpc.metad			\
783	lvm/rpc.metamedd		\
784	lvm/rpc.metamhd			\
785	lvm/md_monitord			\
786	lvm/metassist/sysfiles		\
787	lvm/util			\
788	picl/picld			\
789	print/gateway			\
790	print/lp			\
791	rcap/rcapd			\
792	rpcsvc/rpc.bootparamd		\
793	sendmail/lib			\
794	smartcard/daemon		\
795	ssh/etc				\
796	svc/milestone			\
797	ypcmd/yppasswd			\
798	ypcmd/ypupdated			\
799	xntpd/xntpd
800
801all :=		TARGET = all
802install :=	TARGET = install
803clean :=	TARGET = clean
804clobber :=	TARGET = clobber
805lint :=		TARGET = lint
806check :=	TARGET = check
807_msg :=		TARGET = _msg
808_dc :=		TARGET = _dc
809
810.KEEP_STATE:
811
812SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
813
814.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(BSMSUBDIRS) \
815		$(MANIFEST_SUBDIRS)
816
817all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) $(BSMSUBDIRS)
818
819check: svccfg_check .WAIT $(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS)
820
821svccfg_check:
822	@$(ECHO) "building requirements for svccfg check ..."; \
823	(cd $(SRC)/cmd/svc/svccfg && pwd && $(MAKE) $(MFLAGS) native)
824
825#
826# The .WAIT directive works around an apparent bug in parallel make.
827# Evidently make was getting the target _msg vs. _dc confused under
828# some level of parallelization, causing some of the _dc objects
829# not to be built.
830#
831_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
832
833_dc: $(DCSUBDIRS)
834
835$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(BSMSUBDIRS) $(MANIFEST_SUBDIRS): FRC
836	@if [ -f $@/Makefile  ]; then \
837		cd $@; pwd; $(MAKE) $(TARGET); \
838	else \
839		true; \
840	fi
841
842FRC:
843