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