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