xref: /titanic_51/usr/src/cmd/Makefile (revision 39fd84a866206a99cbb6b6e63e0c38a367aaa88e)
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 2015 Nexenta Systems, Inc.  All rights reserved.
24# Copyright (c) 2012 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# Copyright 2014 Garrett D'Amore <garrett@damore.org>
28
29include ../Makefile.master
30
31#
32#	Note that the commands 'lp', and 'perl' are first in
33#	the list, violating alphabetical order.  This is because they are very
34#	long-running and should be given the most wall-clock time for a
35#	parallel build.
36#
37#	Commands in the FIRST_SUBDIRS list are built before starting the build
38#	of other commands.  Currently this includes only 'isaexec' and
39#	'platexec'.  This is necessary because $(ROOT)/usr/lib/isaexec or
40#	$(ROOT)/usr/lib/platexec must exist when some other commands are built
41#	because their 'make install' creates a hard link to one of them.
42#
43#	Commands are listed one per line so that TeamWare can auto-merge most
44#	changes.
45#
46
47FIRST_SUBDIRS=		\
48	isaexec		\
49	platexec
50
51COMMON_SUBDIRS=		\
52	allocate	\
53	availdevs	\
54	lp		\
55	perl		\
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	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	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	ipdadm		\
209	ipf		\
210	isainfo		\
211	isalist		\
212	itutools	\
213	iscsiadm	\
214	iscsid		\
215	iscsitsvc	\
216	isns		\
217	itadm		\
218	kbd		\
219	keyserv		\
220	killall		\
221	krb5		\
222	ksh		\
223	kvmstat		\
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	mail		\
250	mailwrapper	\
251	mailx		\
252	make		\
253	makekey		\
254	man		\
255	mandoc		\
256	mdb		\
257	mesg		\
258	mkdir		\
259	mkfifo		\
260	mkfile		\
261	mkmsgs		\
262	mknod		\
263	mkpwdict	\
264	mktemp		\
265	modload		\
266	more		\
267	mpathadm	\
268	msgfmt		\
269	msgid		\
270	mt		\
271	mv		\
272	mvdir		\
273	ndmpadm		\
274	ndmpd		\
275	ndmpstat	\
276	netadm		\
277	netfiles	\
278	newform		\
279	newgrp		\
280	news		\
281	newtask		\
282	nice		\
283	nl		\
284	nlsadmin	\
285	nohup		\
286	nsadmin		\
287	nscd		\
288	oamuser		\
289	oawk		\
290	od		\
291	pack		\
292	pagesize	\
293	passmgmt	\
294	passwd		\
295	pathchk		\
296	pbind		\
297	pcidr		\
298	pcitool		\
299	pfexec		\
300	pfexecd		\
301	pginfo		\
302	pgstat		\
303	pgrep		\
304	picl		\
305	plimit		\
306	policykit	\
307	pools		\
308	power		\
309	powertop	\
310	ppgsz		\
311	pg		\
312	plockstat	\
313	pr		\
314	prctl		\
315	print		\
316	printf		\
317	priocntl	\
318	profiles	\
319	projadd		\
320	projects	\
321	prstat		\
322	prtconf		\
323	prtdiag		\
324	prtvtoc		\
325	ps		\
326	psradm		\
327	psrinfo		\
328	psrset		\
329	ptools		\
330	pwck		\
331	pwconv		\
332	pwd		\
333	pyzfs		\
334	raidctl		\
335	ramdiskadm	\
336	rcap		\
337	rcm_daemon	\
338	rctladm		\
339	refer		\
340	regcmp		\
341	renice		\
342	rexd		\
343	rm		\
344	rmdir		\
345	rmformat	\
346	rmmount		\
347	rmt		\
348	rmvolmgr	\
349	roles		\
350	rpcbind		\
351	rpcgen		\
352	rpcinfo		\
353	rpcsvc		\
354	runat		\
355	sa		\
356	saf		\
357	sasinfo		\
358	savecore	\
359	sbdadm		\
360	script		\
361	scsi		\
362	sdiff		\
363	sdpadm		\
364	sed		\
365	sendmail	\
366	setfacl		\
367	setmnt		\
368	setpgrp		\
369	setuname	\
370	sgs		\
371	sh		\
372	shcomp		\
373	smbios		\
374	smbsrv		\
375	smserverd	\
376	soelim		\
377	sort		\
378	spell		\
379	split		\
380	sqlite		\
381	srchtxt		\
382	srptadm		\
383	srptsvc		\
384	ssh		\
385	stat		\
386	stmfadm		\
387	stmfproxy	\
388	stmfsvc		\
389	stmsboot	\
390	streams		\
391	strings		\
392	su		\
393	sulogin		\
394	sunpc		\
395	svc		\
396	svr4pkg		\
397	swap		\
398	sync		\
399	sysdef		\
400	syseventadm	\
401	syslogd		\
402	tabs		\
403	tail		\
404	tar		\
405	tbl		\
406	tcopy		\
407	tcpd		\
408	terminfo	\
409	th_tools	\
410	tic		\
411	time		\
412	tip		\
413	tnf		\
414	touch		\
415	tput		\
416	tr		\
417	trapstat	\
418	troff		\
419	true		\
420	truss		\
421	tsol		\
422	tty		\
423	ttymon		\
424	tzreload	\
425	uadmin		\
426	ul		\
427	uname		\
428	units		\
429	unlink		\
430	unpack		\
431	userattr	\
432	users		\
433	utmp_update	\
434	utmpd		\
435	valtools	\
436	vgrind		\
437	vi		\
438	volcheck	\
439	volrmmount	\
440	vrrpadm		\
441	vscan		\
442	vt		\
443	w		\
444	wall		\
445	which		\
446	who		\
447	whodo		\
448	wracct		\
449	write		\
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
472i386_SUBDIRS=		\
473	acpihpd		\
474	addbadsec	\
475	biosdev		\
476	diskscan	\
477	lms		\
478	rtc		\
479	ucodeadm	\
480	xvm
481
482sparc_SUBDIRS=		\
483	cvcd		\
484	dcs		\
485	device_remap	\
486	drd		\
487	fruadm		\
488	ldmad		\
489	oplhpd		\
490	prtdscp		\
491	prtfru		\
492	scadm		\
493	sckmd		\
494	sf880drd	\
495	virtinfo	\
496	vntsd
497
498#
499# Commands that are messaged.  Note that 'lp' comes first
500# (see previous comment about 'lp'.)
501#
502MSGSUBDIRS=		\
503	lp		\
504	abi		\
505	acctadm		\
506	allocate	\
507	asa		\
508	audio		\
509	audit		\
510	auditconfig	\
511	auditd		\
512	auditrecord	\
513	auditset	\
514	auths		\
515	autopush	\
516	avs		\
517	awk		\
518	awk_xpg4	\
519	backup		\
520	banner		\
521	bart		\
522	basename	\
523	beadm		\
524	bnu		\
525	busstat		\
526	cal		\
527	cat		\
528	cdrw		\
529	cfgadm		\
530	checkeq		\
531	checknr		\
532	chgrp		\
533	chmod		\
534	chown		\
535	cmd-crypto	\
536	cmd-inet	\
537	col		\
538	compress	\
539	consadm		\
540	coreadm		\
541	cpio		\
542	cpc		\
543	cron		\
544	csh		\
545	csplit		\
546	ctrun		\
547	ctstat		\
548	ctwatch		\
549	datadm		\
550	date		\
551	dc		\
552	dcs		\
553	dd		\
554	deroff		\
555	devfsadm	\
556	dfs.cmds	\
557	diff		\
558	diffmk		\
559	dladm		\
560	dlstat		\
561	du		\
562	dumpcs		\
563	ed		\
564	eject		\
565	env		\
566	eqn		\
567	expand		\
568	expr		\
569	fcinfo		\
570	fgrep		\
571	file		\
572	filesync	\
573	find		\
574	flowadm		\
575	flowstat	\
576	fm		\
577	fold		\
578	fs.d		\
579	fwflash		\
580	geniconvtbl	\
581	genmsg		\
582	getconf		\
583	getent		\
584	gettext		\
585	gettxt		\
586	grep		\
587	grep_xpg4	\
588	grpck		\
589	gss		\
590	halt		\
591	head		\
592	hostname	\
593	hotplug		\
594	id		\
595	idmap		\
596	isaexec		\
597	iscsiadm	\
598	iscsid		\
599	isns		\
600	itadm		\
601	kbd		\
602	krb5		\
603	ksh		\
604	last		\
605	ldap		\
606	ldapcachemgr	\
607	lgrpinfo	\
608	locale		\
609	lofiadm		\
610	logadm		\
611	logger		\
612	logins		\
613	ls		\
614	luxadm		\
615	lvm		\
616	mailx		\
617	make		\
618	man		\
619	mesg		\
620	mkdir		\
621	mkpwdict	\
622	mktemp		\
623	more		\
624	mpathadm	\
625	msgfmt		\
626	mv		\
627	ndmpadm		\
628	ndmpstat	\
629	newgrp		\
630	newtask		\
631	nice		\
632	nohup		\
633	oawk		\
634	pack		\
635	passwd		\
636	passmgmt	\
637	pathchk		\
638	pfexec		\
639	pg		\
640	pgrep		\
641	picl            \
642	pools		\
643	power		\
644	pr		\
645	praudit		\
646	print		\
647	profiles	\
648	projadd		\
649	projects	\
650	prstat		\
651	prtdiag		\
652	ps		\
653	psrinfo		\
654	ptools		\
655	pwconv		\
656	pwd		\
657	pyzfs		\
658	raidctl		\
659	ramdiskadm	\
660	rcap		\
661	rcm_daemon	\
662	refer		\
663	regcmp		\
664	renice		\
665	roles		\
666	rm		\
667	rmdir		\
668	rmformat	\
669	rmmount		\
670	rmvolmgr	\
671	sasinfo		\
672	sbdadm		\
673	scadm		\
674	script		\
675	scsi		\
676	sdiff		\
677	sdpadm		\
678	sgs		\
679	sh		\
680	shcomp		\
681	smbsrv		\
682	sort		\
683	split		\
684	srptadm		\
685	ssh		\
686	stat		\
687	stmfadm		\
688	stmsboot	\
689	strings		\
690	su		\
691	svc		\
692	svr4pkg		\
693	swap		\
694	syseventadm	\
695	syseventd	\
696	tabs		\
697	tar		\
698	tbl		\
699	time		\
700	tnf		\
701	touch		\
702	tput		\
703	troff		\
704	tsol		\
705	tty		\
706	ttymon		\
707	tzreload	\
708	ul		\
709	uname		\
710	units		\
711	unlink		\
712	unpack		\
713	userattr	\
714	valtools	\
715	vgrind		\
716	vi		\
717	volcheck	\
718	volrmmount	\
719	vrrpadm		\
720	vscan		\
721	w		\
722	who		\
723	whodo		\
724	wracct		\
725	write		\
726	xargs		\
727	yppasswd	\
728	zdump		\
729	zfs		\
730	zic		\
731	zlogin		\
732	zoneadm		\
733	zoneadmd	\
734	zonecfg		\
735	zonename	\
736	zpool		\
737	zonestat
738
739sparc_MSGSUBDIRS=	\
740	fruadm		\
741	prtdscp		\
742	prtfru		\
743	virtinfo	\
744	vntsd
745
746i386_MSGSUBDIRS=	\
747	ucodeadm
748
749#
750# commands that use dcgettext for localized time, LC_TIME
751#
752DCSUBDIRS=		\
753	cal		\
754	cfgadm		\
755	diff		\
756	ls		\
757	pr		\
758	ps		\
759	tar		\
760	w		\
761	who		\
762	whodo		\
763	write
764
765#
766# commands that belong only to audit.
767#
768AUDITSUBDIRS=		\
769	amt		\
770	audit		\
771	audit_warn	\
772	auditconfig	\
773	auditd		\
774	auditrecord	\
775	auditreduce	\
776	auditset	\
777	auditstat	\
778	praudit
779
780#
781# commands not owned by the systems group
782#
783BWOSDIRS=
784
785
786all :=		TARGET = all
787install :=	TARGET = install
788clean :=	TARGET = clean
789clobber :=	TARGET = clobber
790lint :=		TARGET = lint
791_msg :=		TARGET = _msg
792_dc :=		TARGET = _dc
793
794.KEEP_STATE:
795
796SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
797
798.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
799
800all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
801	$(AUDITSUBDIRS)
802
803#
804# Manifests cannot be checked in parallel, because we are using
805# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
806# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
807# we spawn off a sub-make to perform the non-parallel 'make check'
808#
809check:
810	$(MAKE) -f Makefile.check check
811
812#
813# The .WAIT directive works around an apparent bug in parallel make.
814# Evidently make was getting the target _msg vs. _dc confused under
815# some level of parallelization, causing some of the _dc objects
816# not to be built.
817#
818_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
819
820_dc: $(DCSUBDIRS)
821
822#
823# Dependencies
824#
825fs.d: fstyp
826ksh:	shcomp isaexec
827mdb:	terminfo
828print:	lp
829fmt:	mailx
830
831$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
832	@if [ -f $@/Makefile  ]; then \
833		cd $@; pwd; $(MAKE) $(TARGET); \
834	else \
835		true; \
836	fi
837
838FRC:
839