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