xref: /titanic_44/usr/src/cmd/Makefile (revision 1cfa752f4e24c34133009b0f6c139127a5c461de)
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#
24
25include ../Makefile.master
26
27#
28#	Note that the commands 'agents', 'lp', 'perl', and 'man' are first in
29#	the list, violating alphabetical order.  This is because they are very
30#	long-running and should be given the most wall-clock time for a
31#	parallel build.
32#
33#	Commands in the FIRST_SUBDIRS list are built before starting the build
34#	of other commands.  Currently this includes only 'isaexec' and
35#	'platexec'.  This is necessary because $(ROOT)/usr/lib/isaexec or
36#	$(ROOT)/usr/lib/platexec must exist when some other commands are built
37#	because their 'make install' creates a hard link to one of them.
38#
39#	Commands are listed one per line so that TeamWare can auto-merge most
40#	changes.
41#
42
43FIRST_SUBDIRS=		\
44	isaexec		\
45	platexec
46
47COMMON_SUBDIRS=		\
48	agents		\
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	bfs		\
74	bnu		\
75	boot		\
76	busstat		\
77	cal		\
78	calendar	\
79	captoinfo	\
80	cat		\
81	cdrw		\
82	cfgadm		\
83	checkeq		\
84	checknr		\
85	chgrp		\
86	chmod		\
87	chown		\
88	chroot		\
89	clear		\
90	clinfo		\
91	cmd-crypto	\
92	cmd-inet	\
93	col		\
94	compress	\
95	consadm		\
96	coreadm		\
97	cpio		\
98	cpc		\
99	cron		\
100	crypt		\
101	csh		\
102	csplit		\
103	ctrun		\
104	ctstat		\
105	ctwatch		\
106	datadm		\
107	date		\
108	dc		\
109	dd		\
110	deroff		\
111	des		\
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	fmli		\
163	fmt		\
164	fmthard		\
165	fmtmsg		\
166	fold		\
167	format		\
168	fs.d		\
169	fstyp		\
170	fuser		\
171	fwflash		\
172	gcore		\
173	gencat		\
174	geniconvtbl	\
175	genmsg		\
176	getconf		\
177	getdevpolicy	\
178	getent		\
179	getfacl		\
180	getmajor	\
181	getopt		\
182	gettext		\
183	gettxt		\
184	graph		\
185	grep		\
186	grep_xpg4	\
187	groups		\
188	grpck		\
189	gss		\
190	hal		\
191	halt		\
192	head		\
193	hostid		\
194	hostname	\
195	hotplug		\
196	hotplugd	\
197	hwdata		\
198	ibd_upgrade	\
199	id		\
200	idmap		\
201	infocmp		\
202	init		\
203	initpkg		\
204	install.d	\
205	intrd		\
206	intrstat	\
207	ipcrm		\
208	ipcs		\
209	ipf		\
210	isainfo		\
211	isalist		\
212	itutools	\
213	iscsiadm	\
214	iscsid		\
215	iscsitsvc	\
216	isns		\
217	itadm		\
218	java		\
219	kbd		\
220	keyserv		\
221	killall		\
222	krb5		\
223	ksh		\
224	kstat		\
225	last		\
226	lastcomm	\
227	latencytop	\
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	look		\
245	ls		\
246	luxadm		\
247	lvm		\
248	mach		\
249	machid		\
250	mail		\
251	mailx		\
252	makekey		\
253	mdb		\
254	mesg		\
255	mkdir		\
256	mkfifo		\
257	mkfile		\
258	mkmsgs		\
259	mknod		\
260	mkpwdict	\
261	mktemp		\
262	mms		\
263	modload		\
264	more		\
265	mpathadm	\
266	msgfmt		\
267	msgid		\
268	mt		\
269	mv		\
270	mvdir		\
271	ndmpadm		\
272	ndmpd		\
273	ndmpstat	\
274	netadm		\
275	netfiles	\
276	newform		\
277	newgrp		\
278	news		\
279	newtask		\
280	nice		\
281	nl		\
282	nlsadmin	\
283	nohup		\
284	nsadmin		\
285	nscd		\
286	oamuser		\
287	oawk		\
288	pack		\
289	pagesize	\
290	passmgmt	\
291	passwd		\
292	pathchk		\
293	pbind		\
294	pcidr		\
295	pcitool		\
296	pfexec		\
297	pgrep		\
298	picl		\
299	plimit		\
300	policykit	\
301	pools		\
302	power		\
303	powertop	\
304	ppgsz		\
305	pg		\
306	plockstat	\
307	pr		\
308	prctl		\
309	print		\
310	priocntl	\
311	profiles	\
312	projadd		\
313	projects	\
314	prstat		\
315	prtconf		\
316	prtdiag		\
317	prtvtoc		\
318	ps		\
319	psradm		\
320	psrinfo		\
321	psrset		\
322	ptools		\
323	pwck		\
324	pwconv		\
325	pwd		\
326	pyzfs		\
327	raidctl		\
328	ramdiskadm	\
329	rcap		\
330	rcm_daemon	\
331	rctladm		\
332	refer		\
333	regcmp		\
334	renice		\
335	rexd		\
336	rm		\
337	rmdir		\
338	rmformat	\
339	rmmount		\
340	rmt		\
341	rmvolmgr	\
342	roles		\
343	rpcbind		\
344	rpcgen		\
345	rpcinfo		\
346	rpcsvc		\
347	runat		\
348	sa		\
349	saf		\
350	sasinfo		\
351	savecore	\
352	sbdadm		\
353	script		\
354	scsi		\
355	sdiff		\
356	sdpadm		\
357	sendmail	\
358	setfacl		\
359	setmnt		\
360	setpgrp		\
361	setuname	\
362	sgs		\
363	sh		\
364	shcomp		\
365	smbios		\
366	smbsrv		\
367	smserverd	\
368	soelim		\
369	sort		\
370	spell		\
371	spline		\
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	tar		\
397	tbl		\
398	tcopy		\
399	tcpd		\
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	tzreload	\
417	uadmin		\
418	ul		\
419	uname		\
420	units		\
421	unlink		\
422	unpack		\
423	users		\
424	utmp_update	\
425	utmpd		\
426	valtools	\
427	vgrind		\
428	vi		\
429	volcheck	\
430	volrmmount	\
431	vrrpadm		\
432	vscan		\
433	vt		\
434	w		\
435	wall		\
436	wbem		\
437	which		\
438	who		\
439	whodo		\
440	wracct		\
441	write		\
442	wusbadm		\
443	xargs		\
444	xstr		\
445	yes		\
446	ypcmd		\
447	yppasswd	\
448	zdb		\
449	zdump		\
450	zfs		\
451	zic		\
452	zinject		\
453	zlogin		\
454	zoneadm		\
455	zoneadmd	\
456	zonecfg		\
457	zonename	\
458	zpool		\
459	zlook		\
460	zstreamdump	\
461	ztest
462
463$(CLOSED_BUILD)COMMON_SUBDIRS += \
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/printf	\
474	$(CLOSED)/cmd/sed	\
475	$(CLOSED)/cmd/sed_xpg4	\
476ODE	$(CLOSED)/cmd/tail	\
477	$(CLOSED)/cmd/tr_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	auditd		\
522	auditrecord	\
523	auths		\
524	autopush	\
525	avs		\
526	awk		\
527	awk_xpg4	\
528	backup		\
529	banner		\
530	bart		\
531	basename	\
532	bnu		\
533	bsmconv		\
534	bsmunconv	\
535	busstat		\
536	cal		\
537	cat		\
538	cdrw		\
539	cfgadm		\
540	checkeq		\
541	checknr		\
542	chgrp		\
543	chmod		\
544	chown		\
545	cmd-crypto	\
546	cmd-inet	\
547	col		\
548	compress	\
549	consadm		\
550	coreadm		\
551	cpio		\
552	cpc		\
553	cron		\
554	csh		\
555	csplit		\
556	ctrun		\
557	ctstat		\
558	ctwatch		\
559	datadm		\
560	date		\
561	dc		\
562	dcs		\
563	dd		\
564	deroff		\
565	devfsadm	\
566	dfs.cmds	\
567	diff		\
568	diffmk		\
569	dladm		\
570	dlstat		\
571	du		\
572	dumpcs		\
573	ed		\
574	eject		\
575	env		\
576	eqn		\
577	expand		\
578	expr		\
579	fcinfo		\
580	fgrep		\
581	file		\
582	filesync	\
583	find		\
584	flowadm		\
585	flowstat	\
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	hotplug		\
604	id		\
605	idmap		\
606	isaexec		\
607	iscsiadm	\
608	iscsid		\
609	isns		\
610	itadm		\
611	kbd		\
612	krb5		\
613	ksh		\
614	kstat		\
615	last		\
616	ldap		\
617	ldapcachemgr	\
618	lgrpinfo	\
619	locale		\
620	lofiadm		\
621	logadm		\
622	logger		\
623	logins		\
624	ls		\
625	luxadm		\
626	lvm		\
627	mailx		\
628	mesg		\
629	mkdir		\
630	mkpwdict	\
631	mktemp		\
632	more		\
633	mpathadm	\
634	msgfmt		\
635	mv		\
636	ndmpadm		\
637	ndmpstat	\
638	newgrp		\
639	newtask		\
640	nice		\
641	nohup		\
642	oawk		\
643	pack		\
644	passwd		\
645	passmgmt	\
646	pathchk		\
647	pfexec		\
648	pg		\
649	pgrep		\
650	picl            \
651	pools		\
652	power		\
653	pr		\
654	praudit		\
655	print		\
656	profiles	\
657	projadd		\
658	projects	\
659	prstat		\
660	prtdiag		\
661	ps		\
662	psrinfo		\
663	ptools		\
664	pwconv		\
665	pwd		\
666	pyzfs		\
667	raidctl		\
668	ramdiskadm	\
669	rcap		\
670	rcm_daemon	\
671	refer		\
672	regcmp		\
673	renice		\
674	roles		\
675	rm		\
676	rmdir		\
677	rmformat	\
678	rmmount		\
679	rmvolmgr	\
680	sasinfo		\
681	sbdadm		\
682	scadm		\
683	script		\
684	scsi		\
685	sdiff		\
686	sdpadm		\
687	sgs		\
688	sh		\
689	shcomp		\
690	smbsrv		\
691	sort		\
692	split		\
693	srptadm		\
694	ssh		\
695	stat		\
696	stmfadm		\
697	stmsboot	\
698	strings		\
699	su		\
700	svc		\
701	svr4pkg		\
702	swap		\
703	syseventadm	\
704	syseventd	\
705	tabs		\
706	tar		\
707	tbl		\
708	time		\
709	tnf		\
710	touch		\
711	tput		\
712	troff		\
713	tsol		\
714	tty		\
715	ttymon		\
716	tzreload	\
717	ul		\
718	uname		\
719	units		\
720	unlink		\
721	unpack		\
722	valtools	\
723	vgrind		\
724	vi		\
725	volcheck	\
726	volrmmount	\
727	vrrpadm		\
728	vscan		\
729	w		\
730	wbem		\
731	who		\
732	whodo		\
733	wracct		\
734	write		\
735	wusbadm		\
736	xargs		\
737	yppasswd	\
738	zdump		\
739	zfs		\
740	zic		\
741	zlogin		\
742	zoneadm		\
743	zoneadmd	\
744	zonecfg		\
745	zonename	\
746	zpool
747
748$(CLOSED_BUILD)MSGSUBDIRS += \
749	$(CLOSED)/cmd/iconv	\
750	$(CLOSED)/cmd/ksh	\
751	$(CLOSED)/cmd/llc2	\
752	$(CLOSED)/cmd/localedef	\
753	$(CLOSED)/cmd/more_xpg4	\
754	$(CLOSED)/cmd/od	\
755	$(CLOSED)/cmd/patch	\
756	$(CLOSED)/cmd/pax	\
757	$(CLOSED)/cmd/printf	\
758	$(CLOSED)/cmd/sed	\
759	$(CLOSED)/cmd/sed_xpg4	\
760	$(CLOSED)/cmd/tail	\
761	$(CLOSED)/cmd/tr_xpg4
762
763sparc_MSGSUBDIRS=	\
764	fruadm		\
765	prtdscp		\
766	prtfru		\
767	virtinfo	\
768	vntsd
769
770i386_MSGSUBDIRS=	\
771	ucodeadm
772
773#
774# commands that use dcgettext for localized time, LC_TIME
775#
776DCSUBDIRS=		\
777	cal		\
778	cfgadm		\
779	diff		\
780	ls		\
781	pr		\
782	ps		\
783	tar		\
784	w		\
785	who		\
786	whodo		\
787	write
788
789$(CLOSED_BUILD)DCSUBDIRS += \
790	$(CLOSED)/cmd/pax
791
792#
793# commands that belong only to audit and device allocation
794#
795AUDITSUBDIRS=		\
796	allocate	\
797	amt		\
798	audit		\
799	audit_warn	\
800	auditconfig	\
801	auditd		\
802	auditrecord	\
803	auditreduce	\
804	auditstat	\
805	praudit		\
806	bsmconv		\
807	bsmunconv
808
809#
810# commands not owned by the systems group
811#
812BWOSDIRS=
813
814
815all :=		TARGET = all
816install :=	TARGET = install
817clean :=	TARGET = clean
818clobber :=	TARGET = clobber
819lint :=		TARGET = lint
820_msg :=		TARGET = _msg
821_dc :=		TARGET = _dc
822
823.KEEP_STATE:
824
825SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
826
827.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
828
829all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
830	$(AUDITSUBDIRS)
831
832#
833# Manifests cannot be checked in parallel, because we are using
834# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
835# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
836# we spawn off a sub-make to perform the non-parallel 'make check'
837#
838check:
839	$(MAKE) -f Makefile.check check
840
841#
842# The .WAIT directive works around an apparent bug in parallel make.
843# Evidently make was getting the target _msg vs. _dc confused under
844# some level of parallelization, causing some of the _dc objects
845# not to be built.
846#
847_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
848
849_dc: $(DCSUBDIRS)
850
851#
852# Dependencies
853#
854fs.d: fstyp
855ksh:	shcomp isaexec
856print:	lp
857
858$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
859	@if [ -f $@/Makefile  ]; then \
860		cd $@; pwd; $(MAKE) $(TARGET); \
861	else \
862		true; \
863	fi
864
865FRC:
866