xref: /titanic_50/usr/src/cmd/Makefile (revision c242ec1b4cd260e90178d81575297bb3b3648766)
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 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26include ../Makefile.master
27include ../Makefile.ksh93switch
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	ast		\
63	audio		\
64	auths		\
65	autopush	\
66	avs		\
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	devprop		\
124	dfs.cmds	\
125	diff		\
126	diff3		\
127	diffmk		\
128	dircmp		\
129	dirname		\
130	dis		\
131	diskmgtd	\
132	dispadmin	\
133	dladm		\
134	dmesg		\
135	dtrace		\
136	du		\
137	dumpadm		\
138	dumpcs		\
139	echo		\
140	ed		\
141	eeprom		\
142	egrep		\
143	eject		\
144	emul64ioctl	\
145	enhance		\
146	env		\
147	eqn		\
148	expand		\
149	expr		\
150	exstr		\
151	factor		\
152	false		\
153	fcinfo		\
154	fdetach		\
155	fdformat	\
156	fdisk		\
157	filesync	\
158	fgrep		\
159	file		\
160	filebench	\
161	find		\
162	flowadm		\
163	fm		\
164	fmli		\
165	fmt		\
166	fmthard		\
167	fmtmsg		\
168	fold		\
169	format		\
170	fs.d		\
171	fstyp		\
172	fuser		\
173	fwflash		\
174	gcore		\
175	gencat		\
176	geniconvtbl	\
177	genmsg		\
178	getconf		\
179	getdevpolicy	\
180	getent		\
181	getfacl		\
182	getmajor	\
183	getopt		\
184	gettext		\
185	gettxt		\
186	graph		\
187	grep		\
188	grep_xpg4	\
189	groups		\
190	grpck		\
191	gss		\
192	hal		\
193	halt		\
194	head		\
195	hostid		\
196	hostname	\
197	hwdata		\
198	id		\
199	idmap		\
200	infocmp		\
201	init		\
202	initpkg		\
203	install.d	\
204	intrd		\
205	intrstat	\
206	ipcrm		\
207	ipcs		\
208	ipf		\
209	isainfo		\
210	isalist		\
211	iscsi		\
212	itutools	\
213	iscsiadm	\
214	iscsid		\
215	iscsitsvc	\
216	isns		\
217	itadm		\
218	java		\
219	join		\
220	kbd		\
221	keyserv		\
222	killall		\
223	krb5		\
224	ksh		\
225	kstat		\
226	last		\
227	lastcomm	\
228	ldap		\
229	ldapcachemgr	\
230	lgrpinfo	\
231	line		\
232	link		\
233	dlmgmtd		\
234	listen		\
235	loadkeys	\
236	locale		\
237	lockstat	\
238	locator		\
239	lofiadm		\
240	logadm		\
241	logger		\
242	login		\
243	logins		\
244	logname		\
245	look		\
246	ls		\
247	luxadm		\
248	lvm		\
249	mach		\
250	machid		\
251	mail		\
252	mailx		\
253	makekey		\
254	mdb		\
255	mesg		\
256	mkdir		\
257	mkfifo		\
258	mkfile		\
259	mkmsgs		\
260	mknod		\
261	mkpwdict	\
262	mktemp		\
263	mms		\
264	modload		\
265	more		\
266	mpathadm	\
267	msgfmt		\
268	msgid		\
269	mt		\
270	mv		\
271	mvdir		\
272	ndmpadm		\
273	ndmpd		\
274	ndmpstat	\
275	netadm		\
276	netfiles	\
277	newform		\
278	newgrp		\
279	news		\
280	newtask		\
281	nice		\
282	nispasswd	\
283	nl		\
284	nlsadmin	\
285	nohup		\
286	nsadmin		\
287	nscd		\
288	oamuser		\
289	oawk		\
290	openssl		\
291	pack		\
292	pagesize	\
293	passmgmt	\
294	passwd		\
295	paste		\
296	pathchk		\
297	pbind		\
298	pcidr		\
299	pcmciad		\
300	pfexec		\
301	pgrep		\
302	picl		\
303	plimit		\
304	policykit	\
305	pools		\
306	power		\
307	powertop	\
308	ppgsz		\
309	pg		\
310	plockstat	\
311	pr		\
312	prctl		\
313	print		\
314	priocntl	\
315	profiles	\
316	projadd		\
317	projects	\
318	prstat		\
319	prtconf		\
320	prtdiag		\
321	prtvtoc		\
322	ps		\
323	psradm		\
324	psrinfo		\
325	psrset		\
326	ptools		\
327	pwck		\
328	pwconv		\
329	pwd		\
330	raidctl		\
331	ramdiskadm	\
332	rcap		\
333	rcm_daemon	\
334	rctladm		\
335	refer		\
336	regcmp		\
337	renice		\
338	rexd		\
339	rm		\
340	rmdir		\
341	rmformat	\
342	rmmount		\
343	rmt		\
344	rmvolmgr	\
345	roles		\
346	rpcbind		\
347	rpcgen		\
348	rpcinfo		\
349	rpcsvc		\
350	rpld		\
351	runat		\
352	sa		\
353	saf		\
354	savecore	\
355	sbdadm		\
356	script		\
357	scsi		\
358	sdiff		\
359	sdpadm		\
360	sendmail	\
361	setfacl		\
362	setmnt		\
363	setpgrp		\
364	setuname	\
365	sgs		\
366	sh		\
367	shcomp		\
368	smbios		\
369	smbsrv		\
370	smserverd	\
371	soelim		\
372	sort		\
373	spell		\
374	spline		\
375	split		\
376	sqlite		\
377	srchtxt		\
378	ssh		\
379	stat		\
380	stmfadm		\
381	stmfsvc		\
382	stmsboot	\
383	streams		\
384	strings		\
385	su		\
386	sulogin		\
387	sunpc		\
388	svc		\
389	swap		\
390	sync		\
391	sysdef		\
392	syseventadm	\
393	syslogd		\
394	tabs		\
395	tar		\
396	tbl		\
397	tcopy		\
398	tcpd		\
399	tee		\
400	terminfo	\
401	th_tools	\
402	tic		\
403	time		\
404	tip		\
405	tnf		\
406	touch		\
407	tplot		\
408	tput		\
409	trapstat	\
410	troff		\
411	true		\
412	truss		\
413	tsol		\
414	tty		\
415	ttymon		\
416	uadmin		\
417	ul		\
418	uname		\
419	uniq		\
420	units		\
421	unlink		\
422	unpack		\
423	users		\
424	utmp_update	\
425	utmpd		\
426	valtools	\
427	vgrind		\
428	vi		\
429	vna		\
430	volcheck	\
431	volrmmount	\
432	vscan		\
433	vt		\
434	w		\
435	wall		\
436	wbem		\
437	wc		\
438	which		\
439	who		\
440	whodo		\
441	wracct		\
442	write		\
443	xntpd		\
444	xargs		\
445	xstr		\
446	yes		\
447	ypcmd		\
448	yppasswd	\
449	zdb		\
450	zdump		\
451	zfs		\
452	zic		\
453	zinject		\
454	zlogin		\
455	zoneadm		\
456	zoneadmd	\
457	zonecfg		\
458	zonename	\
459	zpool		\
460	ztest
461
462$(CLOSED_BUILD)COMMON_SUBDIRS += \
463	$(CLOSED)/cmd/dodatadm	\
464	$(CLOSED)/cmd/iconv	\
465	$(CLOSED)/cmd/ksh	\
466	$(CLOSED)/cmd/llc2	\
467	$(CLOSED)/cmd/localedef	\
468	$(CLOSED)/cmd/more_xpg4	\
469	$(CLOSED)/cmd/mtst	\
470	$(CLOSED)/cmd/od	\
471	$(CLOSED)/cmd/patch	\
472	$(CLOSED)/cmd/pax	\
473	$(CLOSED)/cmd/pcitool	\
474	$(CLOSED)/cmd/printf	\
475	$(CLOSED)/cmd/sed	\
476	$(CLOSED)/cmd/sed_xpg4	\
477	$(CLOSED)/cmd/smartcard	\
478	$(CLOSED)/cmd/tail	\
479	$(CLOSED)/cmd/tr_xpg4
480
481i386_SUBDIRS=		\
482	addbadsec	\
483	biosdev		\
484	diskscan	\
485	lms		\
486	OWconfig	\
487	rtc		\
488	ucodeadm	\
489	xvm
490
491sparc_SUBDIRS=		\
492	cvcd		\
493	dcs		\
494	device_remap	\
495	drd		\
496	fps		\
497	fruadm		\
498	oplhpd		\
499	prtdscp		\
500	prtfru		\
501	scadm		\
502	sckmd		\
503	sf880drd	\
504	vntsd
505
506#
507# Commands that are messaged.  Note that 'lp' and 'man' come first
508# (see previous comment about 'lp' and 'man').
509#
510MSGSUBDIRS=		\
511	lp		\
512	man		\
513	abi		\
514	acctadm		\
515	allocate	\
516	asa		\
517	audio		\
518	audit		\
519	auditd		\
520	auths		\
521	autopush	\
522	avs		\
523	awk		\
524	awk_xpg4	\
525	backup		\
526	banner		\
527	bart		\
528	basename	\
529	bnu		\
530	bsmconv		\
531	bsmrecord	\
532	bsmunconv	\
533	busstat		\
534	cal		\
535	cat		\
536	cdrw		\
537	cfgadm		\
538	checkeq		\
539	checknr		\
540	chgrp		\
541	chmod		\
542	chown		\
543	cksum		\
544	cmd-crypto	\
545	cmd-inet	\
546	cmp		\
547	col		\
548	comm		\
549	compress	\
550	consadm		\
551	coreadm		\
552	cpio		\
553	cpc		\
554	cron		\
555	csh		\
556	csplit		\
557	ctrun		\
558	ctstat		\
559	ctwatch		\
560	cut		\
561	datadm		\
562	date		\
563	dc		\
564	dcs		\
565	dd		\
566	deroff		\
567	devfsadm	\
568	dfs.cmds	\
569	diff		\
570	diffmk		\
571	dladm		\
572	du		\
573	dumpcs		\
574	ed		\
575	eject		\
576	env		\
577	eqn		\
578	expand		\
579	expr		\
580	fcinfo		\
581	fgrep		\
582	file		\
583	filesync	\
584	find		\
585	flowadm		\
586	fm		\
587	fold		\
588	fs.d		\
589	fwflash		\
590	geniconvtbl	\
591	genmsg		\
592	getconf		\
593	getent		\
594	gettext		\
595	gettxt		\
596	grep		\
597	grep_xpg4	\
598	grpck		\
599	gss		\
600	halt		\
601	head		\
602	hostname	\
603	id		\
604	idmap		\
605	isaexec		\
606	iscsi		\
607	iscsiadm	\
608	iscsid		\
609	isns		\
610	itadm		\
611	join		\
612	kbd		\
613	krb5		\
614	ksh		\
615	kstat		\
616	last		\
617	ldap		\
618	ldapcachemgr	\
619	lgrpinfo	\
620	locale		\
621	lofiadm		\
622	logadm		\
623	logger		\
624	logins		\
625	logname		\
626	ls		\
627	luxadm		\
628	lvm		\
629	mailx		\
630	mesg		\
631	mkdir		\
632	mkpwdict	\
633	mktemp		\
634	more		\
635	mpathadm	\
636	msgfmt		\
637	mv		\
638	ndmpadm		\
639	ndmpstat	\
640	newgrp		\
641	newtask		\
642	nice		\
643	nispasswd	\
644	nohup		\
645	oawk		\
646	pack		\
647	passwd		\
648	passmgmt	\
649	paste		\
650	pathchk		\
651	pfexec		\
652	pg		\
653	pgrep		\
654	picl            \
655	pools		\
656	power		\
657	pr		\
658	praudit		\
659	print		\
660	profiles	\
661	projadd		\
662	projects	\
663	prstat		\
664	prtdiag		\
665	ps		\
666	psrinfo		\
667	ptools		\
668	pwconv		\
669	pwd		\
670	raidctl		\
671	ramdiskadm	\
672	rcap		\
673	rcm_daemon	\
674	refer		\
675	regcmp		\
676	renice		\
677	roles		\
678	rm		\
679	rmdir		\
680	rmformat	\
681	rmmount		\
682	rmvolmgr	\
683	sbdadm		\
684	scadm		\
685	script		\
686	scsi		\
687	sdiff		\
688	sdpadm		\
689	sgs		\
690	sh		\
691	shcomp		\
692	sort		\
693	split		\
694	ssh		\
695	stat		\
696	stmfadm		\
697	stmsboot	\
698	strings		\
699	su		\
700	svc		\
701	swap		\
702	syseventadm	\
703	syseventd	\
704	tabs		\
705	tar		\
706	tbl		\
707	tee		\
708	time		\
709	tnf		\
710	touch		\
711	tput		\
712	troff		\
713	tsol		\
714	tty		\
715	ttymon		\
716	ul		\
717	uname		\
718	uniq		\
719	units		\
720	unlink		\
721	unpack		\
722	valtools	\
723	vgrind		\
724	vi		\
725	volcheck	\
726	volrmmount	\
727	w		\
728	wbem		\
729	wc		\
730	who		\
731	whodo		\
732	wracct		\
733	write		\
734	xargs		\
735	yppasswd	\
736	zdump		\
737	zfs		\
738	zic		\
739	zlogin		\
740	zoneadm		\
741	zoneadmd	\
742	zonecfg		\
743	zonename	\
744	zpool
745
746$(CLOSED_BUILD)MSGSUBDIRS += \
747	$(CLOSED)/cmd/iconv	\
748	$(CLOSED)/cmd/ksh	\
749	$(CLOSED)/cmd/llc2	\
750	$(CLOSED)/cmd/localedef	\
751	$(CLOSED)/cmd/more_xpg4	\
752	$(CLOSED)/cmd/od	\
753	$(CLOSED)/cmd/patch	\
754	$(CLOSED)/cmd/pax	\
755	$(CLOSED)/cmd/printf	\
756	$(CLOSED)/cmd/sed	\
757	$(CLOSED)/cmd/sed_xpg4	\
758	$(CLOSED)/cmd/tail	\
759	$(CLOSED)/cmd/tr_xpg4
760
761sparc_MSGSUBDIRS=	\
762	fruadm		\
763	prtdscp		\
764	prtfru		\
765	vntsd
766
767i386_MSGSUBDIRS=	\
768	ucodeadm
769
770#
771# commands that use dcgettext for localized time, LC_TIME
772#
773DCSUBDIRS=		\
774	cal		\
775	cfgadm		\
776	diff		\
777	ls		\
778	pr		\
779	ps		\
780	tar		\
781	w		\
782	who		\
783	whodo		\
784	write
785
786$(CLOSED_BUILD)DCSUBDIRS += \
787	$(CLOSED)/cmd/pax
788
789#
790# commands that belong only to the basic security module
791#
792BSMSUBDIRS=		\
793	allocate	\
794	amt		\
795	audit		\
796	audit_warn	\
797	auditconfig	\
798	auditd		\
799	auditreduce	\
800	auditstat	\
801	praudit		\
802	bsmconv		\
803	bsmrecord	\
804	bsmunconv
805
806#
807# commands not owned by the systems group
808#
809BWOSDIRS=
810
811
812all :=		TARGET = all
813install :=	TARGET = install
814clean :=	TARGET = clean
815clobber :=	TARGET = clobber
816lint :=		TARGET = lint
817_msg :=		TARGET = _msg
818_dc :=		TARGET = _dc
819
820.KEEP_STATE:
821
822SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
823
824.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(BSMSUBDIRS)
825
826all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) $(BSMSUBDIRS)
827
828#
829# Manifests cannot be checked in parallel, because we are using
830# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
831# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
832# we spawn off a sub-make to perform the non-parallel 'make check'
833#
834check:
835	$(MAKE) -f Makefile.check check
836
837#
838# The .WAIT directive works around an apparent bug in parallel make.
839# Evidently make was getting the target _msg vs. _dc confused under
840# some level of parallelization, causing some of the _dc objects
841# not to be built.
842#
843_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
844
845_dc: $(DCSUBDIRS)
846
847#
848# Dependencies
849#
850fs.d: fstyp
851ksh:	shcomp isaexec
852
853$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(BSMSUBDIRS): FRC
854	@if [ -f $@/Makefile  ]; then \
855		cd $@; pwd; $(MAKE) $(TARGET); \
856	else \
857		true; \
858	fi
859
860FRC:
861