xref: /illumos-gate/usr/src/cmd/Makefile (revision dd23d762c65e503874085a3893fbd3df9688da30)
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	spell		\
389	split		\
390	sqlite		\
391	srchtxt		\
392	srptadm		\
393	srptsvc		\
394	ssh		\
395	stat		\
396	stmfadm		\
397	stmfproxy	\
398	stmfsvc		\
399	stmsboot	\
400	streams		\
401	strings		\
402	su		\
403	sulogin		\
404	sunpc		\
405	svc		\
406	svr4pkg		\
407	swap		\
408	sync		\
409	sysdef		\
410	syseventadm	\
411	syslogd		\
412	tabs		\
413	tail		\
414	tar		\
415	tbl		\
416	tcopy		\
417	tcpd		\
418	th_tools	\
419	tic		\
420	time		\
421	tip		\
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	varpd		\
446	vgrind		\
447	vi		\
448	volcheck	\
449	volrmmount	\
450	vrrpadm		\
451	vscan		\
452	vt		\
453	vtfontcvt	\
454	w		\
455	wall		\
456	which		\
457	who		\
458	whodo		\
459	wracct		\
460	write		\
461	xargs		\
462	xstr		\
463	yes		\
464	ypcmd		\
465	yppasswd	\
466	zdb		\
467	zdump		\
468	zfs		\
469	zhack		\
470	zic		\
471	zinject		\
472	zlogin		\
473	zoneadm		\
474	zoneadmd	\
475	zonecfg		\
476	zonename	\
477	zpool		\
478	zlook		\
479	zonestat	\
480	zstreamdump	\
481	ztest
482
483i386_SUBDIRS=		\
484	acpi		\
485	acpihpd		\
486	addbadsec	\
487	ahciem		\
488	amdzen		\
489	bhyve		\
490	bhyvectl	\
491	biosdev		\
492	cxgbetool	\
493	diskscan	\
494	ficl		\
495	nvmeadm		\
496	pptadm		\
497	rdmsr		\
498	rsrvrctl	\
499	rtc		\
500	ucodeadm	\
501	xhci		\
502	xvm
503
504sparc_SUBDIRS=		\
505	dcs		\
506	device_remap	\
507	drd		\
508	fruadm		\
509	ldmad		\
510	oplhpd		\
511	prtdscp		\
512	prtfru		\
513	scadm		\
514	sckmd		\
515	sf880drd	\
516	virtinfo	\
517	vntsd
518
519#
520# Commands that are messaged.  Note that 'lp' comes first
521# (see previous comment about 'lp'.)
522#
523MSGSUBDIRS=		\
524	lp		\
525	abi		\
526	acctadm		\
527	allocate	\
528	asa		\
529	ast		\
530	audio		\
531	audit		\
532	auditconfig	\
533	auditd		\
534	auditrecord	\
535	auditset	\
536	auths		\
537	autopush	\
538	awk		\
539	awk_xpg4	\
540	backup		\
541	banner		\
542	bart		\
543	basename	\
544	beadm		\
545	bnu		\
546	busstat		\
547	cal		\
548	cat		\
549	cdrw		\
550	cfgadm		\
551	checkeq		\
552	checknr		\
553	chgrp		\
554	chmod		\
555	chown		\
556	cmd-crypto	\
557	cmd-inet	\
558	col		\
559	compress	\
560	connstat	\
561	consadm		\
562	coreadm		\
563	cpio		\
564	cpc		\
565	cron		\
566	csh		\
567	csplit		\
568	ctrun		\
569	ctstat		\
570	ctwatch		\
571	datadm		\
572	date		\
573	dc		\
574	dcs		\
575	dd		\
576	deroff		\
577	devfsadm	\
578	dfs.cmds	\
579	diff		\
580	diffmk		\
581	dladm		\
582	dlstat		\
583	du		\
584	dumpcs		\
585	ed		\
586	eject		\
587	env		\
588	eqn		\
589	expand		\
590	expr		\
591	fcinfo		\
592	file		\
593	filesync	\
594	find		\
595	flowadm		\
596	flowstat	\
597	fm		\
598	fold		\
599	fs.d		\
600	fwflash		\
601	geniconvtbl	\
602	genmsg		\
603	getconf		\
604	getent		\
605	gettext		\
606	gettxt		\
607	grep		\
608	grpck		\
609	gss		\
610	halt		\
611	head		\
612	hostname	\
613	hotplug		\
614	iconv		\
615	id		\
616	idmap		\
617	isaexec		\
618	iscsiadm	\
619	iscsid		\
620	isns		\
621	itadm		\
622	kbd		\
623	krb5		\
624	last		\
625	ldap		\
626	ldapcachemgr	\
627	lgrpinfo	\
628	locale		\
629	lofiadm		\
630	logadm		\
631	logger		\
632	logins		\
633	ls		\
634	luxadm		\
635	mailx		\
636	make		\
637	man		\
638	mesg		\
639	mkdir		\
640	mkpwdict	\
641	mktemp		\
642	more		\
643	mpathadm	\
644	msgfmt		\
645	mv		\
646	ndmpadm		\
647	ndmpstat	\
648	newgrp		\
649	newtask		\
650	nice		\
651	nohup		\
652	oawk		\
653	pack		\
654	passwd		\
655	passmgmt	\
656	pathchk		\
657	pfexec		\
658	pg		\
659	pgrep		\
660	picl            \
661	pools		\
662	power		\
663	pr		\
664	praudit		\
665	print		\
666	profiles	\
667	projadd		\
668	projects	\
669	prstat		\
670	prtdiag		\
671	ps		\
672	psrinfo		\
673	ptools		\
674	pwconv		\
675	pwd		\
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	touch		\
717	tput		\
718	troff		\
719	tsol		\
720	tty		\
721	ttymon		\
722	tzreload	\
723	ul		\
724	uname		\
725	units		\
726	unlink		\
727	unpack		\
728	userattr	\
729	valtools	\
730	vgrind		\
731	vi		\
732	volcheck	\
733	volrmmount	\
734	vrrpadm		\
735	vscan		\
736	w		\
737	who		\
738	whodo		\
739	wracct		\
740	write		\
741	xargs		\
742	yppasswd	\
743	zdump		\
744	zfs		\
745	zic		\
746	zlogin		\
747	zoneadm		\
748	zoneadmd	\
749	zonecfg		\
750	zonename	\
751	zpool		\
752	zonestat
753
754sparc_MSGSUBDIRS=	\
755	fruadm		\
756	prtdscp		\
757	prtfru		\
758	virtinfo	\
759	vntsd
760
761i386_MSGSUBDIRS=	\
762	rdmsr		\
763	ucodeadm
764
765#
766# commands that use dcgettext for localized time, LC_TIME
767#
768DCSUBDIRS=		\
769	cal		\
770	cfgadm		\
771	diff		\
772	ls		\
773	pr		\
774	ps		\
775	tar		\
776	w		\
777	who		\
778	whodo		\
779	write
780
781#
782# commands that belong only to audit.
783#
784AUDITSUBDIRS=		\
785	amt		\
786	audit		\
787	audit_warn	\
788	auditconfig	\
789	auditd		\
790	auditrecord	\
791	auditreduce	\
792	auditset	\
793	auditstat	\
794	praudit
795
796all :=		TARGET = all
797install :=	TARGET = install
798clean :=	TARGET = clean
799clobber :=	TARGET = clobber
800_msg :=		TARGET = _msg
801_dc :=		TARGET = _dc
802
803.KEEP_STATE:
804
805SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
806
807.PARALLEL:	$(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
808
809all install clean clobber: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
810	$(AUDITSUBDIRS)
811
812#
813# Manifests cannot be checked in parallel, because we are using
814# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
815# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
816# we spawn off a sub-make to perform the non-parallel 'make check'
817#
818check:
819	$(MAKE) -f Makefile.check check
820
821#
822# The .WAIT directive works around an apparent bug in parallel make.
823# Evidently make was getting the target _msg vs. _dc confused under
824# some level of parallelization, causing some of the _dc objects
825# not to be built.
826#
827_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
828
829_dc: $(DCSUBDIRS)
830
831#
832# Dependencies
833#
834fs.d:	fstyp
835ast:	isaexec
836print:	lp
837fmt:	mailx
838
839$(FIRST_SUBDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
840		cd $@; pwd; $(MAKE) $(TARGET)
841
842FRC:
843