xref: /titanic_50/usr/src/cmd/Makefile (revision 9ab815e1e50104cb1004a5ccca7a6da582994b57)
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# Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
24
25include ../Makefile.master
26
27#
28#	Note that the commands 'agents', 'lp', 'perl', and 'man' are first in
29#	the list, violating alphabetical order.  This is because they are very
30#	long-running and should be given the most wall-clock time for a
31#	parallel build.
32#
33#	Commands in the FIRST_SUBDIRS list are built before starting the build
34#	of other commands.  Currently this includes only 'isaexec' and
35#	'platexec'.  This is necessary because $(ROOT)/usr/lib/isaexec or
36#	$(ROOT)/usr/lib/platexec must exist when some other commands are built
37#	because their 'make install' creates a hard link to one of them.
38#
39#	Commands are listed one per line so that TeamWare can auto-merge most
40#	changes.
41#
42
43FIRST_SUBDIRS=		\
44	isaexec		\
45	platexec
46
47COMMON_SUBDIRS=		\
48	agents		\
49	allocate	\
50	availdevs	\
51	lp		\
52	perl		\
53	man		\
54	Adm		\
55	abi		\
56	adbgen		\
57	acct		\
58	acctadm		\
59	arch		\
60	asa		\
61	ast		\
62	audio		\
63	auths		\
64	autopush	\
65	avs		\
66	awk		\
67	awk_xpg4	\
68	backup		\
69	banner		\
70	bart		\
71	basename	\
72	bc		\
73	bdiff		\
74	beadm		\
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	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	localedef	\
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	modload		\
263	more		\
264	mpathadm	\
265	msgfmt		\
266	msgid		\
267	mt		\
268	mv		\
269	mvdir		\
270	ndmpadm		\
271	ndmpd		\
272	ndmpstat	\
273	netadm		\
274	netfiles	\
275	newform		\
276	newgrp		\
277	news		\
278	newtask		\
279	nice		\
280	nl		\
281	nlsadmin	\
282	nohup		\
283	nsadmin		\
284	nscd		\
285	oamuser		\
286	oawk		\
287	od		\
288	pack		\
289	pagesize	\
290	passmgmt	\
291	passwd		\
292	pathchk		\
293	pbind		\
294	pcidr		\
295	pcitool		\
296	pfexec		\
297	pfexecd		\
298	pginfo		\
299	pgstat		\
300	pgrep		\
301	picl		\
302	plimit		\
303	policykit	\
304	pools		\
305	power		\
306	powertop	\
307	ppgsz		\
308	pg		\
309	plockstat	\
310	pr		\
311	prctl		\
312	print		\
313	printf		\
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	runat		\
352	sa		\
353	saf		\
354	sasinfo		\
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	split		\
376	sqlite		\
377	srchtxt		\
378	srptadm		\
379	srptsvc		\
380	ssh		\
381	stat		\
382	stmfadm		\
383	stmfproxy	\
384	stmfsvc		\
385	stmsboot	\
386	streams		\
387	strings		\
388	su		\
389	sulogin		\
390	sunpc		\
391	svc		\
392	svr4pkg		\
393	swap		\
394	sync		\
395	sysdef		\
396	syseventadm	\
397	syslogd		\
398	tabs		\
399	tail		\
400	tar		\
401	tbl		\
402	tcopy		\
403	tcpd		\
404	terminfo	\
405	th_tools	\
406	tic		\
407	time		\
408	tip		\
409	tnf		\
410	touch		\
411	tput		\
412	tr		\
413	trapstat	\
414	troff		\
415	true		\
416	truss		\
417	tsol		\
418	tty		\
419	ttymon		\
420	tzreload	\
421	uadmin		\
422	ul		\
423	uname		\
424	units		\
425	unlink		\
426	unpack		\
427	userattr	\
428	users		\
429	utmp_update	\
430	utmpd		\
431	valtools	\
432	vgrind		\
433	vi		\
434	volcheck	\
435	volrmmount	\
436	vrrpadm		\
437	vscan		\
438	vt		\
439	w		\
440	wall		\
441	which		\
442	who		\
443	whodo		\
444	wracct		\
445	write		\
446	wusbadm		\
447	xargs		\
448	xstr		\
449	yes		\
450	ypcmd		\
451	yppasswd	\
452	zdb		\
453	zdump		\
454	zfs		\
455	zic		\
456	zinject		\
457	zlogin		\
458	zoneadm		\
459	zoneadmd	\
460	zonecfg		\
461	zonename	\
462	zpool		\
463	zlook		\
464	zonestat	\
465	zstreamdump	\
466	ztest
467
468$(CLOSED_BUILD)COMMON_SUBDIRS += \
469	$(CLOSED)/cmd/iconv	\
470	$(CLOSED)/cmd/ksh	\
471	$(CLOSED)/cmd/localedef	\
472	$(CLOSED)/cmd/more_xpg4	\
473	$(CLOSED)/cmd/mtst	\
474	$(CLOSED)/cmd/od	\
475	$(CLOSED)/cmd/patch	\
476	$(CLOSED)/cmd/pax	\
477	$(CLOSED)/cmd/printf	\
478	$(CLOSED)/cmd/sed	\
479	$(CLOSED)/cmd/sed_xpg4
480
481i386_SUBDIRS=		\
482	acpihpd		\
483	addbadsec	\
484	biosdev		\
485	diskscan	\
486	lms		\
487	ntfsprogs	\
488	parted		\
489	rtc		\
490	ucodeadm	\
491	xvm
492
493sparc_SUBDIRS=		\
494	cvcd		\
495	dcs		\
496	device_remap	\
497	drd		\
498	fps		\
499	fruadm		\
500	ldmad		\
501	oplhpd		\
502	prtdscp		\
503	prtfru		\
504	scadm		\
505	sckmd		\
506	sf880drd	\
507	virtinfo	\
508	vntsd
509
510#
511# Commands that are messaged.  Note that 'lp' and 'man' come first
512# (see previous comment about 'lp' and 'man').
513#
514MSGSUBDIRS=		\
515	lp		\
516	man		\
517	abi		\
518	acctadm		\
519	allocate	\
520	asa		\
521	audio		\
522	audit		\
523	auditconfig	\
524	auditd		\
525	auditrecord	\
526	auditset	\
527	auths		\
528	autopush	\
529	avs		\
530	awk		\
531	awk_xpg4	\
532	backup		\
533	banner		\
534	bart		\
535	basename	\
536	beadm		\
537	bnu		\
538	busstat		\
539	cal		\
540	cat		\
541	cdrw		\
542	cfgadm		\
543	checkeq		\
544	checknr		\
545	chgrp		\
546	chmod		\
547	chown		\
548	cmd-crypto	\
549	cmd-inet	\
550	col		\
551	compress	\
552	consadm		\
553	coreadm		\
554	cpio		\
555	cpc		\
556	cron		\
557	csh		\
558	csplit		\
559	ctrun		\
560	ctstat		\
561	ctwatch		\
562	datadm		\
563	date		\
564	dc		\
565	dcs		\
566	dd		\
567	deroff		\
568	devfsadm	\
569	dfs.cmds	\
570	diff		\
571	diffmk		\
572	dladm		\
573	dlstat		\
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	flowstat	\
589	fm		\
590	fold		\
591	fs.d		\
592	fwflash		\
593	geniconvtbl	\
594	genmsg		\
595	getconf		\
596	getent		\
597	gettext		\
598	gettxt		\
599	grep		\
600	grep_xpg4	\
601	grpck		\
602	gss		\
603	halt		\
604	head		\
605	hostname	\
606	hotplug		\
607	id		\
608	idmap		\
609	isaexec		\
610	iscsiadm	\
611	iscsid		\
612	isns		\
613	itadm		\
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	ls		\
628	luxadm		\
629	lvm		\
630	mailx		\
631	mesg		\
632	mkdir		\
633	mkpwdict	\
634	mktemp		\
635	more		\
636	mpathadm	\
637	msgfmt		\
638	mv		\
639	ndmpadm		\
640	ndmpstat	\
641	newgrp		\
642	newtask		\
643	nice		\
644	nohup		\
645	oawk		\
646	pack		\
647	passwd		\
648	passmgmt	\
649	pathchk		\
650	pfexec		\
651	pg		\
652	pgrep		\
653	picl            \
654	pools		\
655	power		\
656	pr		\
657	praudit		\
658	print		\
659	profiles	\
660	projadd		\
661	projects	\
662	prstat		\
663	prtdiag		\
664	ps		\
665	psrinfo		\
666	ptools		\
667	pwconv		\
668	pwd		\
669	pyzfs		\
670	raidctl		\
671	ramdiskadm	\
672	rcap		\
673	rcm_daemon	\
674	refer		\
675	regcmp		\
676	renice		\
677	roles		\
678	rm		\
679	rmdir		\
680	rmformat	\
681	rmmount		\
682	rmvolmgr	\
683	sasinfo		\
684	sbdadm		\
685	scadm		\
686	script		\
687	scsi		\
688	sdiff		\
689	sdpadm		\
690	sgs		\
691	sh		\
692	shcomp		\
693	smbsrv		\
694	sort		\
695	split		\
696	srptadm		\
697	ssh		\
698	stat		\
699	stmfadm		\
700	stmsboot	\
701	strings		\
702	su		\
703	svc		\
704	svr4pkg		\
705	swap		\
706	syseventadm	\
707	syseventd	\
708	tabs		\
709	tar		\
710	tbl		\
711	time		\
712	tnf		\
713	touch		\
714	tput		\
715	troff		\
716	tsol		\
717	tty		\
718	ttymon		\
719	tzreload	\
720	ul		\
721	uname		\
722	units		\
723	unlink		\
724	unpack		\
725	userattr	\
726	valtools	\
727	vgrind		\
728	vi		\
729	volcheck	\
730	volrmmount	\
731	vrrpadm		\
732	vscan		\
733	w		\
734	who		\
735	whodo		\
736	wracct		\
737	write		\
738	wusbadm		\
739	xargs		\
740	yppasswd	\
741	zdump		\
742	zfs		\
743	zic		\
744	zlogin		\
745	zoneadm		\
746	zoneadmd	\
747	zonecfg		\
748	zonename	\
749	zpool		\
750	zonestat
751
752$(CLOSED_BUILD)MSGSUBDIRS += \
753	$(CLOSED)/cmd/iconv	\
754	$(CLOSED)/cmd/ksh	\
755	$(CLOSED)/cmd/localedef	\
756	$(CLOSED)/cmd/more_xpg4	\
757	$(CLOSED)/cmd/od	\
758	$(CLOSED)/cmd/patch	\
759	$(CLOSED)/cmd/pax	\
760	$(CLOSED)/cmd/printf	\
761	$(CLOSED)/cmd/sed	\
762	$(CLOSED)/cmd/sed_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
855mdb:	terminfo
856print:	lp
857
858$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
859	@if [ -f $@/Makefile  ]; then \
860		cd $@; pwd; $(MAKE) $(TARGET); \
861	else \
862		true; \
863	fi
864
865FRC:
866