xref: /titanic_51/usr/src/cmd/Makefile (revision 9e0b7c70f4e1d65d875a8606e4c31052555392f3)
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	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	ul		\
713	uname		\
714	units		\
715	unlink		\
716	unpack		\
717	valtools	\
718	vgrind		\
719	vi		\
720	volcheck	\
721	volrmmount	\
722	vrrpadm		\
723	w		\
724	wbem		\
725	who		\
726	whodo		\
727	wracct		\
728	write		\
729	wusbadm		\
730	xargs		\
731	yppasswd	\
732	zdump		\
733	zfs		\
734	zic		\
735	zlogin		\
736	zoneadm		\
737	zoneadmd	\
738	zonecfg		\
739	zonename	\
740	zpool
741
742$(CLOSED_BUILD)MSGSUBDIRS += \
743	$(CLOSED)/cmd/iconv	\
744	$(CLOSED)/cmd/ksh	\
745	$(CLOSED)/cmd/llc2	\
746	$(CLOSED)/cmd/localedef	\
747	$(CLOSED)/cmd/more_xpg4	\
748	$(CLOSED)/cmd/od	\
749	$(CLOSED)/cmd/patch	\
750	$(CLOSED)/cmd/pax	\
751	$(CLOSED)/cmd/printf	\
752	$(CLOSED)/cmd/sed	\
753	$(CLOSED)/cmd/sed_xpg4	\
754	$(CLOSED)/cmd/tail	\
755	$(CLOSED)/cmd/tr_xpg4
756
757sparc_MSGSUBDIRS=	\
758	fruadm		\
759	prtdscp		\
760	prtfru		\
761	vntsd
762
763i386_MSGSUBDIRS=	\
764	ucodeadm
765
766#
767# commands that use dcgettext for localized time, LC_TIME
768#
769DCSUBDIRS=		\
770	cal		\
771	cfgadm		\
772	diff		\
773	ls		\
774	pr		\
775	ps		\
776	tar		\
777	w		\
778	who		\
779	whodo		\
780	write
781
782$(CLOSED_BUILD)DCSUBDIRS += \
783	$(CLOSED)/cmd/pax
784
785#
786# commands that belong only to audit and device allocation
787#
788AUDITSUBDIRS=		\
789	allocate	\
790	amt		\
791	audit		\
792	audit_warn	\
793	auditconfig	\
794	auditd		\
795	auditrecord	\
796	auditreduce	\
797	auditstat	\
798	praudit		\
799	bsmconv		\
800	bsmunconv
801
802#
803# commands not owned by the systems group
804#
805BWOSDIRS=
806
807
808all :=		TARGET = all
809install :=	TARGET = install
810clean :=	TARGET = clean
811clobber :=	TARGET = clobber
812lint :=		TARGET = lint
813_msg :=		TARGET = _msg
814_dc :=		TARGET = _dc
815
816.KEEP_STATE:
817
818SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
819
820.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
821
822all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
823	$(AUDITSUBDIRS)
824
825#
826# Manifests cannot be checked in parallel, because we are using
827# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
828# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
829# we spawn off a sub-make to perform the non-parallel 'make check'
830#
831check:
832	$(MAKE) -f Makefile.check check
833
834#
835# The .WAIT directive works around an apparent bug in parallel make.
836# Evidently make was getting the target _msg vs. _dc confused under
837# some level of parallelization, causing some of the _dc objects
838# not to be built.
839#
840_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
841
842_dc: $(DCSUBDIRS)
843
844#
845# Dependencies
846#
847fs.d: fstyp
848ksh:	shcomp isaexec
849print:	lp
850
851$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
852	@if [ -f $@/Makefile  ]; then \
853		cd $@; pwd; $(MAKE) $(TARGET); \
854	else \
855		true; \
856	fi
857
858FRC:
859