xref: /titanic_51/usr/src/cmd/Makefile (revision f6cfb02b955a670e8c39660b2d0468385cbc7e80)
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	vt		\
421	w		\
422	wall		\
423	wbem		\
424	wc		\
425	which		\
426	who		\
427	whodo		\
428	wracct		\
429	write		\
430	xntpd		\
431	xargs		\
432	xstr		\
433	yes		\
434	ypcmd		\
435	yppasswd	\
436	zdb		\
437	zdump		\
438	zfs		\
439	zic		\
440	zinject		\
441	zlogin		\
442	zoneadm		\
443	zoneadmd	\
444	zonecfg		\
445	zonename	\
446	zpool		\
447	ztest
448
449$(CLOSED_BUILD)COMMON_SUBDIRS += \
450	$(CLOSED)/cmd/dodatadm	\
451	$(CLOSED)/cmd/iconv	\
452	$(CLOSED)/cmd/ksh	\
453	$(CLOSED)/cmd/llc2	\
454	$(CLOSED)/cmd/localedef	\
455	$(CLOSED)/cmd/more_xpg4	\
456	$(CLOSED)/cmd/mtst	\
457	$(CLOSED)/cmd/ndmpadm	\
458	$(CLOSED)/cmd/ndmpd	\
459	$(CLOSED)/cmd/ndmpstat	\
460	$(CLOSED)/cmd/od	\
461	$(CLOSED)/cmd/patch	\
462	$(CLOSED)/cmd/pax	\
463	$(CLOSED)/cmd/pcitool	\
464	$(CLOSED)/cmd/printf	\
465	$(CLOSED)/cmd/sed	\
466	$(CLOSED)/cmd/sed_xpg4	\
467	$(CLOSED)/cmd/smartcard	\
468	$(CLOSED)/cmd/tail	\
469	$(CLOSED)/cmd/tr_xpg4
470
471i386_SUBDIRS=		\
472	addbadsec	\
473	biosdev		\
474	diskscan	\
475	OWconfig	\
476	rtc		\
477	ucodeadm	\
478	xvm
479
480sparc_SUBDIRS=		\
481	cvcd		\
482	dcs		\
483	drd		\
484	fps		\
485	fruadm		\
486	oplhpd		\
487	prtdscp		\
488	prtfru		\
489	scadm		\
490	sckmd		\
491	sf880drd	\
492	vntsd
493
494#
495# Commands that are messaged.  Note that 'lp' and 'man' come first
496# (see previous comment about 'lp' and 'man').
497#
498MSGSUBDIRS=		\
499	lp		\
500	man		\
501	abi		\
502	acctadm		\
503	allocate	\
504	asa		\
505	audio		\
506	audit		\
507	auditd		\
508	auths		\
509	autopush	\
510	awk		\
511	awk_xpg4	\
512	backup		\
513	banner		\
514	bart		\
515	basename	\
516	bnu		\
517	bsmconv		\
518	bsmrecord	\
519	bsmunconv	\
520	busstat		\
521	cal		\
522	cat		\
523	cdrw		\
524	cfgadm		\
525	checkeq		\
526	checknr		\
527	chgrp		\
528	chmod		\
529	chown		\
530	cksum		\
531	cmd-crypto	\
532	cmd-inet	\
533	cmp		\
534	col		\
535	comm		\
536	compress	\
537	consadm		\
538	coreadm		\
539	cpio		\
540	cpc		\
541	cron		\
542	csh		\
543	csplit		\
544	ctrun		\
545	ctstat		\
546	ctwatch		\
547	cut		\
548	datadm		\
549	date		\
550	dc		\
551	dcs		\
552	dd		\
553	deroff		\
554	devfsadm	\
555	dfs.cmds	\
556	diff		\
557	diffmk		\
558	dladm		\
559	du		\
560	dumpcs		\
561	ed		\
562	eject		\
563	env		\
564	eqn		\
565	expand		\
566	expr		\
567	fgrep		\
568	file		\
569	filesync	\
570	find		\
571	fm		\
572	fold		\
573	fs.d		\
574	fwflash		\
575	geniconvtbl	\
576	genmsg		\
577	getconf		\
578	getent		\
579	gettext		\
580	gettxt		\
581	grep		\
582	grep_xpg4	\
583	grpck		\
584	gss		\
585	halt		\
586	head		\
587	hostname	\
588	id		\
589	idmap		\
590	isaexec		\
591	iscsi		\
592	join		\
593	kbd		\
594	krb5		\
595	ksh		\
596	kstat		\
597	last		\
598	ldap		\
599	ldapcachemgr	\
600	lgrpinfo	\
601	locale		\
602	lofiadm		\
603	logadm		\
604	logger		\
605	logins		\
606	logname		\
607	ls		\
608	lvm		\
609	mailx		\
610	mesg		\
611	mkdir		\
612	mkpwdict	\
613	mktemp		\
614	more		\
615	msgfmt		\
616	mv		\
617	newgrp		\
618	newtask		\
619	nice		\
620	nispasswd	\
621	nohup		\
622	oawk		\
623	pack		\
624	passwd		\
625	passmgmt	\
626	paste		\
627	pathchk		\
628	pfexec		\
629	pg		\
630	pgrep		\
631	picl            \
632	pools		\
633	power		\
634	pr		\
635	praudit		\
636	print		\
637	profiles	\
638	projadd		\
639	projects	\
640	prstat		\
641	prtdiag		\
642	ps		\
643	psrinfo		\
644	ptools		\
645	pwconv		\
646	pwd		\
647	raidctl		\
648	ramdiskadm	\
649	rcap		\
650	rcm_daemon	\
651	refer		\
652	regcmp		\
653	renice		\
654	roles		\
655	rm		\
656	rmdir		\
657	rmformat	\
658	rmmount		\
659	rmvolmgr	\
660	scadm		\
661	script		\
662	scsi		\
663	sdiff		\
664	sdpadm		\
665	sgs		\
666	sh		\
667	sleep		\
668	sort		\
669	split		\
670	ssh		\
671	stat		\
672	stmsboot	\
673	strings		\
674	su		\
675	sum		\
676	svc		\
677	swap		\
678	syseventadm	\
679	syseventd	\
680	tabs		\
681	tar		\
682	tbl		\
683	tee		\
684	time		\
685	tnf		\
686	touch		\
687	tput		\
688	troff		\
689	tsol		\
690	tty		\
691	ttymon		\
692	ul		\
693	uname		\
694	uniq		\
695	units		\
696	unlink		\
697	unpack		\
698	valtools	\
699	vgrind		\
700	vi		\
701	volcheck	\
702	volrmmount	\
703	w		\
704	wbem		\
705	wc		\
706	who		\
707	whodo		\
708	wracct		\
709	write		\
710	xargs		\
711	yppasswd	\
712	zdump		\
713	zfs		\
714	zic		\
715	zlogin		\
716	zoneadm		\
717	zoneadmd	\
718	zonecfg		\
719	zonename	\
720	zpool
721
722$(CLOSED_BUILD)MSGSUBDIRS += \
723	$(CLOSED)/cmd/iconv	\
724	$(CLOSED)/cmd/ksh	\
725	$(CLOSED)/cmd/llc2	\
726	$(CLOSED)/cmd/localedef	\
727	$(CLOSED)/cmd/more_xpg4	\
728	$(CLOSED)/cmd/ndmpadm   \
729	$(CLOSED)/cmd/ndmpstat  \
730	$(CLOSED)/cmd/od	\
731	$(CLOSED)/cmd/patch	\
732	$(CLOSED)/cmd/pax	\
733	$(CLOSED)/cmd/printf	\
734	$(CLOSED)/cmd/sed	\
735	$(CLOSED)/cmd/sed_xpg4	\
736	$(CLOSED)/cmd/tail	\
737	$(CLOSED)/cmd/tr_xpg4
738
739sparc_MSGSUBDIRS=	\
740	fruadm		\
741	prtdscp		\
742	prtfru		\
743	vntsd
744
745i386_MSGSUBDIRS=	\
746	ucodeadm
747
748#
749# commands that use dcgettext for localized time, LC_TIME
750#
751DCSUBDIRS=		\
752	cal		\
753	cfgadm		\
754	diff		\
755	ls		\
756	pr		\
757	ps		\
758	tar		\
759	w		\
760	who		\
761	whodo		\
762	write
763
764$(CLOSED_BUILD)DCSUBDIRS += \
765	$(CLOSED)/cmd/pax
766
767#
768# commands that belong only to the basic security module
769#
770BSMSUBDIRS=		\
771	allocate	\
772	amt		\
773	audit		\
774	audit_warn	\
775	auditconfig	\
776	auditd		\
777	auditreduce	\
778	auditstat	\
779	praudit		\
780	bsmconv		\
781	bsmrecord	\
782	bsmunconv
783
784#
785# commands not owned by the systems group
786#
787BWOSDIRS=
788
789#
790# Commands providing manifests must offer a check target.  A recursive check
791# target across all commands directories is not currently provided.
792#
793MANIFEST_TOPDIRS=			\
794	auditd				\
795	bnu				\
796	consadm				\
797	coreadm				\
798	cron				\
799	cvcd				\
800	dispadmin			\
801	drd				\
802	dumpadm				\
803	eeprom				\
804	fm				\
805	intrd				\
806	ipf				\
807	keyserv				\
808	ldapcachemgr			\
809	dlmgmtd				\
810	nscd				\
811	oplhpd				\
812	power				\
813	rexd				\
814	rpcbind				\
815	rpcsvc				\
816	saf				\
817	sf880drd			\
818	smserverd			\
819	syseventd			\
820	syslogd				\
821	utmpd				\
822	vntsd				\
823	ypcmd				\
824	zoneadmd
825
826MANIFEST_SUBDIRS=			\
827	boot/scripts			\
828	cmd-crypto/scripts		\
829	cmd-inet/usr.lib/in.chargend	\
830	cmd-inet/usr.lib/in.daytimed	\
831	cmd-inet/usr.lib/in.dhcpd	\
832	cmd-inet/usr.lib/in.discardd	\
833	cmd-inet/usr.lib/in.echod	\
834	cmd-inet/usr.lib/in.ndpd	\
835	cmd-inet/usr.lib/in.ripngd	\
836	cmd-inet/usr.lib/in.timed	\
837	cmd-inet/usr.lib/inetd		\
838	cmd-inet/usr.lib/mdnsd		\
839	cmd-inet/usr.lib/slpd		\
840	cmd-inet/usr.lib/wpad		\
841	cmd-inet/usr.sbin		\
842	cmd-inet/usr.sbin/in.ftpd	\
843	cmd-inet/usr.sbin/in.rdisc	\
844	cmd-inet/usr.sbin/in.routed	\
845	cmd-inet/usr.sbin/in.talkd	\
846	cmd-inet/usr.sbin/routeadm	\
847	cmd/tsol/labeld			\
848	cmd/tsol/tnctl			\
849	cmd/tsol/tnd			\
850	cmd/tsol/tsol-zones		\
851	dcs/sparc/sun4u			\
852	fs.d/autofs			\
853	fs.d/cachefs			\
854	fs.d/nfs/svc			\
855	gss/gssd			\
856	idmap/idmapd			\
857	krb5/kadmin/server		\
858	krb5/krb5kdc			\
859	krb5/kwarn			\
860	krb5/slave			\
861	lp/cmd/lpsched			\
862	lvm/rpc.metad			\
863	lvm/rpc.metamedd		\
864	lvm/rpc.metamhd			\
865	lvm/md_monitord			\
866	lvm/metassist/sysfiles		\
867	lvm/util			\
868	picl/picld			\
869	print/gateway			\
870	print/lp			\
871	rcap/rcapd			\
872	rpcsvc/rpc.bootparamd		\
873	sendmail/lib			\
874	smartcard/daemon		\
875	ssh/etc				\
876	svc/milestone			\
877	ypcmd/yppasswd			\
878	ypcmd/ypupdated			\
879	xntpd/xntpd
880
881DTEST_SUBDIRS= \
882	dtrace/test/tst
883
884all :=		TARGET = all
885install :=	TARGET = install
886clean :=	TARGET = clean
887clobber :=	TARGET = clobber
888lint :=		TARGET = lint
889check :=	TARGET = check
890_msg :=		TARGET = _msg
891_dc :=		TARGET = _dc
892
893.KEEP_STATE:
894
895SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
896
897.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(BSMSUBDIRS) \
898		$(MANIFEST_SUBDIRS) $(DTEST_SUBDIRS)
899
900all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) $(BSMSUBDIRS)
901
902check: svccfg_check .WAIT $(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS) \
903	$(DTEST_SUBDIRS)
904
905svccfg_check:
906	@$(ECHO) "building requirements for svccfg check ..."; \
907	(cd $(SRC)/cmd/svc/svccfg && pwd && $(MAKE) $(MFLAGS) native)
908
909$(DTEST_SUBDIRS): FRC
910	@cd $@; pwd; $(MAKE) $(TARGET)
911
912#
913# The .WAIT directive works around an apparent bug in parallel make.
914# Evidently make was getting the target _msg vs. _dc confused under
915# some level of parallelization, causing some of the _dc objects
916# not to be built.
917#
918_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
919
920_dc: $(DCSUBDIRS)
921
922#
923# Dependencies
924#
925fs.d: fstyp
926
927$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(BSMSUBDIRS) $(MANIFEST_SUBDIRS): FRC
928	@if [ -f $@/Makefile  ]; then \
929		cd $@; pwd; $(MAKE) $(TARGET); \
930	else \
931		true; \
932	fi
933
934FRC:
935