xref: /titanic_50/usr/src/cmd/Makefile (revision a69116193464f859a8b27a2db19ad330ce163a55)
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 (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
23
24include ../Makefile.master
25
26#
27#	Note that the commands 'agents', 'lp', 'perl', and 'man' are first in
28#	the list, violating alphabetical order.  This is because they are very
29#	long-running and should be given the most wall-clock time for a
30#	parallel build.
31#
32#	Commands in the FIRST_SUBDIRS list are built before starting the build
33#	of other commands.  Currently this includes only 'isaexec' and
34#	'platexec'.  This is necessary because $(ROOT)/usr/lib/isaexec or
35#	$(ROOT)/usr/lib/platexec must exist when some other commands are built
36#	because their 'make install' creates a hard link to one of them.
37#
38#	Commands are listed one per line so that TeamWare can auto-merge most
39#	changes.
40#
41
42FIRST_SUBDIRS=		\
43	isaexec		\
44	platexec
45
46COMMON_SUBDIRS=		\
47	agents		\
48	allocate	\
49	availdevs	\
50	lp		\
51	perl		\
52	man		\
53	Adm		\
54	abi		\
55	adbgen		\
56	acct		\
57	acctadm		\
58	arch		\
59	asa		\
60	ast		\
61	audio		\
62	auths		\
63	autopush	\
64	avs		\
65	awk		\
66	awk_xpg4	\
67	backup		\
68	banner		\
69	bart		\
70	basename	\
71	bc		\
72	bdiff		\
73	beadm		\
74	bfs		\
75	bnu		\
76	boot		\
77	busstat		\
78	cal		\
79	calendar	\
80	captoinfo	\
81	cat		\
82	cdrw		\
83	cfgadm		\
84	checkeq		\
85	checknr		\
86	chgrp		\
87	chmod		\
88	chown		\
89	chroot		\
90	clear		\
91	clinfo		\
92	cmd-crypto	\
93	cmd-inet	\
94	col		\
95	compress	\
96	consadm		\
97	coreadm		\
98	cpio		\
99	cpc		\
100	cron		\
101	crypt		\
102	csh		\
103	csplit		\
104	ctrun		\
105	ctstat		\
106	ctwatch		\
107	datadm		\
108	date		\
109	dc		\
110	dd		\
111	deroff		\
112	des		\
113	devfsadm	\
114	syseventd	\
115	devctl		\
116	devinfo		\
117	devmgmt		\
118	devprop		\
119	dfs.cmds	\
120	diff		\
121	diff3		\
122	diffmk		\
123	dircmp		\
124	dirname		\
125	dis		\
126	diskmgtd	\
127	dispadmin	\
128	dladm		\
129	dlstat		\
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	flowstat	\
162	fm		\
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	grep		\
185	grep_xpg4	\
186	groups		\
187	grpck		\
188	gss		\
189	hal		\
190	halt		\
191	head		\
192	hostid		\
193	hostname	\
194	hotplug		\
195	hotplugd	\
196	hwdata		\
197	ibd_upgrade	\
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	itutools	\
212	iscsiadm	\
213	iscsid		\
214	iscsitsvc	\
215	isns		\
216	itadm		\
217	java		\
218	kbd		\
219	keyserv		\
220	killall		\
221	krb5		\
222	ksh		\
223	kstat		\
224	last		\
225	lastcomm	\
226	latencytop	\
227	ldap		\
228	ldapcachemgr	\
229	lgrpinfo	\
230	line		\
231	link		\
232	dlmgmtd		\
233	listen		\
234	loadkeys	\
235	locale		\
236	lockstat	\
237	locator		\
238	lofiadm		\
239	logadm		\
240	logger		\
241	login		\
242	logins		\
243	look		\
244	ls		\
245	luxadm		\
246	lvm		\
247	mach		\
248	machid		\
249	mail		\
250	mailx		\
251	makekey		\
252	mdb		\
253	mesg		\
254	mkdir		\
255	mkfifo		\
256	mkfile		\
257	mkmsgs		\
258	mknod		\
259	mkpwdict	\
260	mktemp		\
261	modload		\
262	more		\
263	mpathadm	\
264	msgfmt		\
265	msgid		\
266	mt		\
267	mv		\
268	mvdir		\
269	ndmpadm		\
270	ndmpd		\
271	ndmpstat	\
272	netadm		\
273	netfiles	\
274	newform		\
275	newgrp		\
276	news		\
277	newtask		\
278	nice		\
279	nl		\
280	nlsadmin	\
281	nohup		\
282	nsadmin		\
283	nscd		\
284	oamuser		\
285	oawk		\
286	pack		\
287	pagesize	\
288	passmgmt	\
289	passwd		\
290	pathchk		\
291	pbind		\
292	pcidr		\
293	pcitool		\
294	pfexec		\
295	pfexecd		\
296	pgrep		\
297	picl		\
298	plimit		\
299	policykit	\
300	pools		\
301	power		\
302	powertop	\
303	ppgsz		\
304	pg		\
305	plockstat	\
306	pr		\
307	prctl		\
308	print		\
309	priocntl	\
310	profiles	\
311	projadd		\
312	projects	\
313	prstat		\
314	prtconf		\
315	prtdiag		\
316	prtvtoc		\
317	ps		\
318	psradm		\
319	psrinfo		\
320	psrset		\
321	ptools		\
322	pwck		\
323	pwconv		\
324	pwd		\
325	pyzfs		\
326	raidctl		\
327	ramdiskadm	\
328	rcap		\
329	rcm_daemon	\
330	rctladm		\
331	refer		\
332	regcmp		\
333	renice		\
334	rexd		\
335	rm		\
336	rmdir		\
337	rmformat	\
338	rmmount		\
339	rmt		\
340	rmvolmgr	\
341	roles		\
342	rpcbind		\
343	rpcgen		\
344	rpcinfo		\
345	rpcsvc		\
346	runat		\
347	sa		\
348	saf		\
349	sasinfo		\
350	savecore	\
351	sbdadm		\
352	script		\
353	scsi		\
354	sdiff		\
355	sdpadm		\
356	sendmail	\
357	setfacl		\
358	setmnt		\
359	setpgrp		\
360	setuname	\
361	sgs		\
362	sh		\
363	shcomp		\
364	smbios		\
365	smbsrv		\
366	smserverd	\
367	soelim		\
368	sort		\
369	spell		\
370	split		\
371	sqlite		\
372	srchtxt		\
373	srptadm		\
374	srptsvc		\
375	ssh		\
376	stat		\
377	stmfadm		\
378	stmfproxy	\
379	stmfsvc		\
380	stmsboot	\
381	streams		\
382	strings		\
383	su		\
384	sulogin		\
385	sunpc		\
386	svc		\
387	svr4pkg		\
388	swap		\
389	sync		\
390	sysdef		\
391	syseventadm	\
392	syslogd		\
393	tabs		\
394	tar		\
395	tbl		\
396	tcopy		\
397	tcpd		\
398	terminfo	\
399	th_tools	\
400	tic		\
401	time		\
402	tip		\
403	tnf		\
404	touch		\
405	tplot		\
406	tput		\
407	trapstat	\
408	troff		\
409	true		\
410	truss		\
411	tsol		\
412	tty		\
413	ttymon		\
414	tzreload	\
415	uadmin		\
416	ul		\
417	uname		\
418	units		\
419	unlink		\
420	unpack		\
421	userattr	\
422	users		\
423	utmp_update	\
424	utmpd		\
425	valtools	\
426	vgrind		\
427	vi		\
428	volcheck	\
429	volrmmount	\
430	vrrpadm		\
431	vscan		\
432	vt		\
433	w		\
434	wall		\
435	wbem		\
436	which		\
437	who		\
438	whodo		\
439	wracct		\
440	write		\
441	wusbadm		\
442	xargs		\
443	xstr		\
444	yes		\
445	ypcmd		\
446	yppasswd	\
447	zdb		\
448	zdump		\
449	zfs		\
450	zic		\
451	zinject		\
452	zlogin		\
453	zoneadm		\
454	zoneadmd	\
455	zonecfg		\
456	zonename	\
457	zpool		\
458	zlook		\
459	zstreamdump	\
460	ztest
461
462$(CLOSED_BUILD)COMMON_SUBDIRS += \
463	$(CLOSED)/cmd/iconv	\
464	$(CLOSED)/cmd/ksh	\
465	$(CLOSED)/cmd/llc2	\
466	$(CLOSED)/cmd/localedef	\
467	$(CLOSED)/cmd/more_xpg4	\
468	$(CLOSED)/cmd/mtst	\
469	$(CLOSED)/cmd/od	\
470	$(CLOSED)/cmd/patch	\
471	$(CLOSED)/cmd/pax	\
472	$(CLOSED)/cmd/printf	\
473	$(CLOSED)/cmd/sed	\
474	$(CLOSED)/cmd/sed_xpg4	\
475	$(CLOSED)/cmd/tail	\
476	$(CLOSED)/cmd/tr_xpg4
477
478i386_SUBDIRS=		\
479	acpihpd		\
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	virtinfo	\
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	auditconfig	\
521	auditd		\
522	auditrecord	\
523	auditset	\
524	auths		\
525	autopush	\
526	avs		\
527	awk		\
528	awk_xpg4	\
529	backup		\
530	banner		\
531	bart		\
532	basename	\
533	beadm		\
534	bnu		\
535	busstat		\
536	cal		\
537	cat		\
538	cdrw		\
539	cfgadm		\
540	checkeq		\
541	checknr		\
542	chgrp		\
543	chmod		\
544	chown		\
545	cmd-crypto	\
546	cmd-inet	\
547	col		\
548	compress	\
549	consadm		\
550	coreadm		\
551	cpio		\
552	cpc		\
553	cron		\
554	csh		\
555	csplit		\
556	ctrun		\
557	ctstat		\
558	ctwatch		\
559	datadm		\
560	date		\
561	dc		\
562	dcs		\
563	dd		\
564	deroff		\
565	devfsadm	\
566	dfs.cmds	\
567	diff		\
568	diffmk		\
569	dladm		\
570	dlstat		\
571	du		\
572	dumpcs		\
573	ed		\
574	eject		\
575	env		\
576	eqn		\
577	expand		\
578	expr		\
579	fcinfo		\
580	fgrep		\
581	file		\
582	filesync	\
583	find		\
584	flowadm		\
585	flowstat	\
586	fm		\
587	fold		\
588	fs.d		\
589	fwflash		\
590	geniconvtbl	\
591	genmsg		\
592	getconf		\
593	getent		\
594	gettext		\
595	gettxt		\
596	grep		\
597	grep_xpg4	\
598	grpck		\
599	gss		\
600	halt		\
601	head		\
602	hostname	\
603	hotplug		\
604	id		\
605	idmap		\
606	isaexec		\
607	iscsiadm	\
608	iscsid		\
609	isns		\
610	itadm		\
611	kbd		\
612	krb5		\
613	ksh		\
614	kstat		\
615	last		\
616	ldap		\
617	ldapcachemgr	\
618	lgrpinfo	\
619	locale		\
620	lofiadm		\
621	logadm		\
622	logger		\
623	logins		\
624	ls		\
625	luxadm		\
626	lvm		\
627	mailx		\
628	mesg		\
629	mkdir		\
630	mkpwdict	\
631	mktemp		\
632	more		\
633	mpathadm	\
634	msgfmt		\
635	mv		\
636	ndmpadm		\
637	ndmpstat	\
638	newgrp		\
639	newtask		\
640	nice		\
641	nohup		\
642	oawk		\
643	pack		\
644	passwd		\
645	passmgmt	\
646	pathchk		\
647	pfexec		\
648	pg		\
649	pgrep		\
650	picl            \
651	pools		\
652	power		\
653	pr		\
654	praudit		\
655	print		\
656	profiles	\
657	projadd		\
658	projects	\
659	prstat		\
660	prtdiag		\
661	ps		\
662	psrinfo		\
663	ptools		\
664	pwconv		\
665	pwd		\
666	pyzfs		\
667	raidctl		\
668	ramdiskadm	\
669	rcap		\
670	rcm_daemon	\
671	refer		\
672	regcmp		\
673	renice		\
674	roles		\
675	rm		\
676	rmdir		\
677	rmformat	\
678	rmmount		\
679	rmvolmgr	\
680	sasinfo		\
681	sbdadm		\
682	scadm		\
683	script		\
684	scsi		\
685	sdiff		\
686	sdpadm		\
687	sgs		\
688	sh		\
689	shcomp		\
690	smbsrv		\
691	sort		\
692	split		\
693	srptadm		\
694	ssh		\
695	stat		\
696	stmfadm		\
697	stmsboot	\
698	strings		\
699	su		\
700	svc		\
701	svr4pkg		\
702	swap		\
703	syseventadm	\
704	syseventd	\
705	tabs		\
706	tar		\
707	tbl		\
708	time		\
709	tnf		\
710	touch		\
711	tput		\
712	troff		\
713	tsol		\
714	tty		\
715	ttymon		\
716	tzreload	\
717	ul		\
718	uname		\
719	units		\
720	unlink		\
721	unpack		\
722	userattr	\
723	valtools	\
724	vgrind		\
725	vi		\
726	volcheck	\
727	volrmmount	\
728	vrrpadm		\
729	vscan		\
730	w		\
731	wbem		\
732	who		\
733	whodo		\
734	wracct		\
735	write		\
736	wusbadm		\
737	xargs		\
738	yppasswd	\
739	zdump		\
740	zfs		\
741	zic		\
742	zlogin		\
743	zoneadm		\
744	zoneadmd	\
745	zonecfg		\
746	zonename	\
747	zpool
748
749$(CLOSED_BUILD)MSGSUBDIRS += \
750	$(CLOSED)/cmd/iconv	\
751	$(CLOSED)/cmd/ksh	\
752	$(CLOSED)/cmd/llc2	\
753	$(CLOSED)/cmd/localedef	\
754	$(CLOSED)/cmd/more_xpg4	\
755	$(CLOSED)/cmd/od	\
756	$(CLOSED)/cmd/patch	\
757	$(CLOSED)/cmd/pax	\
758	$(CLOSED)/cmd/printf	\
759	$(CLOSED)/cmd/sed	\
760	$(CLOSED)/cmd/sed_xpg4	\
761	$(CLOSED)/cmd/tail	\
762	$(CLOSED)/cmd/tr_xpg4
763
764sparc_MSGSUBDIRS=	\
765	fruadm		\
766	prtdscp		\
767	prtfru		\
768	virtinfo	\
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 audit.
795#
796AUDITSUBDIRS=		\
797	amt		\
798	audit		\
799	audit_warn	\
800	auditconfig	\
801	auditd		\
802	auditrecord	\
803	auditreduce	\
804	auditset	\
805	auditstat	\
806	praudit
807
808#
809# commands not owned by the systems group
810#
811BWOSDIRS=
812
813
814all :=		TARGET = all
815install :=	TARGET = install
816clean :=	TARGET = clean
817clobber :=	TARGET = clobber
818lint :=		TARGET = lint
819_msg :=		TARGET = _msg
820_dc :=		TARGET = _dc
821
822.KEEP_STATE:
823
824SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
825
826.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
827
828all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
829	$(AUDITSUBDIRS)
830
831#
832# Manifests cannot be checked in parallel, because we are using
833# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
834# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
835# we spawn off a sub-make to perform the non-parallel 'make check'
836#
837check:
838	$(MAKE) -f Makefile.check check
839
840#
841# The .WAIT directive works around an apparent bug in parallel make.
842# Evidently make was getting the target _msg vs. _dc confused under
843# some level of parallelization, causing some of the _dc objects
844# not to be built.
845#
846_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
847
848_dc: $(DCSUBDIRS)
849
850#
851# Dependencies
852#
853fs.d: fstyp
854ksh:	shcomp isaexec
855print:	lp
856
857$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
858	@if [ -f $@/Makefile  ]; then \
859		cd $@; pwd; $(MAKE) $(TARGET); \
860	else \
861		true; \
862	fi
863
864FRC:
865