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