xref: /titanic_52/usr/src/cmd/Makefile (revision 1bbc88aca166ee167004efcc07c544bcbef5bcda)
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 2007 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	eject		\
143	emul64ioctl	\
144	enhance		\
145	env		\
146	eqn		\
147	expand		\
148	expr		\
149	exstr		\
150	factor		\
151	false		\
152	fdetach		\
153	fdformat	\
154	fdisk		\
155	filesync	\
156	fgrep		\
157	file		\
158	find		\
159	fm		\
160	fmli		\
161	fmt		\
162	fmthard		\
163	fmtmsg		\
164	fold		\
165	format		\
166	fs.d		\
167	fstyp		\
168	fuser		\
169	fwflash		\
170	gcore		\
171	gencat		\
172	geniconvtbl	\
173	genmsg		\
174	getconf		\
175	getdevpolicy	\
176	getent		\
177	getfacl		\
178	getmajor	\
179	getopt		\
180	gettext		\
181	gettxt		\
182	graph		\
183	grep		\
184	grep_xpg4	\
185	groups		\
186	grpck		\
187	gss		\
188	hal		\
189	halt		\
190	head		\
191	hostid		\
192	hostname	\
193	hwdata		\
194	id		\
195	idmap		\
196	infocmp		\
197	init		\
198	initpkg		\
199	install.d	\
200	intrd		\
201	intrstat	\
202	ipcrm		\
203	ipcs		\
204	ipf		\
205	isainfo		\
206	isalist		\
207	iscsi		\
208	java		\
209	join		\
210	kbd		\
211	keyserv		\
212	killall		\
213	krb5		\
214	kstat		\
215	last		\
216	lastcomm	\
217	ldap		\
218	ldapcachemgr	\
219	lgrpinfo	\
220	line		\
221	link		\
222	listen		\
223	loadkeys	\
224	locale		\
225	lockstat	\
226	locator		\
227	lofiadm		\
228	logadm		\
229	logger		\
230	login		\
231	logins		\
232	logname		\
233	look		\
234	ls		\
235	lvm		\
236	mach		\
237	machid		\
238	mail		\
239	mailx		\
240	makekey		\
241	mdb		\
242	mesg		\
243	mkdir		\
244	mkfifo		\
245	mkfile		\
246	mkmsgs		\
247	mknod		\
248	mkpwdict	\
249	mktemp		\
250	modload		\
251	more		\
252	msgfmt		\
253	msgid		\
254	mt		\
255	mv		\
256	mvdir		\
257	netadm		\
258	netfiles	\
259	newform		\
260	newgrp		\
261	news		\
262	newtask		\
263	nice		\
264	nispasswd	\
265	nl		\
266	nlsadmin	\
267	nohup		\
268	nsadmin		\
269	nscd		\
270	oamuser		\
271	oawk		\
272	openssl		\
273	pack		\
274	pagesize	\
275	passmgmt	\
276	passwd		\
277	paste		\
278	pathchk		\
279	pbind		\
280	pcidr		\
281	pcmciad		\
282	pfexec		\
283	pgrep		\
284	picl		\
285	plimit		\
286	policykit	\
287	pools		\
288	power		\
289	ppgsz		\
290	pg		\
291	plockstat	\
292	pr		\
293	prctl		\
294	print		\
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	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	rmmount		\
324	rmt		\
325	rmvolmgr	\
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	sdpadm		\
339	sendmail	\
340	setfacl		\
341	setmnt		\
342	setpgrp		\
343	setuname	\
344	sgs		\
345	sh		\
346	sleep		\
347	smbios		\
348	smserverd	\
349	soelim		\
350	sort		\
351	spell		\
352	spline		\
353	split		\
354	sqlite		\
355	srchtxt		\
356	ssh		\
357	stat		\
358	stmsboot	\
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	tar		\
373	tbl		\
374	tcopy		\
375	tcpd		\
376	tee		\
377	terminfo	\
378	th_tools	\
379	tic		\
380	time		\
381	tip		\
382	tnf		\
383	touch		\
384	tplot		\
385	tput		\
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	volcheck	\
406	volrmmount	\
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	zdb		\
423	zdump		\
424	zfs		\
425	zic		\
426	zinject		\
427	zlogin		\
428	zoneadm		\
429	zoneadmd	\
430	zonecfg		\
431	zonename	\
432	zpool		\
433	ztest
434
435$(CLOSED_BUILD)COMMON_SUBDIRS += \
436	$(CLOSED)/cmd/dodatadm	\
437	$(CLOSED)/cmd/iconv	\
438	$(CLOSED)/cmd/ksh	\
439	$(CLOSED)/cmd/llc2	\
440	$(CLOSED)/cmd/localedef	\
441	$(CLOSED)/cmd/more_xpg4	\
442	$(CLOSED)/cmd/mtst	\
443	$(CLOSED)/cmd/od	\
444	$(CLOSED)/cmd/patch	\
445	$(CLOSED)/cmd/pax	\
446	$(CLOSED)/cmd/pcitool	\
447	$(CLOSED)/cmd/printf	\
448	$(CLOSED)/cmd/sed	\
449	$(CLOSED)/cmd/sed_xpg4	\
450	$(CLOSED)/cmd/smartcard	\
451	$(CLOSED)/cmd/tail	\
452	$(CLOSED)/cmd/tr	\
453	$(CLOSED)/cmd/tr_xpg4
454
455i386_SUBDIRS=		\
456	addbadsec	\
457	biosdev		\
458	diskscan	\
459	OWconfig	\
460	rtc		\
461	ucodeadm
462
463sparc_SUBDIRS=		\
464	cvcd		\
465	dcs		\
466	drd		\
467	fruadm		\
468	oplhpd		\
469	prtdscp		\
470	prtfru		\
471	scadm		\
472	sckmd		\
473	sf880drd	\
474	vntsd		\
475	wrsmconf	\
476	wrsmstat
477
478#
479# Commands that are messaged.  Note that 'lp' and 'man' come first
480# (see previous comment about 'lp' and 'man').
481#
482MSGSUBDIRS=		\
483	lp		\
484	man		\
485	abi		\
486	acctadm		\
487	allocate	\
488	asa		\
489	audio		\
490	audit		\
491	auditd		\
492	auths		\
493	autopush	\
494	awk		\
495	awk_xpg4	\
496	backup		\
497	banner		\
498	bart		\
499	basename	\
500	bnu		\
501	bsmconv		\
502	bsmrecord	\
503	bsmunconv	\
504	busstat		\
505	cal		\
506	cat		\
507	cdrw		\
508	cfgadm		\
509	checkeq		\
510	checknr		\
511	chgrp		\
512	chmod		\
513	chown		\
514	cksum		\
515	cmd-crypto	\
516	cmd-inet	\
517	cmp		\
518	col		\
519	comm		\
520	compress	\
521	consadm		\
522	coreadm		\
523	cpio		\
524	cpc		\
525	cron		\
526	csh		\
527	csplit		\
528	ctrun		\
529	ctstat		\
530	ctwatch		\
531	cut		\
532	datadm		\
533	date		\
534	dc		\
535	dcs		\
536	dd		\
537	deroff		\
538	devfsadm	\
539	dfs.cmds	\
540	diff		\
541	diffmk		\
542	dladm		\
543	du		\
544	dumpcs		\
545	ed		\
546	eject		\
547	env		\
548	eqn		\
549	expand		\
550	expr		\
551	fgrep		\
552	file		\
553	filesync	\
554	find		\
555	fm		\
556	fold		\
557	fs.d		\
558	fwflash		\
559	geniconvtbl	\
560	genmsg		\
561	getconf		\
562	getent		\
563	gettext		\
564	gettxt		\
565	grep		\
566	grep_xpg4	\
567	grpck		\
568	gss		\
569	halt		\
570	head		\
571	hostname	\
572	id		\
573	idmap		\
574	isaexec		\
575	iscsi		\
576	join		\
577	kbd		\
578	krb5		\
579	kstat		\
580	last		\
581	ldap		\
582	ldapcachemgr	\
583	lgrpinfo	\
584	locale		\
585	lofiadm		\
586	logadm		\
587	logger		\
588	logins		\
589	logname		\
590	ls		\
591	lvm		\
592	mailx		\
593	mesg		\
594	mkdir		\
595	mkpwdict	\
596	mktemp		\
597	more		\
598	msgfmt		\
599	mv		\
600	newgrp		\
601	newtask		\
602	nice		\
603	nispasswd	\
604	nohup		\
605	oawk		\
606	pack		\
607	passwd		\
608	passmgmt	\
609	paste		\
610	pathchk		\
611	pfexec		\
612	pg		\
613	pgrep		\
614	picl            \
615	pools		\
616	power		\
617	pr		\
618	praudit		\
619	print		\
620	profiles	\
621	projadd		\
622	projects	\
623	prstat		\
624	prtdiag		\
625	ps		\
626	psrinfo		\
627	ptools		\
628	pwconv		\
629	pwd		\
630	raidctl		\
631	ramdiskadm	\
632	rcap		\
633	rcm_daemon	\
634	refer		\
635	regcmp		\
636	renice		\
637	roles		\
638	rm		\
639	rmdir		\
640	rmformat	\
641	rmmount		\
642	rmvolmgr	\
643	scadm		\
644	script		\
645	sdiff		\
646	sdpadm		\
647	sgs		\
648	sh		\
649	sleep		\
650	sort		\
651	split		\
652	ssh		\
653	stat		\
654	stmsboot	\
655	strings		\
656	su		\
657	sum		\
658	svc		\
659	swap		\
660	syseventadm	\
661	syseventd	\
662	tabs		\
663	tar		\
664	tbl		\
665	tee		\
666	time		\
667	tnf		\
668	touch		\
669	tput		\
670	troff		\
671	tty		\
672	ttymon		\
673	ul		\
674	uname		\
675	uniq		\
676	units		\
677	unlink		\
678	unpack		\
679	valtools	\
680	vgrind		\
681	vi		\
682	volcheck	\
683	volrmmount	\
684	w		\
685	wbem		\
686	wc		\
687	who		\
688	whodo		\
689	wracct		\
690	write		\
691	xargs		\
692	yppasswd	\
693	zdump		\
694	zfs		\
695	zic		\
696	zlogin		\
697	zoneadm		\
698	zoneadmd	\
699	zonecfg		\
700	zonename	\
701	zpool
702
703$(CLOSED_BUILD)MSGSUBDIRS += \
704	$(CLOSED)/cmd/iconv	\
705	$(CLOSED)/cmd/ksh	\
706	$(CLOSED)/cmd/llc2	\
707	$(CLOSED)/cmd/localedef	\
708	$(CLOSED)/cmd/more_xpg4	\
709	$(CLOSED)/cmd/od	\
710	$(CLOSED)/cmd/patch	\
711	$(CLOSED)/cmd/pax	\
712	$(CLOSED)/cmd/printf	\
713	$(CLOSED)/cmd/sed	\
714	$(CLOSED)/cmd/sed_xpg4	\
715	$(CLOSED)/cmd/tail	\
716	$(CLOSED)/cmd/tr	\
717	$(CLOSED)/cmd/tr_xpg4
718
719sparc_MSGSUBDIRS=	\
720	fruadm		\
721	prtdscp		\
722	prtfru		\
723	vntsd		\
724	wrsmconf	\
725	wrsmstat
726
727i386_MSGSUBDIRS=	\
728	ucodeadm
729
730#
731# commands that use dcgettext for localized time, LC_TIME
732#
733DCSUBDIRS=		\
734	cal		\
735	cfgadm		\
736	diff		\
737	ls		\
738	pr		\
739	ps		\
740	tar		\
741	w		\
742	who		\
743	whodo		\
744	write
745
746$(CLOSED_BUILD)DCSUBDIRS += \
747	$(CLOSED)/cmd/pax
748
749#
750# commands that belong only to the basic security module
751#
752BSMSUBDIRS=		\
753	allocate	\
754	amt		\
755	audit		\
756	audit_warn	\
757	auditconfig	\
758	auditd		\
759	auditreduce	\
760	auditstat	\
761	praudit		\
762	bsmconv		\
763	bsmrecord	\
764	bsmunconv
765
766#
767# commands not owned by the systems group
768#
769BWOSDIRS=
770
771#
772# Commands providing manifests must offer a check target.  A recursive check
773# target across all commands directories is not currently provided.
774#
775MANIFEST_TOPDIRS=			\
776	auditd				\
777	bnu				\
778	consadm				\
779	coreadm				\
780	cron				\
781	cvcd				\
782	dispadmin			\
783	drd				\
784	dumpadm				\
785	eeprom				\
786	fm				\
787	intrd				\
788	ipf				\
789	keyserv				\
790	ldapcachemgr			\
791	nscd				\
792	oplhpd				\
793	power				\
794	rexd				\
795	rpcbind				\
796	rpcsvc				\
797	saf				\
798	sf880drd			\
799	smserverd			\
800	syseventd			\
801	syslogd				\
802	utmpd				\
803	vntsd				\
804	ypcmd				\
805	zoneadmd
806
807MANIFEST_SUBDIRS=			\
808	boot/scripts			\
809	cmd-crypto/scripts		\
810	cmd-inet/usr.lib/in.chargend	\
811	cmd-inet/usr.lib/in.daytimed	\
812	cmd-inet/usr.lib/in.dhcpd	\
813	cmd-inet/usr.lib/in.discardd	\
814	cmd-inet/usr.lib/in.echod	\
815	cmd-inet/usr.lib/in.ndpd	\
816	cmd-inet/usr.lib/in.ripngd	\
817	cmd-inet/usr.lib/in.timed	\
818	cmd-inet/usr.lib/inetd		\
819	cmd-inet/usr.lib/slpd		\
820	cmd-inet/usr.lib/wpad		\
821	cmd-inet/usr.sbin		\
822	cmd-inet/usr.sbin/in.ftpd	\
823	cmd-inet/usr.sbin/in.rdisc	\
824	cmd-inet/usr.sbin/in.routed	\
825	cmd-inet/usr.sbin/in.talkd	\
826	cmd-inet/usr.sbin/routeadm	\
827	dcs/sparc/sun4u			\
828	fs.d/autofs			\
829	fs.d/cachefs			\
830	fs.d/nfs/svc			\
831	gss/gssd			\
832	idmap/idmapd			\
833	krb5/kadmin/server		\
834	krb5/krb5kdc			\
835	krb5/kwarn			\
836	krb5/slave			\
837	lp/cmd/lpsched			\
838	lvm/rpc.metad			\
839	lvm/rpc.metamedd		\
840	lvm/rpc.metamhd			\
841	lvm/md_monitord			\
842	lvm/metassist/sysfiles		\
843	lvm/util			\
844	picl/picld			\
845	print/gateway			\
846	print/lp			\
847	rcap/rcapd			\
848	rpcsvc/rpc.bootparamd		\
849	sendmail/lib			\
850	smartcard/daemon		\
851	ssh/etc				\
852	svc/milestone			\
853	ypcmd/yppasswd			\
854	ypcmd/ypupdated			\
855	xntpd/xntpd
856
857all :=		TARGET = all
858install :=	TARGET = install
859clean :=	TARGET = clean
860clobber :=	TARGET = clobber
861lint :=		TARGET = lint
862check :=	TARGET = check
863_msg :=		TARGET = _msg
864_dc :=		TARGET = _dc
865
866.KEEP_STATE:
867
868SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
869
870.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(BSMSUBDIRS) \
871		$(MANIFEST_SUBDIRS)
872
873all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) $(BSMSUBDIRS)
874
875check: svccfg_check .WAIT $(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS)
876
877svccfg_check:
878	@$(ECHO) "building requirements for svccfg check ..."; \
879	(cd $(SRC)/cmd/svc/svccfg && pwd && $(MAKE) $(MFLAGS) native)
880
881#
882# The .WAIT directive works around an apparent bug in parallel make.
883# Evidently make was getting the target _msg vs. _dc confused under
884# some level of parallelization, causing some of the _dc objects
885# not to be built.
886#
887_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
888
889_dc: $(DCSUBDIRS)
890
891#
892# Dependencies
893#
894fs.d: fstyp
895
896$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(BSMSUBDIRS) $(MANIFEST_SUBDIRS): FRC
897	@if [ -f $@/Makefile  ]; then \
898		cd $@; pwd; $(MAKE) $(TARGET); \
899	else \
900		true; \
901	fi
902
903FRC:
904