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