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