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