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