xref: /illumos-gate/usr/src/cmd/Makefile (revision d6bb6a8465e557cb946ef49d56ed3202f6218652)
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# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26
27include ../Makefile.master
28
29#
30#	Note that the commands 'agents', 'lp', 'perl', and 'man' are first in
31#	the list, violating alphabetical order.  This is because they are very
32#	long-running and should be given the most wall-clock time for a
33#	parallel build.
34#
35#	Commands in the FIRST_SUBDIRS list are built before starting the build
36#	of other commands.  Currently this includes only 'isaexec' and
37#	'platexec'.  This is necessary because $(ROOT)/usr/lib/isaexec or
38#	$(ROOT)/usr/lib/platexec must exist when some other commands are built
39#	because their 'make install' creates a hard link to one of them.
40#
41#	Commands are listed one per line so that TeamWare can auto-merge most
42#	changes.
43#
44
45FIRST_SUBDIRS=		\
46	isaexec		\
47	platexec
48
49COMMON_SUBDIRS=		\
50	agents		\
51	availdevs	\
52	lp		\
53	perl		\
54	man		\
55	Adm		\
56	abi		\
57	adbgen		\
58	acct		\
59	acctadm		\
60	arch		\
61	asa		\
62	audio		\
63	auths		\
64	autopush	\
65	awk		\
66	awk_xpg4	\
67	backup		\
68	banner		\
69	bart		\
70	basename	\
71	bc		\
72	bdiff		\
73	bfs		\
74	bnu		\
75	boot		\
76	busstat		\
77	cal		\
78	calendar	\
79	captoinfo	\
80	cat		\
81	cdrw		\
82	cfgadm		\
83	checkeq		\
84	checknr		\
85	chgrp		\
86	chmod		\
87	chown		\
88	chroot		\
89	cksum		\
90	clear		\
91	clinfo		\
92	cmd-crypto	\
93	cmd-inet	\
94	cmp		\
95	col		\
96	comm		\
97	compress	\
98	consadm		\
99	coreadm		\
100	cpio		\
101	cpc		\
102	cron		\
103	crypt		\
104	csh		\
105	csplit		\
106	ctrun		\
107	ctstat		\
108	ctwatch		\
109	cut		\
110	datadm		\
111	date		\
112	dc		\
113	dd		\
114	deroff		\
115	des		\
116	devfsadm	\
117	syseventd	\
118	devctl		\
119	devinfo		\
120	devmgmt		\
121	dfs.cmds	\
122	diff		\
123	diff3		\
124	diffmk		\
125	dircmp		\
126	dirname		\
127	dis		\
128	diskmgtd	\
129	dispadmin	\
130	dladm		\
131	dmesg		\
132	dtrace		\
133	du		\
134	dumpadm		\
135	dumpcs		\
136	echo		\
137	ed		\
138	eeprom		\
139	egrep		\
140	emul64ioctl	\
141	enhance		\
142	env		\
143	eqn		\
144	expand		\
145	expr		\
146	exstr		\
147	factor		\
148	false		\
149	fdetach		\
150	fdformat	\
151	fdisk		\
152	filesync	\
153	fgrep		\
154	file		\
155	find		\
156	fm		\
157	fmli		\
158	fmt		\
159	fmthard		\
160	fmtmsg		\
161	fold		\
162	format		\
163	fs.d		\
164	fstyp		\
165	fuser		\
166	gcore		\
167	gencat		\
168	geniconvtbl	\
169	genmsg		\
170	getconf		\
171	getdevpolicy	\
172	getent		\
173	getfacl		\
174	getmajor	\
175	getopt		\
176	gettext		\
177	gettxt		\
178	graph		\
179	grep		\
180	grep_xpg4	\
181	groups		\
182	grpck		\
183	gss		\
184	halt		\
185	head		\
186	hostid		\
187	hostname	\
188	id		\
189	infocmp		\
190	init		\
191	initpkg		\
192	install.d	\
193	intrd		\
194	intrstat	\
195	ipcrm		\
196	ipcs		\
197	ipf		\
198	isainfo		\
199	isalist		\
200	java		\
201	join		\
202	kbd		\
203	keyserv		\
204	killall		\
205	krb5		\
206	kstat		\
207	last		\
208	lastcomm	\
209	ldap		\
210	ldapcachemgr	\
211	line		\
212	link		\
213	listen		\
214	loadkeys	\
215	locale		\
216	lockstat	\
217	locator		\
218	lofiadm		\
219	logadm		\
220	logger		\
221	login		\
222	logins		\
223	logname		\
224	look		\
225	ls		\
226	lvm		\
227	mach		\
228	machid		\
229	mail		\
230	mailx		\
231	makekey		\
232	mdb		\
233	mesg		\
234	mkdir		\
235	mkfifo		\
236	mkfile		\
237	mkmsgs		\
238	mknod		\
239	mkpwdict	\
240	mktemp		\
241	modload		\
242	more		\
243	msgfmt		\
244	msgid		\
245	mt		\
246	mv		\
247	mvdir		\
248	netadm		\
249	netfiles	\
250	newform		\
251	newgrp		\
252	news		\
253	newtask		\
254	nice		\
255	nispasswd	\
256	nl		\
257	nlsadmin	\
258	nohup		\
259	nsadmin		\
260	nscd		\
261	oamuser		\
262	oawk		\
263	openssl		\
264	pack		\
265	pagesize	\
266	passmgmt	\
267	passwd		\
268	paste		\
269	pathchk		\
270	pbind		\
271	pcidr		\
272	pcmciad		\
273	pfexec		\
274	pgrep		\
275	picl		\
276	plimit		\
277	pools		\
278	power		\
279	ppgsz		\
280	pg		\
281	plockstat	\
282	pr		\
283	prctl		\
284	print		\
285	priocntl	\
286	profiles	\
287	projadd		\
288	projects	\
289	prstat		\
290	prtconf		\
291	prtdiag		\
292	prtvtoc		\
293	ps		\
294	psradm		\
295	psrinfo		\
296	psrset		\
297	pt_chmod	\
298	ptools		\
299	pwck		\
300	pwconv		\
301	pwd		\
302	raidctl		\
303	ramdiskadm	\
304	rcap		\
305	rcm_daemon	\
306	rctladm		\
307	refer		\
308	regcmp		\
309	renice		\
310	rexd		\
311	rm		\
312	rmdir		\
313	rmformat	\
314	rmt		\
315	roles		\
316	rpcbind		\
317	rpcgen		\
318	rpcinfo		\
319	rpcsvc		\
320	rpld		\
321	runat		\
322	sa		\
323	saf		\
324	savecore	\
325	script		\
326	sdiff		\
327	sendmail	\
328	setfacl		\
329	setmnt		\
330	setpgrp		\
331	setuname	\
332	sgs		\
333	sh		\
334	sleep		\
335	smbios		\
336	smserverd	\
337	soelim		\
338	sort		\
339	spell		\
340	spline		\
341	split		\
342	srchtxt		\
343	ssh		\
344	stat		\
345	streams		\
346	strings		\
347	su		\
348	sulogin		\
349	sum		\
350	sunpc		\
351	svc		\
352	swap		\
353	sync		\
354	sysdef		\
355	syseventadm	\
356	syslogd		\
357	tabs		\
358	tar		\
359	tbl		\
360	tcopy		\
361	tcpd		\
362	tee		\
363	terminfo	\
364	th_tools	\
365	tic		\
366	time		\
367	tip		\
368	tnf		\
369	touch		\
370	tplot		\
371	tput		\
372	trapstat	\
373	troff		\
374	true		\
375	truss		\
376	tty		\
377	ttymon		\
378	uadmin		\
379	ul		\
380	uname		\
381	uniq		\
382	units		\
383	unlink		\
384	unpack		\
385	users		\
386	utmp_update	\
387	utmpd		\
388	valtools	\
389	vgrind		\
390	vi		\
391	volmgt		\
392	w		\
393	wall		\
394	wbem		\
395	wc		\
396	which		\
397	who		\
398	whodo		\
399	wracct		\
400	write		\
401	xntpd		\
402	xargs		\
403	xstr		\
404	yes		\
405	ypcmd		\
406	yppasswd	\
407	zdb		\
408	zdump		\
409	zfs		\
410	zic		\
411	zinject		\
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/mtst	\
428	$(CLOSED)/cmd/od	\
429	$(CLOSED)/cmd/patch	\
430	$(CLOSED)/cmd/pax	\
431	$(CLOSED)/cmd/pcitool	\
432	$(CLOSED)/cmd/printf	\
433	$(CLOSED)/cmd/sed	\
434	$(CLOSED)/cmd/sed_xpg4	\
435	$(CLOSED)/cmd/smartcard	\
436	$(CLOSED)/cmd/tail	\
437	$(CLOSED)/cmd/tr	\
438	$(CLOSED)/cmd/tr_xpg4
439
440i386_SUBDIRS=		\
441	addbadsec	\
442	biosdev		\
443	diskscan	\
444	OWconfig	\
445	rtc
446
447sparc_SUBDIRS=		\
448	cvcd		\
449	dcs		\
450	fruadm		\
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