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