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