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