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