xref: /titanic_44/usr/src/cmd/Makefile (revision 6b5e5868e7ebf1aff3a5abd7d0c4ef0e5fbf3648)
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	allocate	\
49	availdevs	\
50	lp		\
51	perl		\
52	man		\
53	Adm		\
54	abi		\
55	adbgen		\
56	acct		\
57	acctadm		\
58	arch		\
59	asa		\
60	ast		\
61	audio		\
62	auths		\
63	autopush	\
64	avs		\
65	awk		\
66	awk_xpg4	\
67	backup		\
68	banner		\
69	bart		\
70	basename	\
71	bc		\
72	bdiff		\
73	beadm		\
74	bfs		\
75	bnu		\
76	boot		\
77	busstat		\
78	cal		\
79	calendar	\
80	captoinfo	\
81	cat		\
82	cdrw		\
83	cfgadm		\
84	checkeq		\
85	checknr		\
86	chgrp		\
87	chmod		\
88	chown		\
89	chroot		\
90	clear		\
91	clinfo		\
92	cmd-crypto	\
93	cmd-inet	\
94	col		\
95	compress	\
96	consadm		\
97	coreadm		\
98	cpio		\
99	cpc		\
100	cron		\
101	crypt		\
102	csh		\
103	csplit		\
104	ctrun		\
105	ctstat		\
106	ctwatch		\
107	datadm		\
108	date		\
109	dc		\
110	dd		\
111	deroff		\
112	devfsadm	\
113	syseventd	\
114	devctl		\
115	devinfo		\
116	devmgmt		\
117	devprop		\
118	dfs.cmds	\
119	diff		\
120	diff3		\
121	diffmk		\
122	dircmp		\
123	dirname		\
124	dis		\
125	diskmgtd	\
126	dispadmin	\
127	dladm		\
128	dlstat		\
129	dmesg		\
130	dodatadm	\
131	dtrace		\
132	du		\
133	dumpadm		\
134	dumpcs		\
135	echo		\
136	ed		\
137	eeprom		\
138	egrep		\
139	eject		\
140	emul64ioctl	\
141	enhance		\
142	env		\
143	eqn		\
144	expand		\
145	expr		\
146	exstr		\
147	factor		\
148	false		\
149	fcinfo		\
150	fcoesvc		\
151	fdetach		\
152	fdformat	\
153	fdisk		\
154	filesync	\
155	fgrep		\
156	file		\
157	filebench	\
158	find		\
159	flowadm		\
160	flowstat	\
161	fm		\
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	localedef	\
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	pginfo		\
297	pgstat		\
298	pgrep		\
299	picl		\
300	plimit		\
301	policykit	\
302	pools		\
303	power		\
304	powertop	\
305	ppgsz		\
306	pg		\
307	plockstat	\
308	pr		\
309	prctl		\
310	print		\
311	priocntl	\
312	profiles	\
313	projadd		\
314	projects	\
315	prstat		\
316	prtconf		\
317	prtdiag		\
318	prtvtoc		\
319	ps		\
320	psradm		\
321	psrinfo		\
322	psrset		\
323	ptools		\
324	pwck		\
325	pwconv		\
326	pwd		\
327	pyzfs		\
328	raidctl		\
329	ramdiskadm	\
330	rcap		\
331	rcm_daemon	\
332	rctladm		\
333	refer		\
334	regcmp		\
335	renice		\
336	rexd		\
337	rm		\
338	rmdir		\
339	rmformat	\
340	rmmount		\
341	rmt		\
342	rmvolmgr	\
343	roles		\
344	rpcbind		\
345	rpcgen		\
346	rpcinfo		\
347	rpcsvc		\
348	runat		\
349	sa		\
350	saf		\
351	sasinfo		\
352	savecore	\
353	sbdadm		\
354	script		\
355	scsi		\
356	sdiff		\
357	sdpadm		\
358	sendmail	\
359	setfacl		\
360	setmnt		\
361	setpgrp		\
362	setuname	\
363	sgs		\
364	sh		\
365	shcomp		\
366	smbios		\
367	smbsrv		\
368	smserverd	\
369	soelim		\
370	sort		\
371	spell		\
372	split		\
373	sqlite		\
374	srchtxt		\
375	srptadm		\
376	srptsvc		\
377	ssh		\
378	stat		\
379	stmfadm		\
380	stmfproxy	\
381	stmfsvc		\
382	stmsboot	\
383	streams		\
384	strings		\
385	su		\
386	sulogin		\
387	sunpc		\
388	svc		\
389	svr4pkg		\
390	swap		\
391	sync		\
392	sysdef		\
393	syseventadm	\
394	syslogd		\
395	tabs		\
396	tail		\
397	tar		\
398	tbl		\
399	tcopy		\
400	tcpd		\
401	terminfo	\
402	th_tools	\
403	tic		\
404	time		\
405	tip		\
406	tnf		\
407	touch		\
408	tplot		\
409	tput		\
410	tr		\
411	trapstat	\
412	troff		\
413	true		\
414	truss		\
415	tsol		\
416	tty		\
417	ttymon		\
418	tzreload	\
419	uadmin		\
420	ul		\
421	uname		\
422	units		\
423	unlink		\
424	unpack		\
425	userattr	\
426	users		\
427	utmp_update	\
428	utmpd		\
429	valtools	\
430	vgrind		\
431	vi		\
432	volcheck	\
433	volrmmount	\
434	vrrpadm		\
435	vscan		\
436	vt		\
437	w		\
438	wall		\
439	which		\
440	who		\
441	whodo		\
442	wracct		\
443	write		\
444	wusbadm		\
445	xargs		\
446	xstr		\
447	yes		\
448	ypcmd		\
449	yppasswd	\
450	zdb		\
451	zdump		\
452	zfs		\
453	zic		\
454	zinject		\
455	zlogin		\
456	zoneadm		\
457	zoneadmd	\
458	zonecfg		\
459	zonename	\
460	zpool		\
461	zlook		\
462	zonestat	\
463	zstreamdump	\
464	ztest
465
466$(CLOSED_BUILD)COMMON_SUBDIRS += \
467	$(CLOSED)/cmd/iconv	\
468	$(CLOSED)/cmd/ksh	\
469	$(CLOSED)/cmd/localedef	\
470	$(CLOSED)/cmd/more_xpg4	\
471	$(CLOSED)/cmd/mtst	\
472	$(CLOSED)/cmd/od	\
473	$(CLOSED)/cmd/patch	\
474	$(CLOSED)/cmd/pax	\
475	$(CLOSED)/cmd/printf	\
476	$(CLOSED)/cmd/sed	\
477	$(CLOSED)/cmd/sed_xpg4
478
479i386_SUBDIRS=		\
480	acpihpd		\
481	addbadsec	\
482	biosdev		\
483	diskscan	\
484	lms		\
485	ntfsprogs	\
486	parted		\
487	rtc		\
488	ucodeadm	\
489	xvm
490
491sparc_SUBDIRS=		\
492	cvcd		\
493	dcs		\
494	device_remap	\
495	drd		\
496	fps		\
497	fruadm		\
498	ldmad		\
499	oplhpd		\
500	prtdscp		\
501	prtfru		\
502	scadm		\
503	sckmd		\
504	sf880drd	\
505	virtinfo	\
506	vntsd
507
508#
509# Commands that are messaged.  Note that 'lp' and 'man' come first
510# (see previous comment about 'lp' and 'man').
511#
512MSGSUBDIRS=		\
513	lp		\
514	man		\
515	abi		\
516	acctadm		\
517	allocate	\
518	asa		\
519	audio		\
520	audit		\
521	auditconfig	\
522	auditd		\
523	auditrecord	\
524	auditset	\
525	auths		\
526	autopush	\
527	avs		\
528	awk		\
529	awk_xpg4	\
530	backup		\
531	banner		\
532	bart		\
533	basename	\
534	beadm		\
535	bnu		\
536	busstat		\
537	cal		\
538	cat		\
539	cdrw		\
540	cfgadm		\
541	checkeq		\
542	checknr		\
543	chgrp		\
544	chmod		\
545	chown		\
546	cmd-crypto	\
547	cmd-inet	\
548	col		\
549	compress	\
550	consadm		\
551	coreadm		\
552	cpio		\
553	cpc		\
554	cron		\
555	csh		\
556	csplit		\
557	ctrun		\
558	ctstat		\
559	ctwatch		\
560	datadm		\
561	date		\
562	dc		\
563	dcs		\
564	dd		\
565	deroff		\
566	devfsadm	\
567	dfs.cmds	\
568	diff		\
569	diffmk		\
570	dladm		\
571	dlstat		\
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	flowstat	\
587	fm		\
588	fold		\
589	fs.d		\
590	fwflash		\
591	geniconvtbl	\
592	genmsg		\
593	getconf		\
594	getent		\
595	gettext		\
596	gettxt		\
597	grep		\
598	grep_xpg4	\
599	grpck		\
600	gss		\
601	halt		\
602	head		\
603	hostname	\
604	hotplug		\
605	id		\
606	idmap		\
607	isaexec		\
608	iscsiadm	\
609	iscsid		\
610	isns		\
611	itadm		\
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	ls		\
626	luxadm		\
627	lvm		\
628	mailx		\
629	mesg		\
630	mkdir		\
631	mkpwdict	\
632	mktemp		\
633	more		\
634	mpathadm	\
635	msgfmt		\
636	mv		\
637	ndmpadm		\
638	ndmpstat	\
639	newgrp		\
640	newtask		\
641	nice		\
642	nohup		\
643	oawk		\
644	pack		\
645	passwd		\
646	passmgmt	\
647	pathchk		\
648	pfexec		\
649	pg		\
650	pgrep		\
651	picl            \
652	pools		\
653	power		\
654	pr		\
655	praudit		\
656	print		\
657	profiles	\
658	projadd		\
659	projects	\
660	prstat		\
661	prtdiag		\
662	ps		\
663	psrinfo		\
664	ptools		\
665	pwconv		\
666	pwd		\
667	pyzfs		\
668	raidctl		\
669	ramdiskadm	\
670	rcap		\
671	rcm_daemon	\
672	refer		\
673	regcmp		\
674	renice		\
675	roles		\
676	rm		\
677	rmdir		\
678	rmformat	\
679	rmmount		\
680	rmvolmgr	\
681	sasinfo		\
682	sbdadm		\
683	scadm		\
684	script		\
685	scsi		\
686	sdiff		\
687	sdpadm		\
688	sgs		\
689	sh		\
690	shcomp		\
691	smbsrv		\
692	sort		\
693	split		\
694	srptadm		\
695	ssh		\
696	stat		\
697	stmfadm		\
698	stmsboot	\
699	strings		\
700	su		\
701	svc		\
702	svr4pkg		\
703	swap		\
704	syseventadm	\
705	syseventd	\
706	tabs		\
707	tar		\
708	tbl		\
709	time		\
710	tnf		\
711	touch		\
712	tput		\
713	troff		\
714	tsol		\
715	tty		\
716	ttymon		\
717	tzreload	\
718	ul		\
719	uname		\
720	units		\
721	unlink		\
722	unpack		\
723	userattr	\
724	valtools	\
725	vgrind		\
726	vi		\
727	volcheck	\
728	volrmmount	\
729	vrrpadm		\
730	vscan		\
731	w		\
732	who		\
733	whodo		\
734	wracct		\
735	write		\
736	wusbadm		\
737	xargs		\
738	yppasswd	\
739	zdump		\
740	zfs		\
741	zic		\
742	zlogin		\
743	zoneadm		\
744	zoneadmd	\
745	zonecfg		\
746	zonename	\
747	zpool		\
748	zonestat
749
750$(CLOSED_BUILD)MSGSUBDIRS += \
751	$(CLOSED)/cmd/iconv	\
752	$(CLOSED)/cmd/ksh	\
753	$(CLOSED)/cmd/localedef	\
754	$(CLOSED)/cmd/more_xpg4	\
755	$(CLOSED)/cmd/od	\
756	$(CLOSED)/cmd/patch	\
757	$(CLOSED)/cmd/pax	\
758	$(CLOSED)/cmd/printf	\
759	$(CLOSED)/cmd/sed	\
760	$(CLOSED)/cmd/sed_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.
793#
794AUDITSUBDIRS=		\
795	amt		\
796	audit		\
797	audit_warn	\
798	auditconfig	\
799	auditd		\
800	auditrecord	\
801	auditreduce	\
802	auditset	\
803	auditstat	\
804	praudit
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