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