xref: /titanic_44/usr/src/cmd/Makefile (revision 5d54f3d8999eac1762fe0a8c7177d20f1f201fae)
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	emul64ioctl	\
142	enhance		\
143	env		\
144	eqn		\
145	expand		\
146	expr		\
147	exstr		\
148	face		\
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	zdump		\
425	zic		\
426	zlogin		\
427	zoneadm		\
428	zoneadmd	\
429	zonecfg		\
430	zonename
431
432i386_SUBDIRS=		\
433	addbadsec	\
434	biosdev		\
435	diskscan	\
436	OWconfig	\
437	rtc
438
439sparc_SUBDIRS=		\
440	cvcd		\
441	dcs		\
442	fruadm		\
443	mtst		\
444	prtfru		\
445	scadm		\
446	sckmd		\
447	sf880drd	\
448	stmsboot	\
449	wrsmconf	\
450	wrsmstat
451
452#
453# Commands that are messaged.  Note that 'lp' and 'man' come first
454# (see previous comment about 'lp' and 'man').
455#
456MSGSUBDIRS=		\
457	lp		\
458	man		\
459	abi		\
460	acctadm		\
461	allocate	\
462	asa		\
463	audio		\
464	audit		\
465	auditd		\
466	auths		\
467	autopush	\
468	awk		\
469	awk_xpg4	\
470	backup		\
471	banner		\
472	bart		\
473	basename	\
474	bnu		\
475	bsmconv		\
476	bsmrecord	\
477	bsmunconv	\
478	busstat		\
479	cal		\
480	cat		\
481	cdrw		\
482	cfgadm		\
483	checkeq		\
484	checknr		\
485	chgrp		\
486	chmod		\
487	chown		\
488	cksum		\
489	cmd-crypto	\
490	cmd-inet	\
491	cmp		\
492	col		\
493	comm		\
494	compress	\
495	consadm		\
496	coreadm		\
497	cpio		\
498	cpc		\
499	cron		\
500	csh		\
501	csplit		\
502	ctrun		\
503	ctstat		\
504	ctwatch		\
505	cut		\
506	datadm		\
507	date		\
508	dc		\
509	dcs		\
510	dd		\
511	deroff		\
512	devfsadm	\
513	diff		\
514	diffmk		\
515	dladm		\
516	du		\
517	dumpcs		\
518	ed		\
519	env		\
520	eqn		\
521	expand		\
522	expr		\
523	fgrep		\
524	file		\
525	filesync	\
526	find		\
527	fm		\
528	fold		\
529	fs.d		\
530	geniconvtbl	\
531	genmsg		\
532	getconf		\
533	getent		\
534	gettext		\
535	gettxt		\
536	grep		\
537	grep_xpg4	\
538	grpck		\
539	gss		\
540	halt		\
541	head		\
542	hostname	\
543	iconv		\
544	id		\
545	isaexec		\
546	join		\
547	krb5		\
548	ksh		\
549	kstat		\
550	last		\
551	ldap		\
552	ldapcachemgr	\
553	llc2		\
554	locale		\
555	localedef	\
556	lofiadm		\
557	logadm		\
558	logger		\
559	logins		\
560	logname		\
561	ls		\
562	lvm		\
563	mailx		\
564	mesg		\
565	mkdir		\
566	mkpwdict	\
567	mktemp		\
568	more		\
569	more_xpg4	\
570	msgfmt		\
571	mv		\
572	newgrp		\
573	newtask		\
574	nice		\
575	nispasswd	\
576	nohup		\
577	oawk		\
578	od		\
579	pack		\
580	passwd		\
581	passmgmt	\
582	paste		\
583	patch		\
584	pathchk		\
585	pax		\
586	pfexec		\
587	pg		\
588	pgrep		\
589	picl            \
590	pools		\
591	power		\
592	pr		\
593	praudit		\
594	print		\
595	printf		\
596	profiles	\
597	projadd		\
598	projects	\
599	prstat		\
600	prtdiag		\
601	ps		\
602	psrinfo		\
603	pwconv		\
604	pwd		\
605	raidctl		\
606	ramdiskadm	\
607	rcap		\
608	rcm_daemon	\
609	refer		\
610	regcmp		\
611	renice		\
612	roles		\
613	rm		\
614	rmdir		\
615	rmformat	\
616	scadm		\
617	script		\
618	sdiff		\
619	sed		\
620	sed_xpg4	\
621	sgs		\
622	sh		\
623	sleep		\
624	sort		\
625	split		\
626	ssh		\
627	strings		\
628	su		\
629	sum		\
630	svc		\
631	swap		\
632	syseventadm	\
633	syseventd	\
634	tabs		\
635	tail		\
636	tar		\
637	tbl		\
638	tee		\
639	time		\
640	tnf		\
641	touch		\
642	tput		\
643	tr		\
644	tr_xpg4		\
645	troff		\
646	tty		\
647	ttymon		\
648	ul		\
649	uname		\
650	uniq		\
651	units		\
652	unlink		\
653	unpack		\
654	valtools	\
655	vgrind		\
656	vi		\
657	volmgt		\
658	w		\
659	wbem		\
660	wc		\
661	who		\
662	whodo		\
663	wracct		\
664	write		\
665	xargs		\
666	yppasswd	\
667	zdump		\
668	zic		\
669	zlogin		\
670	zoneadm		\
671	zoneadmd	\
672	zonecfg		\
673	zonename
674
675sparc_MSGSUBDIRS=	\
676	fruadm		\
677	prtfru		\
678	stmsboot	\
679	wrsmconf	\
680	wrsmstat
681
682#
683# commands that use dcgettext for localized time, LC_TIME
684#
685DCSUBDIRS=		\
686	cal		\
687	cfgadm		\
688	diff		\
689	ls		\
690	pax		\
691	pr		\
692	tar		\
693	w		\
694	who		\
695	whodo		\
696	write
697
698#
699# commands that belong only to the basic security module
700#
701BSMSUBDIRS=		\
702	allocate	\
703	amt		\
704	audit		\
705	audit_warn	\
706	auditconfig	\
707	auditd		\
708	auditreduce	\
709	auditstat	\
710	dminfo		\
711	praudit		\
712	bsmconv		\
713	bsmrecord	\
714	bsmunconv
715
716#
717# commands not owned by the systems group
718#
719BWOSDIRS=
720
721#
722# Commands providing manifests must offer a check target.  A recursive check
723# target across all commands directories is not currently provided.
724#
725MANIFEST_TOPDIRS=			\
726	auditd				\
727	bnu				\
728	consadm				\
729	coreadm				\
730	cron				\
731	cvcd				\
732	dumpadm				\
733	eeprom				\
734	fm				\
735	intrd				\
736	ipf				\
737	keyserv				\
738	ldapcachemgr			\
739	nscd				\
740	power				\
741	rexd				\
742	rpcbind				\
743	rpcsvc				\
744	saf				\
745	sf880drd			\
746	smserverd			\
747	syseventd			\
748	syslogd				\
749	utmpd				\
750	ypcmd				\
751	zoneadmd
752
753MANIFEST_SUBDIRS=			\
754	cmd-crypto/scripts		\
755	cmd-inet/usr.lib/in.chargend	\
756	cmd-inet/usr.lib/in.daytimed	\
757	cmd-inet/usr.lib/in.dhcpd	\
758	cmd-inet/usr.lib/in.discardd	\
759	cmd-inet/usr.lib/in.echod	\
760	cmd-inet/usr.lib/in.timed	\
761	cmd-inet/usr.lib/inetd		\
762	cmd-inet/usr.lib/slpd		\
763	cmd-inet/usr.sbin		\
764	cmd-inet/usr.sbin/in.ftpd	\
765	cmd-inet/usr.sbin/in.talkd	\
766	dcs/sparc/sun4u			\
767	fs.d/autofs			\
768	fs.d/cachefs			\
769	fs.d/nfs/svc			\
770	gss/gssd			\
771	krb5/kadmin/server		\
772	krb5/krb5kdc			\
773	krb5/kwarn			\
774	krb5/slave			\
775	lp/cmd/lpsched			\
776	lvm/rpc.metad			\
777	lvm/rpc.metamedd		\
778	lvm/rpc.metamhd			\
779	lvm/md_monitord			\
780	lvm/metassist/sysfiles		\
781	lvm/util			\
782	picl/picld			\
783	print/gateway			\
784	print/lp			\
785	rcap/rcapd			\
786	rpcsvc/rpc.bootparamd		\
787	sendmail/lib			\
788	smartcard/daemon		\
789	ssh/etc				\
790	svc/milestone			\
791	ypcmd/yppasswd			\
792	ypcmd/ypupdated			\
793	xntpd/xntpd
794
795all :=		TARGET = all
796install :=	TARGET = install
797clean :=	TARGET = clean
798clobber :=	TARGET = clobber
799lint :=		TARGET = lint
800check :=	TARGET = check
801_msg :=		TARGET = _msg
802_dc :=		TARGET = _dc
803
804.KEEP_STATE:
805
806SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
807
808.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(BSMSUBDIRS) \
809		$(MANIFEST_SUBDIRS)
810
811all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) $(BSMSUBDIRS)
812
813check: svccfg_check .WAIT $(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS)
814
815svccfg_check:
816	@$(ECHO) "building requirements for svccfg check ..."; \
817	(cd $(SRC)/cmd/svc/svccfg && pwd && $(MAKE) $(MFLAGS) native)
818
819#
820# The .WAIT directive works around an apparent bug in parallel make.
821# Evidently make was getting the target _msg vs. _dc confused under
822# some level of parallelization, causing some of the _dc objects
823# not to be built.
824#
825_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
826
827_dc: $(DCSUBDIRS)
828
829$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(BSMSUBDIRS) $(MANIFEST_SUBDIRS): FRC
830	@if [ -f $@/Makefile  ]; then \
831		cd $@; pwd; $(MAKE) $(TARGET); \
832	else \
833		true; \
834	fi
835
836FRC:
837