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