xref: /titanic_51/usr/src/cmd/Makefile (revision e18306b13ed357bd545696aa96b53617b64db4a3)
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
27include ../Makefile.master
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	allocate	\
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	beadm		\
76	bfs		\
77	bnu		\
78	boot		\
79	busstat		\
80	cal		\
81	calendar	\
82	captoinfo	\
83	cat		\
84	cdrw		\
85	cfgadm		\
86	checkeq		\
87	checknr		\
88	chgrp		\
89	chmod		\
90	chown		\
91	chroot		\
92	clear		\
93	clinfo		\
94	cmd-crypto	\
95	cmd-inet	\
96	col		\
97	compress	\
98	consadm		\
99	coreadm		\
100	cpio		\
101	cpc		\
102	cron		\
103	crypt		\
104	csh		\
105	csplit		\
106	ctrun		\
107	ctstat		\
108	ctwatch		\
109	datadm		\
110	date		\
111	dc		\
112	dd		\
113	deroff		\
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	dlstat		\
131	dmesg		\
132	dodatadm	\
133	dtrace		\
134	du		\
135	dumpadm		\
136	dumpcs		\
137	echo		\
138	ed		\
139	eeprom		\
140	egrep		\
141	eject		\
142	emul64ioctl	\
143	enhance		\
144	env		\
145	eqn		\
146	expand		\
147	expr		\
148	exstr		\
149	factor		\
150	false		\
151	fcinfo		\
152	fcoesvc		\
153	fdetach		\
154	fdformat	\
155	fdisk		\
156	filesync	\
157	fgrep		\
158	file		\
159	filebench	\
160	find		\
161	flowadm		\
162	flowstat	\
163	fm		\
164	fmt		\
165	fmthard		\
166	fmtmsg		\
167	fold		\
168	format		\
169	fs.d		\
170	fstyp		\
171	fuser		\
172	fwflash		\
173	gcore		\
174	gencat		\
175	geniconvtbl	\
176	genmsg		\
177	getconf		\
178	getdevpolicy	\
179	getent		\
180	getfacl		\
181	getmajor	\
182	getopt		\
183	gettext		\
184	gettxt		\
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	ibd_upgrade	\
199	id		\
200	idmap		\
201	infocmp		\
202	init		\
203	initpkg		\
204	install.d	\
205	intrd		\
206	intrstat	\
207	ipcrm		\
208	ipcs		\
209	ipf		\
210	isainfo		\
211	isalist		\
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	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	zfs		\
458	zhack		\
459	zic		\
460	zinject		\
461	zlogin		\
462	zoneadm		\
463	zoneadmd	\
464	zonecfg		\
465	zonename	\
466	zpool		\
467	zlook		\
468	zonestat	\
469	zstreamdump	\
470	ztest
471
472$(CLOSED_BUILD)COMMON_SUBDIRS += \
473	$(CLOSED)/cmd/iconv	\
474	$(CLOSED)/cmd/ksh	\
475	$(CLOSED)/cmd/localedef	\
476	$(CLOSED)/cmd/more_xpg4	\
477	$(CLOSED)/cmd/mtst	\
478	$(CLOSED)/cmd/od	\
479	$(CLOSED)/cmd/patch	\
480	$(CLOSED)/cmd/pax	\
481	$(CLOSED)/cmd/printf	\
482	$(CLOSED)/cmd/sed	\
483	$(CLOSED)/cmd/sed_xpg4
484
485i386_SUBDIRS=		\
486	acpihpd		\
487	addbadsec	\
488	biosdev		\
489	diskscan	\
490	lms		\
491	ntfsprogs	\
492	parted		\
493	rtc		\
494	ucodeadm	\
495	xvm
496
497sparc_SUBDIRS=		\
498	cvcd		\
499	dcs		\
500	device_remap	\
501	drd		\
502	fruadm		\
503	ldmad		\
504	oplhpd		\
505	prtdscp		\
506	prtfru		\
507	scadm		\
508	sckmd		\
509	sf880drd	\
510	virtinfo	\
511	vntsd
512
513#
514# Commands that are messaged.  Note that 'lp' and 'man' come first
515# (see previous comment about 'lp' and 'man').
516#
517MSGSUBDIRS=		\
518	lp		\
519	man		\
520	abi		\
521	acctadm		\
522	allocate	\
523	asa		\
524	audio		\
525	audit		\
526	auditconfig	\
527	auditd		\
528	auditrecord	\
529	auditset	\
530	auths		\
531	autopush	\
532	avs		\
533	awk		\
534	awk_xpg4	\
535	backup		\
536	banner		\
537	bart		\
538	basename	\
539	beadm		\
540	bnu		\
541	busstat		\
542	cal		\
543	cat		\
544	cdrw		\
545	cfgadm		\
546	checkeq		\
547	checknr		\
548	chgrp		\
549	chmod		\
550	chown		\
551	cmd-crypto	\
552	cmd-inet	\
553	col		\
554	compress	\
555	consadm		\
556	coreadm		\
557	cpio		\
558	cpc		\
559	cron		\
560	csh		\
561	csplit		\
562	ctrun		\
563	ctstat		\
564	ctwatch		\
565	datadm		\
566	date		\
567	dc		\
568	dcs		\
569	dd		\
570	deroff		\
571	devfsadm	\
572	dfs.cmds	\
573	diff		\
574	diffmk		\
575	dladm		\
576	dlstat		\
577	du		\
578	dumpcs		\
579	ed		\
580	eject		\
581	env		\
582	eqn		\
583	expand		\
584	expr		\
585	fcinfo		\
586	fgrep		\
587	file		\
588	filesync	\
589	find		\
590	flowadm		\
591	flowstat	\
592	fm		\
593	fold		\
594	fs.d		\
595	fwflash		\
596	geniconvtbl	\
597	genmsg		\
598	getconf		\
599	getent		\
600	gettext		\
601	gettxt		\
602	grep		\
603	grep_xpg4	\
604	grpck		\
605	gss		\
606	halt		\
607	head		\
608	hostname	\
609	hotplug		\
610	id		\
611	idmap		\
612	isaexec		\
613	iscsiadm	\
614	iscsid		\
615	isns		\
616	itadm		\
617	kbd		\
618	krb5		\
619	ksh		\
620	kstat		\
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	zfs		\
746	zic		\
747	zlogin		\
748	zoneadm		\
749	zoneadmd	\
750	zonecfg		\
751	zonename	\
752	zpool		\
753	zonestat
754
755$(CLOSED_BUILD)MSGSUBDIRS += \
756	$(CLOSED)/cmd/iconv	\
757	$(CLOSED)/cmd/ksh	\
758	$(CLOSED)/cmd/localedef	\
759	$(CLOSED)/cmd/more_xpg4	\
760	$(CLOSED)/cmd/od	\
761	$(CLOSED)/cmd/patch	\
762	$(CLOSED)/cmd/pax	\
763	$(CLOSED)/cmd/printf	\
764	$(CLOSED)/cmd/sed	\
765	$(CLOSED)/cmd/sed_xpg4
766
767sparc_MSGSUBDIRS=	\
768	fruadm		\
769	prtdscp		\
770	prtfru		\
771	virtinfo	\
772	vntsd
773
774i386_MSGSUBDIRS=	\
775	ucodeadm
776
777#
778# commands that use dcgettext for localized time, LC_TIME
779#
780DCSUBDIRS=		\
781	cal		\
782	cfgadm		\
783	diff		\
784	ls		\
785	pr		\
786	ps		\
787	tar		\
788	w		\
789	who		\
790	whodo		\
791	write
792
793$(CLOSED_BUILD)DCSUBDIRS += \
794	$(CLOSED)/cmd/pax
795
796#
797# commands that belong only to audit.
798#
799AUDITSUBDIRS=		\
800	amt		\
801	audit		\
802	audit_warn	\
803	auditconfig	\
804	auditd		\
805	auditrecord	\
806	auditreduce	\
807	auditset	\
808	auditstat	\
809	praudit
810
811#
812# commands not owned by the systems group
813#
814BWOSDIRS=
815
816
817all :=		TARGET = all
818install :=	TARGET = install
819clean :=	TARGET = clean
820clobber :=	TARGET = clobber
821lint :=		TARGET = lint
822_msg :=		TARGET = _msg
823_dc :=		TARGET = _dc
824
825.KEEP_STATE:
826
827SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
828
829.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
830
831all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
832	$(AUDITSUBDIRS)
833
834#
835# Manifests cannot be checked in parallel, because we are using
836# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
837# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
838# we spawn off a sub-make to perform the non-parallel 'make check'
839#
840check:
841	$(MAKE) -f Makefile.check check
842
843#
844# The .WAIT directive works around an apparent bug in parallel make.
845# Evidently make was getting the target _msg vs. _dc confused under
846# some level of parallelization, causing some of the _dc objects
847# not to be built.
848#
849_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
850
851_dc: $(DCSUBDIRS)
852
853#
854# Dependencies
855#
856fs.d: fstyp
857ksh:	shcomp isaexec
858mdb:	terminfo
859print:	lp
860
861$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
862	@if [ -f $@/Makefile  ]; then \
863		cd $@; pwd; $(MAKE) $(TARGET); \
864	else \
865		true; \
866	fi
867
868FRC:
869