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