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