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