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