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