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