xref: /illumos-gate/usr/src/cmd/Makefile (revision 91846ba59586576cc91761acbd75aa9e45ab9075)
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	filesync	\
169	file		\
170	find		\
171	flowadm		\
172	flowstat	\
173	fm		\
174	fmt		\
175	fmthard		\
176	fmtmsg		\
177	fold		\
178	format		\
179	fs.d		\
180	fstyp		\
181	fuser		\
182	fwflash		\
183	gcore		\
184	gencat		\
185	geniconvtbl	\
186	genmsg		\
187	getconf		\
188	getdevpolicy	\
189	getent		\
190	getfacl		\
191	getmajor	\
192	getopt		\
193	gettext		\
194	gettxt		\
195	grep		\
196	groups		\
197	growfs		\
198	grpck		\
199	gss		\
200	hal		\
201	halt		\
202	head		\
203	hostid		\
204	hostname	\
205	hotplug		\
206	hotplugd	\
207	ibd_upgrade	\
208	iconv		\
209	id		\
210	idmap		\
211	infocmp		\
212	init		\
213	initpkg		\
214	install.d	\
215	intrd		\
216	intrstat	\
217	ipcrm		\
218	ipcs		\
219	ipdadm		\
220	ipf		\
221	isainfo		\
222	isalist		\
223	iscsiadm	\
224	iscsid		\
225	iscsitsvc	\
226	isns		\
227	itadm		\
228	kbd		\
229	keyserv		\
230	killall		\
231	krb5		\
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	logname		\
254	look		\
255	ls		\
256	luxadm		\
257	mach		\
258	mail		\
259	mailwrapper	\
260	mailx		\
261	make		\
262	makekey		\
263	man		\
264	mandoc		\
265	mdb		\
266	mesg		\
267	mkdir		\
268	mkfifo		\
269	mkfile		\
270	mkmsgs		\
271	mknod		\
272	mkpwdict	\
273	mktemp		\
274	modload		\
275	more		\
276	mpathadm	\
277	msgfmt		\
278	msgid		\
279	mt		\
280	mv		\
281	mvdir		\
282	ndmpadm		\
283	ndmpd		\
284	ndmpstat	\
285	netadm		\
286	netfiles	\
287	newform		\
288	newgrp		\
289	news		\
290	newtask		\
291	nice		\
292	nl		\
293	nlsadmin	\
294	nohup		\
295	nsadmin		\
296	nscd		\
297	oamuser		\
298	oawk		\
299	od		\
300	pack		\
301	pagesize	\
302	passmgmt	\
303	passwd		\
304	pathchk		\
305	pbind		\
306	pcidb		\
307	pcidr		\
308	pcieadm		\
309	pcieb		\
310	pcitool		\
311	pfexec		\
312	pfexecd		\
313	pginfo		\
314	pgstat		\
315	pgrep		\
316	picl		\
317	plimit		\
318	policykit	\
319	pools		\
320	power		\
321	powertop	\
322	ppgsz		\
323	pg		\
324	plockstat	\
325	pr		\
326	prctl		\
327	print		\
328	printf		\
329	priocntl	\
330	profiles	\
331	projadd		\
332	projects	\
333	prstat		\
334	prtconf		\
335	prtdiag		\
336	prtvtoc		\
337	ps		\
338	psradm		\
339	psrinfo		\
340	psrset		\
341	ptools		\
342	pwck		\
343	pwconv		\
344	pwd		\
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	sgs		\
381	sh		\
382	sleep		\
383	smbios		\
384	smbsrv		\
385	smserverd	\
386	soelim		\
387	sort		\
388	spd		\
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	touch		\
424	tput		\
425	tr		\
426	trapstat	\
427	troff		\
428	true		\
429	truss		\
430	tsol		\
431	tty		\
432	ttymon		\
433	tzreload	\
434	uadmin		\
435	ul		\
436	uname		\
437	units		\
438	unlink		\
439	unpack		\
440	userattr	\
441	users		\
442	utmp_update	\
443	utmpd		\
444	uuidgen		\
445	valtools	\
446	varpd		\
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	ficl		\
496	nvmeadm		\
497	pptadm		\
498	rdmsr		\
499	rsrvrctl	\
500	rtc		\
501	ucodeadm	\
502	xhci		\
503	xvm
504
505sparc_SUBDIRS=		\
506	dcs		\
507	device_remap	\
508	drd		\
509	fruadm		\
510	ldmad		\
511	oplhpd		\
512	prtdscp		\
513	prtfru		\
514	scadm		\
515	sckmd		\
516	sf880drd	\
517	virtinfo	\
518	vntsd
519
520#
521# Commands that are messaged.  Note that 'lp' comes first
522# (see previous comment about 'lp'.)
523#
524MSGSUBDIRS=		\
525	lp		\
526	abi		\
527	acctadm		\
528	allocate	\
529	asa		\
530	ast		\
531	audio		\
532	audit		\
533	auditconfig	\
534	auditd		\
535	auditrecord	\
536	auditset	\
537	auths		\
538	autopush	\
539	awk		\
540	awk_xpg4	\
541	backup		\
542	banner		\
543	bart		\
544	basename	\
545	beadm		\
546	bnu		\
547	busstat		\
548	cal		\
549	cat		\
550	cdrw		\
551	cfgadm		\
552	checkeq		\
553	checknr		\
554	chgrp		\
555	chmod		\
556	chown		\
557	cmd-crypto	\
558	cmd-inet	\
559	col		\
560	compress	\
561	connstat	\
562	consadm		\
563	coreadm		\
564	cpio		\
565	cpc		\
566	cron		\
567	csh		\
568	csplit		\
569	ctrun		\
570	ctstat		\
571	ctwatch		\
572	datadm		\
573	date		\
574	dc		\
575	dcs		\
576	dd		\
577	deroff		\
578	devfsadm	\
579	dfs.cmds	\
580	diff		\
581	diffmk		\
582	dladm		\
583	dlstat		\
584	du		\
585	dumpcs		\
586	ed		\
587	eject		\
588	env		\
589	eqn		\
590	expand		\
591	expr		\
592	fcinfo		\
593	file		\
594	filesync	\
595	find		\
596	flowadm		\
597	flowstat	\
598	fm		\
599	fold		\
600	fs.d		\
601	fwflash		\
602	geniconvtbl	\
603	genmsg		\
604	getconf		\
605	getent		\
606	gettext		\
607	gettxt		\
608	grep		\
609	grpck		\
610	gss		\
611	halt		\
612	head		\
613	hostname	\
614	hotplug		\
615	iconv		\
616	id		\
617	idmap		\
618	isaexec		\
619	iscsiadm	\
620	iscsid		\
621	isns		\
622	itadm		\
623	kbd		\
624	krb5		\
625	last		\
626	ldap		\
627	ldapcachemgr	\
628	lgrpinfo	\
629	locale		\
630	lofiadm		\
631	logadm		\
632	logger		\
633	logins		\
634	ls		\
635	luxadm		\
636	mailx		\
637	make		\
638	man		\
639	mesg		\
640	mkdir		\
641	mkpwdict	\
642	mktemp		\
643	more		\
644	mpathadm	\
645	msgfmt		\
646	mv		\
647	ndmpadm		\
648	ndmpstat	\
649	newgrp		\
650	newtask		\
651	nice		\
652	nohup		\
653	oawk		\
654	pack		\
655	passwd		\
656	passmgmt	\
657	pathchk		\
658	pfexec		\
659	pg		\
660	pgrep		\
661	picl            \
662	pools		\
663	power		\
664	pr		\
665	praudit		\
666	print		\
667	profiles	\
668	projadd		\
669	projects	\
670	prstat		\
671	prtdiag		\
672	ps		\
673	psrinfo		\
674	ptools		\
675	pwconv		\
676	pwd		\
677	raidctl		\
678	ramdiskadm	\
679	rcap		\
680	rcm_daemon	\
681	refer		\
682	regcmp		\
683	renice		\
684	roles		\
685	rm		\
686	rmdir		\
687	rmformat	\
688	rmmount		\
689	rmvolmgr	\
690	sasinfo		\
691	sbdadm		\
692	scadm		\
693	script		\
694	scsi		\
695	sdiff		\
696	sdpadm		\
697	sgs		\
698	sh		\
699	smbsrv		\
700	sort		\
701	split		\
702	srptadm		\
703	stat		\
704	stmfadm		\
705	stmsboot	\
706	strings		\
707	su		\
708	svc		\
709	svr4pkg		\
710	swap		\
711	syseventadm	\
712	syseventd	\
713	tabs		\
714	tar		\
715	tbl		\
716	time		\
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