xref: /titanic_51/usr/src/cmd/Makefile (revision 7b3411b6ce9d5ba373d2e36a6c8db48b2dfb74b7)
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	ztest
465
466$(CLOSED_BUILD)COMMON_SUBDIRS += \
467	$(CLOSED)/cmd/iconv	\
468	$(CLOSED)/cmd/ksh	\
469	$(CLOSED)/cmd/llc2	\
470	$(CLOSED)/cmd/localedef	\
471	$(CLOSED)/cmd/more_xpg4	\
472	$(CLOSED)/cmd/mtst	\
473	$(CLOSED)/cmd/od	\
474	$(CLOSED)/cmd/patch	\
475	$(CLOSED)/cmd/pax	\
476	$(CLOSED)/cmd/printf	\
477	$(CLOSED)/cmd/sed	\
478	$(CLOSED)/cmd/sed_xpg4	\
479	$(CLOSED)/cmd/smartcard	\
480	$(CLOSED)/cmd/tail	\
481	$(CLOSED)/cmd/tr_xpg4
482
483i386_SUBDIRS=		\
484	addbadsec	\
485	biosdev		\
486	diskscan	\
487	lms		\
488	ntfsprogs	\
489	parted		\
490	rtc		\
491	ucodeadm	\
492	xvm
493
494sparc_SUBDIRS=		\
495	cvcd		\
496	dcs		\
497	device_remap	\
498	drd		\
499	fps		\
500	fruadm		\
501	oplhpd		\
502	prtdscp		\
503	prtfru		\
504	scadm		\
505	sckmd		\
506	sf880drd	\
507	vntsd
508
509#
510# Commands that are messaged.  Note that 'lp' and 'man' come first
511# (see previous comment about 'lp' and 'man').
512#
513MSGSUBDIRS=		\
514	lp		\
515	man		\
516	abi		\
517	acctadm		\
518	allocate	\
519	asa		\
520	audio		\
521	audit		\
522	auditd		\
523	auditrecord	\
524	auths		\
525	autopush	\
526	avs		\
527	awk		\
528	awk_xpg4	\
529	backup		\
530	banner		\
531	bart		\
532	basename	\
533	bnu		\
534	bsmconv		\
535	bsmunconv	\
536	busstat		\
537	cal		\
538	cat		\
539	cdrw		\
540	cfgadm		\
541	checkeq		\
542	checknr		\
543	chgrp		\
544	chmod		\
545	chown		\
546	cksum		\
547	cmd-crypto	\
548	cmd-inet	\
549	cmp		\
550	col		\
551	comm		\
552	compress	\
553	consadm		\
554	coreadm		\
555	cpio		\
556	cpc		\
557	cron		\
558	csh		\
559	csplit		\
560	ctrun		\
561	ctstat		\
562	ctwatch		\
563	cut		\
564	datadm		\
565	date		\
566	dc		\
567	dcs		\
568	dd		\
569	deroff		\
570	devfsadm	\
571	dfs.cmds	\
572	diff		\
573	diffmk		\
574	dladm		\
575	du		\
576	dumpcs		\
577	ed		\
578	eject		\
579	env		\
580	eqn		\
581	expand		\
582	expr		\
583	fcinfo		\
584	fgrep		\
585	file		\
586	filesync	\
587	find		\
588	flowadm		\
589	fm		\
590	fold		\
591	fs.d		\
592	fwflash		\
593	geniconvtbl	\
594	genmsg		\
595	getconf		\
596	getent		\
597	gettext		\
598	gettxt		\
599	grep		\
600	grep_xpg4	\
601	grpck		\
602	gss		\
603	halt		\
604	head		\
605	hostname	\
606	id		\
607	idmap		\
608	isaexec		\
609	iscsi		\
610	iscsiadm	\
611	iscsid		\
612	isns		\
613	itadm		\
614	join		\
615	kbd		\
616	krb5		\
617	ksh		\
618	kstat		\
619	last		\
620	ldap		\
621	ldapcachemgr	\
622	lgrpinfo	\
623	locale		\
624	lofiadm		\
625	logadm		\
626	logger		\
627	logins		\
628	logname		\
629	ls		\
630	luxadm		\
631	lvm		\
632	mailx		\
633	mesg		\
634	mkdir		\
635	mkpwdict	\
636	mktemp		\
637	more		\
638	mpathadm	\
639	msgfmt		\
640	mv		\
641	ndmpadm		\
642	ndmpstat	\
643	newgrp		\
644	newtask		\
645	nice		\
646	nispasswd	\
647	nohup		\
648	oawk		\
649	pack		\
650	passwd		\
651	passmgmt	\
652	paste		\
653	pathchk		\
654	pfexec		\
655	pg		\
656	pgrep		\
657	picl            \
658	pools		\
659	power		\
660	pr		\
661	praudit		\
662	print		\
663	profiles	\
664	projadd		\
665	projects	\
666	prstat		\
667	prtdiag		\
668	ps		\
669	psrinfo		\
670	ptools		\
671	pwconv		\
672	pwd		\
673	pyzfs		\
674	raidctl		\
675	ramdiskadm	\
676	rcap		\
677	rcm_daemon	\
678	refer		\
679	regcmp		\
680	renice		\
681	roles		\
682	rm		\
683	rmdir		\
684	rmformat	\
685	rmmount		\
686	rmvolmgr	\
687	sbdadm		\
688	scadm		\
689	script		\
690	scsi		\
691	sdiff		\
692	sdpadm		\
693	sgs		\
694	sh		\
695	shcomp		\
696	sort		\
697	split		\
698	ssh		\
699	stat		\
700	stmfadm		\
701	stmsboot	\
702	strings		\
703	su		\
704	svc		\
705	svr4pkg		\
706	swap		\
707	syseventadm	\
708	syseventd	\
709	tabs		\
710	tar		\
711	tbl		\
712	tee		\
713	time		\
714	tnf		\
715	touch		\
716	tput		\
717	troff		\
718	tsol		\
719	tty		\
720	ttymon		\
721	ul		\
722	uname		\
723	uniq		\
724	units		\
725	unlink		\
726	unpack		\
727	valtools	\
728	vgrind		\
729	vi		\
730	volcheck	\
731	volrmmount	\
732	w		\
733	wbem		\
734	wc		\
735	who		\
736	whodo		\
737	wracct		\
738	write		\
739	wusbadm		\
740	xargs		\
741	yppasswd	\
742	zdump		\
743	zfs		\
744	zic		\
745	zlogin		\
746	zoneadm		\
747	zoneadmd	\
748	zonecfg		\
749	zonename	\
750	zpool
751
752$(CLOSED_BUILD)MSGSUBDIRS += \
753	$(CLOSED)/cmd/iconv	\
754	$(CLOSED)/cmd/ksh	\
755	$(CLOSED)/cmd/llc2	\
756	$(CLOSED)/cmd/localedef	\
757	$(CLOSED)/cmd/more_xpg4	\
758	$(CLOSED)/cmd/od	\
759	$(CLOSED)/cmd/patch	\
760	$(CLOSED)/cmd/pax	\
761	$(CLOSED)/cmd/printf	\
762	$(CLOSED)/cmd/sed	\
763	$(CLOSED)/cmd/sed_xpg4	\
764	$(CLOSED)/cmd/tail	\
765	$(CLOSED)/cmd/tr_xpg4
766
767sparc_MSGSUBDIRS=	\
768	fruadm		\
769	prtdscp		\
770	prtfru		\
771	vntsd
772
773i386_MSGSUBDIRS=	\
774	ucodeadm
775
776#
777# commands that use dcgettext for localized time, LC_TIME
778#
779DCSUBDIRS=		\
780	cal		\
781	cfgadm		\
782	diff		\
783	ls		\
784	pr		\
785	ps		\
786	tar		\
787	w		\
788	who		\
789	whodo		\
790	write
791
792$(CLOSED_BUILD)DCSUBDIRS += \
793	$(CLOSED)/cmd/pax
794
795#
796# commands that belong only to audit and device allocation
797#
798AUDITSUBDIRS=		\
799	allocate	\
800	amt		\
801	audit		\
802	audit_warn	\
803	auditconfig	\
804	auditd		\
805	auditrecord	\
806	auditreduce	\
807	auditstat	\
808	praudit		\
809	bsmconv		\
810	bsmunconv
811
812#
813# commands not owned by the systems group
814#
815BWOSDIRS=
816
817
818all :=		TARGET = all
819install :=	TARGET = install
820clean :=	TARGET = clean
821clobber :=	TARGET = clobber
822lint :=		TARGET = lint
823_msg :=		TARGET = _msg
824_dc :=		TARGET = _dc
825
826.KEEP_STATE:
827
828SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
829
830.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
831
832all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
833	$(AUDITSUBDIRS)
834
835#
836# Manifests cannot be checked in parallel, because we are using
837# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
838# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
839# we spawn off a sub-make to perform the non-parallel 'make check'
840#
841check:
842	$(MAKE) -f Makefile.check check
843
844#
845# The .WAIT directive works around an apparent bug in parallel make.
846# Evidently make was getting the target _msg vs. _dc confused under
847# some level of parallelization, causing some of the _dc objects
848# not to be built.
849#
850_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
851
852_dc: $(DCSUBDIRS)
853
854#
855# Dependencies
856#
857fs.d: fstyp
858ksh:	shcomp isaexec
859print:	lp
860
861$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
862	@if [ -f $@/Makefile  ]; then \
863		cd $@; pwd; $(MAKE) $(TARGET); \
864	else \
865		true; \
866	fi
867
868FRC:
869