xref: /titanic_51/usr/src/cmd/Makefile (revision 821da340f9590922ba8761a64fadda18843a0e88)
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	gcore		\
170	gencat		\
171	geniconvtbl	\
172	genmsg		\
173	getconf		\
174	getdevpolicy	\
175	getent		\
176	getfacl		\
177	getmajor	\
178	getopt		\
179	gettext		\
180	gettxt		\
181	graph		\
182	grep		\
183	grep_xpg4	\
184	groups		\
185	grpck		\
186	gss		\
187	hal		\
188	halt		\
189	head		\
190	hostid		\
191	hostname	\
192	hwdata		\
193	id		\
194	idmap		\
195	infocmp		\
196	init		\
197	initpkg		\
198	install.d	\
199	intrd		\
200	intrstat	\
201	ipcrm		\
202	ipcs		\
203	ipf		\
204	isainfo		\
205	isalist		\
206	iscsi		\
207	java		\
208	join		\
209	kbd		\
210	keyserv		\
211	killall		\
212	krb5		\
213	kstat		\
214	last		\
215	lastcomm	\
216	ldap		\
217	ldapcachemgr	\
218	lgrpinfo	\
219	line		\
220	link		\
221	listen		\
222	loadkeys	\
223	locale		\
224	lockstat	\
225	locator		\
226	lofiadm		\
227	logadm		\
228	logger		\
229	login		\
230	logins		\
231	logname		\
232	look		\
233	ls		\
234	lvm		\
235	mach		\
236	machid		\
237	mail		\
238	mailx		\
239	makekey		\
240	mdb		\
241	mesg		\
242	mkdir		\
243	mkfifo		\
244	mkfile		\
245	mkmsgs		\
246	mknod		\
247	mkpwdict	\
248	mktemp		\
249	modload		\
250	more		\
251	msgfmt		\
252	msgid		\
253	mt		\
254	mv		\
255	mvdir		\
256	netadm		\
257	netfiles	\
258	newform		\
259	newgrp		\
260	news		\
261	newtask		\
262	nice		\
263	nispasswd	\
264	nl		\
265	nlsadmin	\
266	nohup		\
267	nsadmin		\
268	nscd		\
269	oamuser		\
270	oawk		\
271	openssl		\
272	pack		\
273	pagesize	\
274	passmgmt	\
275	passwd		\
276	paste		\
277	pathchk		\
278	pbind		\
279	pcidr		\
280	pcmciad		\
281	pfexec		\
282	pgrep		\
283	picl		\
284	plimit		\
285	policykit	\
286	pools		\
287	power		\
288	ppgsz		\
289	pg		\
290	plockstat	\
291	pr		\
292	prctl		\
293	print		\
294	priocntl	\
295	profiles	\
296	projadd		\
297	projects	\
298	prstat		\
299	prtconf		\
300	prtdiag		\
301	prtvtoc		\
302	ps		\
303	psradm		\
304	psrinfo		\
305	psrset		\
306	ptools		\
307	pwck		\
308	pwconv		\
309	pwd		\
310	raidctl		\
311	ramdiskadm	\
312	rcap		\
313	rcm_daemon	\
314	rctladm		\
315	refer		\
316	regcmp		\
317	renice		\
318	rexd		\
319	rm		\
320	rmdir		\
321	rmformat	\
322	rmmount		\
323	rmt		\
324	rmvolmgr	\
325	roles		\
326	rpcbind		\
327	rpcgen		\
328	rpcinfo		\
329	rpcsvc		\
330	rpld		\
331	runat		\
332	sa		\
333	saf		\
334	savecore	\
335	script		\
336	sdiff		\
337	sdpadm		\
338	sendmail	\
339	setfacl		\
340	setmnt		\
341	setpgrp		\
342	setuname	\
343	sgs		\
344	sh		\
345	sleep		\
346	smbios		\
347	smserverd	\
348	soelim		\
349	sort		\
350	spell		\
351	spline		\
352	split		\
353	sqlite		\
354	srchtxt		\
355	ssh		\
356	stat		\
357	stmsboot	\
358	streams		\
359	strings		\
360	su		\
361	sulogin		\
362	sum		\
363	sunpc		\
364	svc		\
365	swap		\
366	sync		\
367	sysdef		\
368	syseventadm	\
369	syslogd		\
370	tabs		\
371	tar		\
372	tbl		\
373	tcopy		\
374	tcpd		\
375	tee		\
376	terminfo	\
377	th_tools	\
378	tic		\
379	time		\
380	tip		\
381	tnf		\
382	touch		\
383	tplot		\
384	tput		\
385	trapstat	\
386	troff		\
387	true		\
388	truss		\
389	tsol		\
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/fwflash	\
438	$(CLOSED)/cmd/iconv	\
439	$(CLOSED)/cmd/ksh	\
440	$(CLOSED)/cmd/llc2	\
441	$(CLOSED)/cmd/localedef	\
442	$(CLOSED)/cmd/more_xpg4	\
443	$(CLOSED)/cmd/mtst	\
444	$(CLOSED)/cmd/od	\
445	$(CLOSED)/cmd/patch	\
446	$(CLOSED)/cmd/pax	\
447	$(CLOSED)/cmd/pcitool	\
448	$(CLOSED)/cmd/printf	\
449	$(CLOSED)/cmd/sed	\
450	$(CLOSED)/cmd/sed_xpg4	\
451	$(CLOSED)/cmd/smartcard	\
452	$(CLOSED)/cmd/tail	\
453	$(CLOSED)/cmd/tr	\
454	$(CLOSED)/cmd/tr_xpg4
455
456i386_SUBDIRS=		\
457	addbadsec	\
458	biosdev		\
459	diskscan	\
460	OWconfig	\
461	rtc		\
462	ucodeadm
463
464sparc_SUBDIRS=		\
465	cvcd		\
466	dcs		\
467	drd		\
468	fruadm		\
469	oplhpd		\
470	prtdscp		\
471	prtfru		\
472	scadm		\
473	sckmd		\
474	sf880drd	\
475	vntsd
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	geniconvtbl	\
558	genmsg		\
559	getconf		\
560	getent		\
561	gettext		\
562	gettxt		\
563	grep		\
564	grep_xpg4	\
565	grpck		\
566	gss		\
567	halt		\
568	head		\
569	hostname	\
570	id		\
571	idmap		\
572	isaexec		\
573	iscsi		\
574	join		\
575	kbd		\
576	krb5		\
577	kstat		\
578	last		\
579	ldap		\
580	ldapcachemgr	\
581	lgrpinfo	\
582	locale		\
583	lofiadm		\
584	logadm		\
585	logger		\
586	logins		\
587	logname		\
588	ls		\
589	lvm		\
590	mailx		\
591	mesg		\
592	mkdir		\
593	mkpwdict	\
594	mktemp		\
595	more		\
596	msgfmt		\
597	mv		\
598	newgrp		\
599	newtask		\
600	nice		\
601	nispasswd	\
602	nohup		\
603	oawk		\
604	pack		\
605	passwd		\
606	passmgmt	\
607	paste		\
608	pathchk		\
609	pfexec		\
610	pg		\
611	pgrep		\
612	picl            \
613	pools		\
614	power		\
615	pr		\
616	praudit		\
617	print		\
618	profiles	\
619	projadd		\
620	projects	\
621	prstat		\
622	prtdiag		\
623	ps		\
624	psrinfo		\
625	ptools		\
626	pwconv		\
627	pwd		\
628	raidctl		\
629	ramdiskadm	\
630	rcap		\
631	rcm_daemon	\
632	refer		\
633	regcmp		\
634	renice		\
635	roles		\
636	rm		\
637	rmdir		\
638	rmformat	\
639	rmmount		\
640	rmvolmgr	\
641	scadm		\
642	script		\
643	sdiff		\
644	sdpadm		\
645	sgs		\
646	sh		\
647	sleep		\
648	sort		\
649	split		\
650	ssh		\
651	stat		\
652	stmsboot	\
653	strings		\
654	su		\
655	sum		\
656	svc		\
657	swap		\
658	syseventadm	\
659	syseventd	\
660	tabs		\
661	tar		\
662	tbl		\
663	tee		\
664	time		\
665	tnf		\
666	touch		\
667	tput		\
668	troff		\
669	tsol		\
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/fwflash	\
704	$(CLOSED)/cmd/iconv	\
705	$(CLOSED)/cmd/ksh	\
706	$(CLOSED)/cmd/llc2	\
707	$(CLOSED)/cmd/localedef	\
708	$(CLOSED)/cmd/more_xpg4	\
709	$(CLOSED)/cmd/od	\
710	$(CLOSED)/cmd/patch	\
711	$(CLOSED)/cmd/pax	\
712	$(CLOSED)/cmd/printf	\
713	$(CLOSED)/cmd/sed	\
714	$(CLOSED)/cmd/sed_xpg4	\
715	$(CLOSED)/cmd/tail	\
716	$(CLOSED)/cmd/tr	\
717	$(CLOSED)/cmd/tr_xpg4
718
719sparc_MSGSUBDIRS=	\
720	fruadm		\
721	prtdscp		\
722	prtfru		\
723	vntsd
724
725i386_MSGSUBDIRS=	\
726	ucodeadm
727
728#
729# commands that use dcgettext for localized time, LC_TIME
730#
731DCSUBDIRS=		\
732	cal		\
733	cfgadm		\
734	diff		\
735	ls		\
736	pr		\
737	ps		\
738	tar		\
739	w		\
740	who		\
741	whodo		\
742	write
743
744$(CLOSED_BUILD)DCSUBDIRS += \
745	$(CLOSED)/cmd/pax
746
747#
748# commands that belong only to the basic security module
749#
750BSMSUBDIRS=		\
751	allocate	\
752	amt		\
753	audit		\
754	audit_warn	\
755	auditconfig	\
756	auditd		\
757	auditreduce	\
758	auditstat	\
759	praudit		\
760	bsmconv		\
761	bsmrecord	\
762	bsmunconv
763
764#
765# commands not owned by the systems group
766#
767BWOSDIRS=
768
769#
770# Commands providing manifests must offer a check target.  A recursive check
771# target across all commands directories is not currently provided.
772#
773MANIFEST_TOPDIRS=			\
774	auditd				\
775	bnu				\
776	consadm				\
777	coreadm				\
778	cron				\
779	cvcd				\
780	dispadmin			\
781	drd				\
782	dumpadm				\
783	eeprom				\
784	fm				\
785	intrd				\
786	ipf				\
787	keyserv				\
788	ldapcachemgr			\
789	nscd				\
790	oplhpd				\
791	power				\
792	rexd				\
793	rpcbind				\
794	rpcsvc				\
795	saf				\
796	sf880drd			\
797	smserverd			\
798	syseventd			\
799	syslogd				\
800	utmpd				\
801	vntsd				\
802	ypcmd				\
803	zoneadmd
804
805MANIFEST_SUBDIRS=			\
806	boot/scripts			\
807	cmd-crypto/scripts		\
808	cmd-inet/usr.lib/in.chargend	\
809	cmd-inet/usr.lib/in.daytimed	\
810	cmd-inet/usr.lib/in.dhcpd	\
811	cmd-inet/usr.lib/in.discardd	\
812	cmd-inet/usr.lib/in.echod	\
813	cmd-inet/usr.lib/in.ndpd	\
814	cmd-inet/usr.lib/in.ripngd	\
815	cmd-inet/usr.lib/in.timed	\
816	cmd-inet/usr.lib/inetd		\
817	cmd-inet/usr.lib/slpd		\
818	cmd-inet/usr.lib/wpad		\
819	cmd-inet/usr.sbin		\
820	cmd-inet/usr.sbin/in.ftpd	\
821	cmd-inet/usr.sbin/in.rdisc	\
822	cmd-inet/usr.sbin/in.routed	\
823	cmd-inet/usr.sbin/in.talkd	\
824	cmd-inet/usr.sbin/routeadm	\
825	cmd/tsol/labeld			\
826	cmd/tsol/tnctl			\
827	cmd/tsol/tnd			\
828	cmd/tsol/tsol-zones		\
829	dcs/sparc/sun4u			\
830	fs.d/autofs			\
831	fs.d/cachefs			\
832	fs.d/nfs/svc			\
833	gss/gssd			\
834	idmap/idmapd			\
835	krb5/kadmin/server		\
836	krb5/krb5kdc			\
837	krb5/kwarn			\
838	krb5/slave			\
839	lp/cmd/lpsched			\
840	lvm/rpc.metad			\
841	lvm/rpc.metamedd		\
842	lvm/rpc.metamhd			\
843	lvm/md_monitord			\
844	lvm/metassist/sysfiles		\
845	lvm/util			\
846	picl/picld			\
847	print/gateway			\
848	print/lp			\
849	rcap/rcapd			\
850	rpcsvc/rpc.bootparamd		\
851	sendmail/lib			\
852	smartcard/daemon		\
853	ssh/etc				\
854	svc/milestone			\
855	ypcmd/yppasswd			\
856	ypcmd/ypupdated			\
857	xntpd/xntpd
858
859all :=		TARGET = all
860install :=	TARGET = install
861clean :=	TARGET = clean
862clobber :=	TARGET = clobber
863lint :=		TARGET = lint
864check :=	TARGET = check
865_msg :=		TARGET = _msg
866_dc :=		TARGET = _dc
867
868.KEEP_STATE:
869
870SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
871
872.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(BSMSUBDIRS) \
873		$(MANIFEST_SUBDIRS)
874
875all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) $(BSMSUBDIRS)
876
877check: svccfg_check .WAIT $(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS)
878
879svccfg_check:
880	@$(ECHO) "building requirements for svccfg check ..."; \
881	(cd $(SRC)/cmd/svc/svccfg && pwd && $(MAKE) $(MFLAGS) native)
882
883#
884# The .WAIT directive works around an apparent bug in parallel make.
885# Evidently make was getting the target _msg vs. _dc confused under
886# some level of parallelization, causing some of the _dc objects
887# not to be built.
888#
889_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
890
891_dc: $(DCSUBDIRS)
892
893#
894# Dependencies
895#
896fs.d: fstyp
897
898$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(BSMSUBDIRS) $(MANIFEST_SUBDIRS): FRC
899	@if [ -f $@/Makefile  ]; then \
900		cd $@; pwd; $(MAKE) $(TARGET); \
901	else \
902		true; \
903	fi
904
905FRC:
906