xref: /illumos-gate/usr/src/cmd/Makefile (revision b8767451d156f585534afac0bf22721810d0dc63)
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	pcidr		\
308	pcieb		\
309	pcitool		\
310	pfexec		\
311	pfexecd		\
312	pginfo		\
313	pgstat		\
314	pgrep		\
315	picl		\
316	plimit		\
317	policykit	\
318	pools		\
319	power		\
320	powertop	\
321	ppgsz		\
322	pg		\
323	plockstat	\
324	pr		\
325	prctl		\
326	print		\
327	printf		\
328	priocntl	\
329	profiles	\
330	projadd		\
331	projects	\
332	prstat		\
333	prtconf		\
334	prtdiag		\
335	prtvtoc		\
336	ps		\
337	psradm		\
338	psrinfo		\
339	psrset		\
340	ptools		\
341	pwck		\
342	pwconv		\
343	pwd		\
344	pyzfs		\
345	raidctl		\
346	raidz_test	\
347	ramdiskadm	\
348	rcap		\
349	rcm_daemon	\
350	rctladm		\
351	refer		\
352	regcmp		\
353	renice		\
354	rm		\
355	rmdir		\
356	rmformat	\
357	rmmount		\
358	rmt		\
359	rmvolmgr	\
360	roles		\
361	rpcbind		\
362	rpcgen		\
363	rpcinfo		\
364	rpcsvc		\
365	runat		\
366	sa		\
367	saf		\
368	sasinfo		\
369	savecore	\
370	sbdadm		\
371	script		\
372	scsi		\
373	sdiff		\
374	sdpadm		\
375	sed		\
376	sendmail	\
377	setfacl		\
378	setmnt		\
379	setpgrp		\
380	setuname	\
381	sgs		\
382	sh		\
383	sleep		\
384	smbios		\
385	smbsrv		\
386	smserverd	\
387	soelim		\
388	sort		\
389	spell		\
390	split		\
391	sqlite		\
392	srchtxt		\
393	srptadm		\
394	srptsvc		\
395	ssh		\
396	stat		\
397	stmfadm		\
398	stmfproxy	\
399	stmfsvc		\
400	stmsboot	\
401	streams		\
402	strings		\
403	su		\
404	sulogin		\
405	sunpc		\
406	svc		\
407	svr4pkg		\
408	swap		\
409	sync		\
410	sysdef		\
411	syseventadm	\
412	syslogd		\
413	tabs		\
414	tail		\
415	tar		\
416	tbl		\
417	tcopy		\
418	tcpd		\
419	th_tools	\
420	tic		\
421	time		\
422	tip		\
423	tnf		\
424	touch		\
425	tput		\
426	tr		\
427	trapstat	\
428	troff		\
429	true		\
430	truss		\
431	tsol		\
432	tty		\
433	ttymon		\
434	tzreload	\
435	uadmin		\
436	ul		\
437	uname		\
438	units		\
439	unlink		\
440	unpack		\
441	userattr	\
442	users		\
443	utmp_update	\
444	utmpd		\
445	uuidgen		\
446	valtools	\
447	vgrind		\
448	vi		\
449	volcheck	\
450	volrmmount	\
451	vrrpadm		\
452	vscan		\
453	vt		\
454	vtfontcvt	\
455	w		\
456	wall		\
457	which		\
458	who		\
459	whodo		\
460	wracct		\
461	write		\
462	xargs		\
463	xstr		\
464	yes		\
465	ypcmd		\
466	yppasswd	\
467	zdb		\
468	zdump		\
469	zfs		\
470	zhack		\
471	zic		\
472	zinject		\
473	zlogin		\
474	zoneadm		\
475	zoneadmd	\
476	zonecfg		\
477	zonename	\
478	zpool		\
479	zlook		\
480	zonestat	\
481	zstreamdump	\
482	ztest
483
484i386_SUBDIRS=		\
485	acpi		\
486	acpihpd		\
487	addbadsec	\
488	ahciem		\
489	amdzen		\
490	bhyve		\
491	bhyvectl	\
492	biosdev		\
493	cxgbetool	\
494	diskscan	\
495	nvmeadm		\
496	pptadm		\
497	rdmsr		\
498	rtc		\
499	ucodeadm	\
500	xhci		\
501	xvm
502
503sparc_SUBDIRS=		\
504	dcs		\
505	device_remap	\
506	drd		\
507	fruadm		\
508	ldmad		\
509	oplhpd		\
510	prtdscp		\
511	prtfru		\
512	scadm		\
513	sckmd		\
514	sf880drd	\
515	virtinfo	\
516	vntsd
517
518#
519# Commands that are messaged.  Note that 'lp' comes first
520# (see previous comment about 'lp'.)
521#
522MSGSUBDIRS=		\
523	lp		\
524	abi		\
525	acctadm		\
526	allocate	\
527	asa		\
528	ast		\
529	audio		\
530	audit		\
531	auditconfig	\
532	auditd		\
533	auditrecord	\
534	auditset	\
535	auths		\
536	autopush	\
537	awk		\
538	awk_xpg4	\
539	backup		\
540	banner		\
541	bart		\
542	basename	\
543	beadm		\
544	bnu		\
545	busstat		\
546	cal		\
547	cat		\
548	cdrw		\
549	cfgadm		\
550	checkeq		\
551	checknr		\
552	chgrp		\
553	chmod		\
554	chown		\
555	cmd-crypto	\
556	cmd-inet	\
557	col		\
558	compress	\
559	connstat	\
560	consadm		\
561	coreadm		\
562	cpio		\
563	cpc		\
564	cron		\
565	csh		\
566	csplit		\
567	ctrun		\
568	ctstat		\
569	ctwatch		\
570	datadm		\
571	date		\
572	dc		\
573	dcs		\
574	dd		\
575	deroff		\
576	devfsadm	\
577	dfs.cmds	\
578	diff		\
579	diffmk		\
580	dladm		\
581	dlstat		\
582	du		\
583	dumpcs		\
584	ed		\
585	eject		\
586	env		\
587	eqn		\
588	expand		\
589	expr		\
590	fcinfo		\
591	file		\
592	filesync	\
593	find		\
594	flowadm		\
595	flowstat	\
596	fm		\
597	fold		\
598	fs.d		\
599	fwflash		\
600	geniconvtbl	\
601	genmsg		\
602	getconf		\
603	getent		\
604	gettext		\
605	gettxt		\
606	grep		\
607	grpck		\
608	gss		\
609	halt		\
610	head		\
611	hostname	\
612	hotplug		\
613	iconv		\
614	id		\
615	idmap		\
616	isaexec		\
617	iscsiadm	\
618	iscsid		\
619	isns		\
620	itadm		\
621	kbd		\
622	krb5		\
623	last		\
624	ldap		\
625	ldapcachemgr	\
626	lgrpinfo	\
627	locale		\
628	lofiadm		\
629	logadm		\
630	logger		\
631	logins		\
632	ls		\
633	luxadm		\
634	mailx		\
635	make		\
636	man		\
637	mesg		\
638	mkdir		\
639	mkpwdict	\
640	mktemp		\
641	more		\
642	mpathadm	\
643	msgfmt		\
644	mv		\
645	ndmpadm		\
646	ndmpstat	\
647	newgrp		\
648	newtask		\
649	nice		\
650	nohup		\
651	oawk		\
652	pack		\
653	passwd		\
654	passmgmt	\
655	pathchk		\
656	pfexec		\
657	pg		\
658	pgrep		\
659	picl            \
660	pools		\
661	power		\
662	pr		\
663	praudit		\
664	print		\
665	profiles	\
666	projadd		\
667	projects	\
668	prstat		\
669	prtdiag		\
670	ps		\
671	psrinfo		\
672	ptools		\
673	pwconv		\
674	pwd		\
675	pyzfs		\
676	raidctl		\
677	ramdiskadm	\
678	rcap		\
679	rcm_daemon	\
680	refer		\
681	regcmp		\
682	renice		\
683	roles		\
684	rm		\
685	rmdir		\
686	rmformat	\
687	rmmount		\
688	rmvolmgr	\
689	sasinfo		\
690	sbdadm		\
691	scadm		\
692	script		\
693	scsi		\
694	sdiff		\
695	sdpadm		\
696	sgs		\
697	sh		\
698	smbsrv		\
699	sort		\
700	split		\
701	srptadm		\
702	stat		\
703	stmfadm		\
704	stmsboot	\
705	strings		\
706	su		\
707	svc		\
708	svr4pkg		\
709	swap		\
710	syseventadm	\
711	syseventd	\
712	tabs		\
713	tar		\
714	tbl		\
715	time		\
716	tnf		\
717	touch		\
718	tput		\
719	troff		\
720	tsol		\
721	tty		\
722	ttymon		\
723	tzreload	\
724	ul		\
725	uname		\
726	units		\
727	unlink		\
728	unpack		\
729	userattr	\
730	valtools	\
731	vgrind		\
732	vi		\
733	volcheck	\
734	volrmmount	\
735	vrrpadm		\
736	vscan		\
737	w		\
738	who		\
739	whodo		\
740	wracct		\
741	write		\
742	xargs		\
743	yppasswd	\
744	zdump		\
745	zfs		\
746	zic		\
747	zlogin		\
748	zoneadm		\
749	zoneadmd	\
750	zonecfg		\
751	zonename	\
752	zpool		\
753	zonestat
754
755sparc_MSGSUBDIRS=	\
756	fruadm		\
757	prtdscp		\
758	prtfru		\
759	virtinfo	\
760	vntsd
761
762i386_MSGSUBDIRS=	\
763	rdmsr		\
764	ucodeadm
765
766#
767# commands that use dcgettext for localized time, LC_TIME
768#
769DCSUBDIRS=		\
770	cal		\
771	cfgadm		\
772	diff		\
773	ls		\
774	pr		\
775	ps		\
776	tar		\
777	w		\
778	who		\
779	whodo		\
780	write
781
782#
783# commands that belong only to audit.
784#
785AUDITSUBDIRS=		\
786	amt		\
787	audit		\
788	audit_warn	\
789	auditconfig	\
790	auditd		\
791	auditrecord	\
792	auditreduce	\
793	auditset	\
794	auditstat	\
795	praudit
796
797all :=		TARGET = all
798install :=	TARGET = install
799clean :=	TARGET = clean
800clobber :=	TARGET = clobber
801_msg :=		TARGET = _msg
802_dc :=		TARGET = _dc
803
804.KEEP_STATE:
805
806SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
807
808.PARALLEL:	$(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
809
810all install clean clobber: $(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
836ast:	isaexec
837print:	lp
838fmt:	mailx
839
840$(FIRST_SUBDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
841		cd $@; pwd; $(MAKE) $(TARGET)
842
843FRC:
844