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