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