xref: /illumos-gate/usr/src/cmd/Makefile (revision fb3fb4f3d76d55b64440afd0af72775dfad3bd1d)
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 2006 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	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	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	zlogin		\
412	zoneadm		\
413	zoneadmd	\
414	zonecfg		\
415	zonename	\
416	zpool		\
417	ztest
418
419$(CLOSED_BUILD)COMMON_SUBDIRS += \
420	$(CLOSED)/cmd/dodatadm	\
421	$(CLOSED)/cmd/iconv	\
422	$(CLOSED)/cmd/ksh	\
423	$(CLOSED)/cmd/llc2	\
424	$(CLOSED)/cmd/localedef	\
425	$(CLOSED)/cmd/more_xpg4	\
426	$(CLOSED)/cmd/mtst	\
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	prtfru		\
451	$(CLOSED)/cmd/scadm	\
452	sckmd		\
453	sf880drd	\
454	stmsboot	\
455	wrsmconf	\
456	wrsmstat
457
458#
459# Commands that are messaged.  Note that 'lp' and 'man' come first
460# (see previous comment about 'lp' and 'man').
461#
462MSGSUBDIRS=		\
463	lp		\
464	man		\
465	abi		\
466	acctadm		\
467	allocate	\
468	asa		\
469	audio		\
470	audit		\
471	auditd		\
472	auths		\
473	autopush	\
474	awk		\
475	awk_xpg4	\
476	backup		\
477	banner		\
478	bart		\
479	basename	\
480	bnu		\
481	bsmconv		\
482	bsmrecord	\
483	bsmunconv	\
484	busstat		\
485	cal		\
486	cat		\
487	cdrw		\
488	cfgadm		\
489	checkeq		\
490	checknr		\
491	chgrp		\
492	chmod		\
493	chown		\
494	cksum		\
495	cmd-crypto	\
496	cmd-inet	\
497	cmp		\
498	col		\
499	comm		\
500	compress	\
501	consadm		\
502	coreadm		\
503	cpio		\
504	cpc		\
505	cron		\
506	csh		\
507	csplit		\
508	ctrun		\
509	ctstat		\
510	ctwatch		\
511	cut		\
512	datadm		\
513	date		\
514	dc		\
515	dcs		\
516	dd		\
517	deroff		\
518	devfsadm	\
519	diff		\
520	diffmk		\
521	dladm		\
522	du		\
523	dumpcs		\
524	ed		\
525	env		\
526	eqn		\
527	expand		\
528	expr		\
529	fgrep		\
530	file		\
531	filesync	\
532	find		\
533	fm		\
534	fold		\
535	fs.d		\
536	geniconvtbl	\
537	genmsg		\
538	getconf		\
539	getent		\
540	gettext		\
541	gettxt		\
542	grep		\
543	grep_xpg4	\
544	grpck		\
545	gss		\
546	halt		\
547	head		\
548	hostname	\
549	id		\
550	isaexec		\
551	join		\
552	krb5		\
553	kstat		\
554	last		\
555	ldap		\
556	ldapcachemgr	\
557	locale		\
558	lofiadm		\
559	logadm		\
560	logger		\
561	logins		\
562	logname		\
563	ls		\
564	lvm		\
565	mailx		\
566	mesg		\
567	mkdir		\
568	mkpwdict	\
569	mktemp		\
570	more		\
571	msgfmt		\
572	mv		\
573	newgrp		\
574	newtask		\
575	nice		\
576	nispasswd	\
577	nohup		\
578	oawk		\
579	pack		\
580	passwd		\
581	passmgmt	\
582	paste		\
583	pathchk		\
584	pfexec		\
585	pg		\
586	pgrep		\
587	picl            \
588	pools		\
589	power		\
590	pr		\
591	praudit		\
592	print		\
593	profiles	\
594	projadd		\
595	projects	\
596	prstat		\
597	prtdiag		\
598	ps		\
599	psrinfo		\
600	pwconv		\
601	pwd		\
602	raidctl		\
603	ramdiskadm	\
604	rcap		\
605	rcm_daemon	\
606	refer		\
607	regcmp		\
608	renice		\
609	roles		\
610	rm		\
611	rmdir		\
612	rmformat	\
613	script		\
614	sdiff		\
615	sgs		\
616	sh		\
617	sleep		\
618	sort		\
619	split		\
620	ssh		\
621	strings		\
622	su		\
623	sum		\
624	svc		\
625	swap		\
626	syseventadm	\
627	syseventd	\
628	tabs		\
629	tar		\
630	tbl		\
631	tee		\
632	time		\
633	tnf		\
634	touch		\
635	tput		\
636	troff		\
637	tty		\
638	ttymon		\
639	ul		\
640	uname		\
641	uniq		\
642	units		\
643	unlink		\
644	unpack		\
645	valtools	\
646	vgrind		\
647	vi		\
648	volmgt		\
649	w		\
650	wbem		\
651	wc		\
652	who		\
653	whodo		\
654	wracct		\
655	write		\
656	xargs		\
657	yppasswd	\
658	zdump		\
659	zfs		\
660	zic		\
661	zlogin		\
662	zoneadm		\
663	zoneadmd	\
664	zonecfg		\
665	zonename	\
666	zpool
667
668$(CLOSED_BUILD)MSGSUBDIRS += \
669	$(CLOSED)/cmd/iconv	\
670	$(CLOSED)/cmd/ksh	\
671	$(CLOSED)/cmd/llc2	\
672	$(CLOSED)/cmd/localedef	\
673	$(CLOSED)/cmd/more_xpg4	\
674	$(CLOSED)/cmd/od	\
675	$(CLOSED)/cmd/patch	\
676	$(CLOSED)/cmd/pax	\
677	$(CLOSED)/cmd/printf	\
678	$(CLOSED)/cmd/scadm	\
679	$(CLOSED)/cmd/sed	\
680	$(CLOSED)/cmd/sed_xpg4	\
681	$(CLOSED)/cmd/tail	\
682	$(CLOSED)/cmd/tr	\
683	$(CLOSED)/cmd/tr_xpg4
684
685sparc_MSGSUBDIRS=	\
686	fruadm		\
687	prtfru		\
688	stmsboot	\
689	wrsmconf	\
690	wrsmstat
691
692#
693# commands that use dcgettext for localized time, LC_TIME
694#
695DCSUBDIRS=		\
696	cal		\
697	cfgadm		\
698	diff		\
699	ls		\
700	pr		\
701	tar		\
702	w		\
703	who		\
704	whodo		\
705	write
706
707$(CLOSED_BUILD)DCSUBDIRS += \
708	$(CLOSED)/cmd/pax
709
710#
711# commands that belong only to the basic security module
712#
713BSMSUBDIRS=		\
714	allocate	\
715	amt		\
716	audit		\
717	audit_warn	\
718	auditconfig	\
719	auditd		\
720	auditreduce	\
721	auditstat	\
722	dminfo		\
723	praudit		\
724	bsmconv		\
725	bsmrecord	\
726	bsmunconv
727
728#
729# commands not owned by the systems group
730#
731BWOSDIRS=
732
733#
734# Commands providing manifests must offer a check target.  A recursive check
735# target across all commands directories is not currently provided.
736#
737MANIFEST_TOPDIRS=			\
738	auditd				\
739	bnu				\
740	consadm				\
741	coreadm				\
742	cron				\
743	cvcd				\
744	dispadmin			\
745	dumpadm				\
746	eeprom				\
747	fm				\
748	intrd				\
749	ipf				\
750	keyserv				\
751	ldapcachemgr			\
752	nscd				\
753	power				\
754	rexd				\
755	rpcbind				\
756	rpcsvc				\
757	saf				\
758	sf880drd			\
759	smserverd			\
760	syseventd			\
761	syslogd				\
762	utmpd				\
763	ypcmd				\
764	zoneadmd
765
766MANIFEST_SUBDIRS=			\
767	cmd-crypto/scripts		\
768	cmd-inet/usr.lib/in.chargend	\
769	cmd-inet/usr.lib/in.daytimed	\
770	cmd-inet/usr.lib/in.dhcpd	\
771	cmd-inet/usr.lib/in.discardd	\
772	cmd-inet/usr.lib/in.echod	\
773	cmd-inet/usr.lib/in.timed	\
774	cmd-inet/usr.lib/inetd		\
775	cmd-inet/usr.lib/slpd		\
776	cmd-inet/usr.sbin		\
777	cmd-inet/usr.sbin/in.ftpd	\
778	cmd-inet/usr.sbin/in.talkd	\
779	dcs/sparc/sun4u			\
780	fs.d/autofs			\
781	fs.d/cachefs			\
782	fs.d/nfs/svc			\
783	gss/gssd			\
784	krb5/kadmin/server		\
785	krb5/krb5kdc			\
786	krb5/kwarn			\
787	krb5/slave			\
788	lp/cmd/lpsched			\
789	lvm/rpc.metad			\
790	lvm/rpc.metamedd		\
791	lvm/rpc.metamhd			\
792	lvm/md_monitord			\
793	lvm/metassist/sysfiles		\
794	lvm/util			\
795	picl/picld			\
796	print/gateway			\
797	print/lp			\
798	rcap/rcapd			\
799	rpcsvc/rpc.bootparamd		\
800	sendmail/lib			\
801	smartcard/daemon		\
802	ssh/etc				\
803	svc/milestone			\
804	ypcmd/yppasswd			\
805	ypcmd/ypupdated			\
806	xntpd/xntpd
807
808all :=		TARGET = all
809install :=	TARGET = install
810clean :=	TARGET = clean
811clobber :=	TARGET = clobber
812lint :=		TARGET = lint
813check :=	TARGET = check
814_msg :=		TARGET = _msg
815_dc :=		TARGET = _dc
816
817.KEEP_STATE:
818
819SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
820
821.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(BSMSUBDIRS) \
822		$(MANIFEST_SUBDIRS)
823
824all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) $(BSMSUBDIRS)
825
826check: svccfg_check .WAIT $(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS)
827
828svccfg_check:
829	@$(ECHO) "building requirements for svccfg check ..."; \
830	(cd $(SRC)/cmd/svc/svccfg && pwd && $(MAKE) $(MFLAGS) native)
831
832#
833# The .WAIT directive works around an apparent bug in parallel make.
834# Evidently make was getting the target _msg vs. _dc confused under
835# some level of parallelization, causing some of the _dc objects
836# not to be built.
837#
838_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
839
840_dc: $(DCSUBDIRS)
841
842$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(BSMSUBDIRS) $(MANIFEST_SUBDIRS): FRC
843	@if [ -f $@/Makefile  ]; then \
844		cd $@; pwd; $(MAKE) $(TARGET); \
845	else \
846		true; \
847	fi
848
849FRC:
850