xref: /titanic_51/usr/src/cmd/Makefile (revision f899e5733f35e45012ad40c8325b2622dcc2b673)
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	ldap		\
231	ldapcachemgr	\
232	lgrpinfo	\
233	line		\
234	link		\
235	dlmgmtd		\
236	listen		\
237	loadkeys	\
238	locale		\
239	lockstat	\
240	locator		\
241	lofiadm		\
242	logadm		\
243	logger		\
244	login		\
245	logins		\
246	logname		\
247	look		\
248	ls		\
249	luxadm		\
250	lvm		\
251	mach		\
252	machid		\
253	mail		\
254	mailx		\
255	makekey		\
256	mdb		\
257	mesg		\
258	mkdir		\
259	mkfifo		\
260	mkfile		\
261	mkmsgs		\
262	mknod		\
263	mkpwdict	\
264	mktemp		\
265	mms		\
266	modload		\
267	more		\
268	mpathadm	\
269	msgfmt		\
270	msgid		\
271	mt		\
272	mv		\
273	mvdir		\
274	ndmpadm		\
275	ndmpd		\
276	ndmpstat	\
277	netadm		\
278	netfiles	\
279	newform		\
280	newgrp		\
281	news		\
282	newtask		\
283	nice		\
284	nispasswd	\
285	nl		\
286	nlsadmin	\
287	nohup		\
288	nsadmin		\
289	nscd		\
290	oamuser		\
291	oawk		\
292	pack		\
293	pagesize	\
294	passmgmt	\
295	passwd		\
296	paste		\
297	pathchk		\
298	pbind		\
299	pcidr		\
300	pcitool		\
301	pcmciad		\
302	pfexec		\
303	pgrep		\
304	picl		\
305	plimit		\
306	policykit	\
307	pools		\
308	power		\
309	powertop	\
310	ppgsz		\
311	pg		\
312	plockstat	\
313	pr		\
314	prctl		\
315	print		\
316	priocntl	\
317	profiles	\
318	projadd		\
319	projects	\
320	prstat		\
321	prtconf		\
322	prtdiag		\
323	prtvtoc		\
324	ps		\
325	psradm		\
326	psrinfo		\
327	psrset		\
328	ptools		\
329	pwck		\
330	pwconv		\
331	pwd		\
332	pyzfs		\
333	raidctl		\
334	ramdiskadm	\
335	rcap		\
336	rcm_daemon	\
337	rctladm		\
338	refer		\
339	regcmp		\
340	renice		\
341	rexd		\
342	rm		\
343	rmdir		\
344	rmformat	\
345	rmmount		\
346	rmt		\
347	rmvolmgr	\
348	roles		\
349	rpcbind		\
350	rpcgen		\
351	rpcinfo		\
352	rpcsvc		\
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	volcheck	\
434	volrmmount	\
435	vscan		\
436	vt		\
437	w		\
438	wall		\
439	wbem		\
440	wc		\
441	which		\
442	who		\
443	whodo		\
444	wracct		\
445	write		\
446	wusbadm		\
447	xargs		\
448	xstr		\
449	yes		\
450	ypcmd		\
451	yppasswd	\
452	zdb		\
453	zdump		\
454	zfs		\
455	zic		\
456	zinject		\
457	zlogin		\
458	zoneadm		\
459	zoneadmd	\
460	zonecfg		\
461	zonename	\
462	zpool		\
463	zlook		\
464	zstreamdump	\
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	parted		\
491	rtc		\
492	ucodeadm	\
493	xvm
494
495sparc_SUBDIRS=		\
496	cvcd		\
497	dcs		\
498	device_remap	\
499	drd		\
500	fps		\
501	fruadm		\
502	ldmad		\
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