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