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