xref: /titanic_50/usr/src/cmd/Makefile (revision 52244c0958bdf281ca42932b449f644b4decfdc2)
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	java		\
219	kbd		\
220	keyserv		\
221	killall		\
222	krb5		\
223	ksh		\
224	kvmstat		\
225	last		\
226	lastcomm	\
227	latencytop	\
228	ldap		\
229	ldapcachemgr	\
230	lgrpinfo	\
231	line		\
232	link		\
233	dlmgmtd		\
234	listen		\
235	loadkeys	\
236	locale		\
237	localedef	\
238	lockstat	\
239	locator		\
240	lofiadm		\
241	logadm		\
242	logger		\
243	login		\
244	logins		\
245	look		\
246	ls		\
247	luxadm		\
248	lvm		\
249	mach		\
250	mail		\
251	mailwrapper	\
252	mailx		\
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	man		\
618	mesg		\
619	mkdir		\
620	mkpwdict	\
621	mktemp		\
622	more		\
623	mpathadm	\
624	msgfmt		\
625	mv		\
626	ndmpadm		\
627	ndmpstat	\
628	newgrp		\
629	newtask		\
630	nice		\
631	nohup		\
632	oawk		\
633	pack		\
634	passwd		\
635	passmgmt	\
636	pathchk		\
637	pfexec		\
638	pg		\
639	pgrep		\
640	picl            \
641	pools		\
642	power		\
643	pr		\
644	praudit		\
645	print		\
646	profiles	\
647	projadd		\
648	projects	\
649	prstat		\
650	prtdiag		\
651	ps		\
652	psrinfo		\
653	ptools		\
654	pwconv		\
655	pwd		\
656	pyzfs		\
657	raidctl		\
658	ramdiskadm	\
659	rcap		\
660	rcm_daemon	\
661	refer		\
662	regcmp		\
663	renice		\
664	roles		\
665	rm		\
666	rmdir		\
667	rmformat	\
668	rmmount		\
669	rmvolmgr	\
670	sasinfo		\
671	sbdadm		\
672	scadm		\
673	script		\
674	scsi		\
675	sdiff		\
676	sdpadm		\
677	sgs		\
678	sh		\
679	shcomp		\
680	smbsrv		\
681	sort		\
682	split		\
683	srptadm		\
684	ssh		\
685	stat		\
686	stmfadm		\
687	stmsboot	\
688	strings		\
689	su		\
690	svc		\
691	svr4pkg		\
692	swap		\
693	syseventadm	\
694	syseventd	\
695	tabs		\
696	tar		\
697	tbl		\
698	time		\
699	tnf		\
700	touch		\
701	tput		\
702	troff		\
703	tsol		\
704	tty		\
705	ttymon		\
706	tzreload	\
707	ul		\
708	uname		\
709	units		\
710	unlink		\
711	unpack		\
712	userattr	\
713	valtools	\
714	vgrind		\
715	vi		\
716	volcheck	\
717	volrmmount	\
718	vrrpadm		\
719	vscan		\
720	w		\
721	who		\
722	whodo		\
723	wracct		\
724	write		\
725	xargs		\
726	yppasswd	\
727	zdump		\
728	zfs		\
729	zic		\
730	zlogin		\
731	zoneadm		\
732	zoneadmd	\
733	zonecfg		\
734	zonename	\
735	zpool		\
736	zonestat
737
738sparc_MSGSUBDIRS=	\
739	fruadm		\
740	prtdscp		\
741	prtfru		\
742	virtinfo	\
743	vntsd
744
745i386_MSGSUBDIRS=	\
746	ucodeadm
747
748#
749# commands that use dcgettext for localized time, LC_TIME
750#
751DCSUBDIRS=		\
752	cal		\
753	cfgadm		\
754	diff		\
755	ls		\
756	pr		\
757	ps		\
758	tar		\
759	w		\
760	who		\
761	whodo		\
762	write
763
764#
765# commands that belong only to audit.
766#
767AUDITSUBDIRS=		\
768	amt		\
769	audit		\
770	audit_warn	\
771	auditconfig	\
772	auditd		\
773	auditrecord	\
774	auditreduce	\
775	auditset	\
776	auditstat	\
777	praudit
778
779#
780# commands not owned by the systems group
781#
782BWOSDIRS=
783
784
785all :=		TARGET = all
786install :=	TARGET = install
787clean :=	TARGET = clean
788clobber :=	TARGET = clobber
789lint :=		TARGET = lint
790_msg :=		TARGET = _msg
791_dc :=		TARGET = _dc
792
793.KEEP_STATE:
794
795SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
796
797.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
798
799all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
800	$(AUDITSUBDIRS)
801
802#
803# Manifests cannot be checked in parallel, because we are using
804# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
805# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
806# we spawn off a sub-make to perform the non-parallel 'make check'
807#
808check:
809	$(MAKE) -f Makefile.check check
810
811#
812# The .WAIT directive works around an apparent bug in parallel make.
813# Evidently make was getting the target _msg vs. _dc confused under
814# some level of parallelization, causing some of the _dc objects
815# not to be built.
816#
817_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
818
819_dc: $(DCSUBDIRS)
820
821#
822# Dependencies
823#
824fs.d: fstyp
825ksh:	shcomp isaexec
826mdb:	terminfo
827print:	lp
828fmt:	mailx
829
830$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
831	@if [ -f $@/Makefile  ]; then \
832		cd $@; pwd; $(MAKE) $(TARGET); \
833	else \
834		true; \
835	fi
836
837FRC:
838