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