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