xref: /titanic_51/usr/src/cmd/Makefile (revision b4dd7d09880f14016feece03929a224eca1cf39a)
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 Toomas Soome <tsoome@me.com>
29# Copyright 2016 Nexenta Systems, Inc.
30# Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
31#
32
33include ../Makefile.master
34
35#
36#	Note that the commands 'lp', and 'perl' are first in
37#	the list, violating alphabetical order.  This is because they are very
38#	long-running and should be given the most wall-clock time for a
39#	parallel build.
40#
41#	Commands in the FIRST_SUBDIRS list are built before starting the build
42#	of other commands.  Currently this includes only 'isaexec' and
43#	'platexec'.  This is necessary because $(ROOT)/usr/lib/isaexec or
44#	$(ROOT)/usr/lib/platexec must exist when some other commands are built
45#	because their 'make install' creates a hard link to one of them.
46#
47#	Commands are listed one per line so that TeamWare can auto-merge most
48#	changes.
49#
50
51FIRST_SUBDIRS=		\
52	isaexec		\
53	platexec
54
55COMMON_SUBDIRS=		\
56	allocate	\
57	availdevs	\
58	lp		\
59	perl		\
60	Adm		\
61	abi		\
62	adbgen		\
63	acct		\
64	acctadm		\
65	arcwatch	\
66	arch		\
67	arcflush	\
68	asa		\
69	ast		\
70	audio		\
71	auths		\
72	autopush	\
73	avs		\
74	awk		\
75	awk_xpg4	\
76	backup		\
77	banner		\
78	bart		\
79	basename	\
80	bc		\
81	bdiff		\
82	beadm		\
83	bnu		\
84	boot		\
85	busstat		\
86	cal		\
87	calendar	\
88	captoinfo	\
89	cat		\
90	cdrw		\
91	cfgadm		\
92	checkeq		\
93	checknr		\
94	chgrp		\
95	chmod		\
96	chown		\
97	chroot		\
98	clear		\
99	clinfo		\
100	cmd-crypto	\
101	cmd-inet	\
102	col		\
103	compress	\
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	deroff		\
124	devfsadm	\
125	syseventd	\
126	devctl		\
127	devinfo		\
128	devmgmt		\
129	devprop		\
130	dfs.cmds	\
131	diff		\
132	diff3		\
133	diffmk		\
134	dircmp		\
135	dirname		\
136	dis		\
137	diskmgtd	\
138	dispadmin	\
139	dladm		\
140	dlstat		\
141	dlutil		\
142	dmesg		\
143	dodatadm	\
144	dtrace		\
145	du		\
146	dumpadm		\
147	dumpcs		\
148	echo		\
149	ed		\
150	eeprom		\
151	egrep		\
152	eject		\
153	emul64ioctl	\
154	enhance		\
155	env		\
156	eqn		\
157	expand		\
158	expr		\
159	exstr		\
160	factor		\
161	false		\
162	fcinfo		\
163	fcoesvc		\
164	fdetach		\
165	fdformat	\
166	fdisk		\
167	ficl		\
168	filesync	\
169	fgrep		\
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	grep_xpg4	\
198	groups		\
199	growfs		\
200	grpck		\
201	gss		\
202	hal		\
203	halt		\
204	head		\
205	hostid		\
206	hostname	\
207	hotplug		\
208	hotplugd	\
209	ibd_upgrade	\
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	itutools	\
225	iscsiadm	\
226	iscsid		\
227	iscsitsvc	\
228	isns		\
229	itadm		\
230	kbd		\
231	keyserv		\
232	killall		\
233	krb5		\
234	kvmstat		\
235	last		\
236	lastcomm	\
237	latencytop	\
238	ldap		\
239	ldapcachemgr	\
240	lgrpinfo	\
241	line		\
242	link		\
243	dlmgmtd		\
244	listen		\
245	loadkeys	\
246	locale		\
247	localedef	\
248	lockstat	\
249	locator		\
250	lofiadm		\
251	logadm		\
252	logger		\
253	login		\
254	logins		\
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	pcitool		\
309	pfexec		\
310	pfexecd		\
311	pginfo		\
312	pgstat		\
313	pgrep		\
314	picl		\
315	plimit		\
316	policykit	\
317	pools		\
318	power		\
319	powertop	\
320	ppgsz		\
321	pg		\
322	plockstat	\
323	pr		\
324	prctl		\
325	print		\
326	printf		\
327	priocntl	\
328	profiles	\
329	projadd		\
330	projects	\
331	prstat		\
332	prtconf		\
333	prtdiag		\
334	prtvtoc		\
335	ps		\
336	psradm		\
337	psrinfo		\
338	psrset		\
339	ptools		\
340	pwck		\
341	pwconv		\
342	pwd		\
343	pyzfs		\
344	raidctl		\
345	ramdiskadm	\
346	rcap		\
347	rcm_daemon	\
348	rctladm		\
349	refer		\
350	regcmp		\
351	renice		\
352	rexd		\
353	rm		\
354	rmdir		\
355	rmformat	\
356	rmmount		\
357	rmt		\
358	rmvolmgr	\
359	roles		\
360	rpcbind		\
361	rpcgen		\
362	rpcinfo		\
363	rpcsvc		\
364	runat		\
365	sa		\
366	saf		\
367	sasinfo		\
368	savecore	\
369	sbdadm		\
370	script		\
371	scsi		\
372	sdiff		\
373	sdpadm		\
374	sed		\
375	sendmail	\
376	setfacl		\
377	setmnt		\
378	setpgrp		\
379	setuname	\
380	sgs		\
381	sh		\
382	smbios		\
383	smbsrv		\
384	smserverd	\
385	soelim		\
386	sort		\
387	spell		\
388	split		\
389	sqlite		\
390	srchtxt		\
391	srptadm		\
392	srptsvc		\
393	stat		\
394	stmfadm		\
395	stmfproxy	\
396	stmfsvc		\
397	stmsboot	\
398	streams		\
399	strings		\
400	su		\
401	sulogin		\
402	sunpc		\
403	svc		\
404	svr4pkg		\
405	swap		\
406	sync		\
407	sysdef		\
408	syseventadm	\
409	syslogd		\
410	tabs		\
411	tail		\
412	tar		\
413	tbl		\
414	tcopy		\
415	tcpd		\
416	terminfo	\
417	th_tools	\
418	tic		\
419	time		\
420	tip		\
421	tnf		\
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	vgrind		\
446	vi		\
447	volcheck	\
448	volrmmount	\
449	vrrpadm		\
450	vscan		\
451	vt		\
452	w		\
453	wall		\
454	which		\
455	who		\
456	whodo		\
457	wracct		\
458	write		\
459	xargs		\
460	xstr		\
461	yes		\
462	ypcmd		\
463	yppasswd	\
464	zdb		\
465	zdump		\
466	zevadm		\
467	zfs		\
468	zhack		\
469	zic		\
470	zinject		\
471	zlogin		\
472	zoneadm		\
473	zoneadmd	\
474	zonecfg		\
475	zonename	\
476	zpool		\
477	zlook		\
478	zonestat	\
479	zstreamdump	\
480	ztest
481
482i386_SUBDIRS=		\
483	acpi		\
484	acpihpd		\
485	addbadsec	\
486	biosdev		\
487	diskscan	\
488	nvmeadm		\
489	rtc		\
490	ucodeadm
491
492sparc_SUBDIRS=		\
493	cvcd		\
494	dcs		\
495	device_remap	\
496	drd		\
497	fruadm		\
498	ldmad		\
499	oplhpd		\
500	prtdscp		\
501	prtfru		\
502	scadm		\
503	sckmd		\
504	sf880drd	\
505	virtinfo	\
506	vntsd
507
508#
509# Commands that are messaged.  Note that 'lp' comes first
510# (see previous comment about 'lp'.)
511#
512MSGSUBDIRS=		\
513	lp		\
514	abi		\
515	acctadm		\
516	allocate	\
517	arcflush	\
518	asa		\
519	ast		\
520	audio		\
521	audit		\
522	auditconfig	\
523	auditd		\
524	auditrecord	\
525	auditset	\
526	auths		\
527	autopush	\
528	avs		\
529	awk		\
530	awk_xpg4	\
531	backup		\
532	banner		\
533	bart		\
534	basename	\
535	beadm		\
536	bnu		\
537	busstat		\
538	cal		\
539	cat		\
540	cdrw		\
541	cfgadm		\
542	checkeq		\
543	checknr		\
544	chgrp		\
545	chmod		\
546	chown		\
547	cmd-crypto	\
548	cmd-inet	\
549	col		\
550	compress	\
551	consadm		\
552	coreadm		\
553	cpio		\
554	cpc		\
555	cron		\
556	csh		\
557	csplit		\
558	ctrun		\
559	ctstat		\
560	ctwatch		\
561	datadm		\
562	date		\
563	dc		\
564	dcs		\
565	dd		\
566	deroff		\
567	devfsadm	\
568	dfs.cmds	\
569	diff		\
570	diffmk		\
571	dladm		\
572	dlstat		\
573	du		\
574	dumpcs		\
575	ed		\
576	eject		\
577	env		\
578	eqn		\
579	expand		\
580	expr		\
581	fcinfo		\
582	fgrep		\
583	file		\
584	filesync	\
585	find		\
586	flowadm		\
587	flowstat	\
588	fm		\
589	fold		\
590	fs.d		\
591	fwflash		\
592	geniconvtbl	\
593	genmsg		\
594	getconf		\
595	getent		\
596	gettext		\
597	gettxt		\
598	grep		\
599	grep_xpg4	\
600	grpck		\
601	gss		\
602	halt		\
603	head		\
604	hostname	\
605	hotplug		\
606	id		\
607	idmap		\
608	isaexec		\
609	iscsiadm	\
610	iscsid		\
611	isns		\
612	itadm		\
613	kbd		\
614	krb5		\
615	last		\
616	ldap		\
617	ldapcachemgr	\
618	lgrpinfo	\
619	locale		\
620	lofiadm		\
621	logadm		\
622	logger		\
623	logins		\
624	ls		\
625	luxadm		\
626	mailx		\
627	make		\
628	man		\
629	mesg		\
630	mkdir		\
631	mkpwdict	\
632	mktemp		\
633	more		\
634	mpathadm	\
635	msgfmt		\
636	mv		\
637	ndmpadm		\
638	ndmpstat	\
639	newgrp		\
640	newtask		\
641	nice		\
642	nohup		\
643	oawk		\
644	pack		\
645	passwd		\
646	passmgmt	\
647	pathchk		\
648	pfexec		\
649	pg		\
650	pgrep		\
651	picl            \
652	pools		\
653	power		\
654	pr		\
655	praudit		\
656	print		\
657	profiles	\
658	projadd		\
659	projects	\
660	prstat		\
661	prtdiag		\
662	ps		\
663	psrinfo		\
664	ptools		\
665	pwconv		\
666	pwd		\
667	pyzfs		\
668	raidctl		\
669	ramdiskadm	\
670	rcap		\
671	rcm_daemon	\
672	refer		\
673	regcmp		\
674	renice		\
675	roles		\
676	rm		\
677	rmdir		\
678	rmformat	\
679	rmmount		\
680	rmvolmgr	\
681	sasinfo		\
682	sbdadm		\
683	scadm		\
684	script		\
685	scsi		\
686	sdiff		\
687	sdpadm		\
688	sgs		\
689	sh		\
690	smbsrv		\
691	sort		\
692	split		\
693	srptadm		\
694	stat		\
695	stmfadm		\
696	stmsboot	\
697	strings		\
698	su		\
699	svc		\
700	svr4pkg		\
701	swap		\
702	syseventadm	\
703	syseventd	\
704	tabs		\
705	tar		\
706	tbl		\
707	time		\
708	tnf		\
709	touch		\
710	tput		\
711	troff		\
712	tsol		\
713	tty		\
714	ttymon		\
715	tzreload	\
716	ul		\
717	uname		\
718	units		\
719	unlink		\
720	unpack		\
721	userattr	\
722	valtools	\
723	vgrind		\
724	vi		\
725	volcheck	\
726	volrmmount	\
727	vrrpadm		\
728	vscan		\
729	w		\
730	who		\
731	whodo		\
732	wracct		\
733	write		\
734	xargs		\
735	yppasswd	\
736	zdump		\
737	zevadm		\
738	zfs		\
739	zic		\
740	zlogin		\
741	zoneadm		\
742	zoneadmd	\
743	zonecfg		\
744	zonename	\
745	zpool		\
746	zonestat
747
748sparc_MSGSUBDIRS=	\
749	fruadm		\
750	prtdscp		\
751	prtfru		\
752	virtinfo	\
753	vntsd
754
755i386_MSGSUBDIRS=	\
756	ucodeadm
757
758#
759# commands that use dcgettext for localized time, LC_TIME
760#
761DCSUBDIRS=		\
762	cal		\
763	cfgadm		\
764	diff		\
765	ls		\
766	pr		\
767	ps		\
768	tar		\
769	w		\
770	who		\
771	whodo		\
772	write
773
774#
775# commands that belong only to audit.
776#
777AUDITSUBDIRS=		\
778	amt		\
779	audit		\
780	audit_warn	\
781	auditconfig	\
782	auditd		\
783	auditrecord	\
784	auditreduce	\
785	auditset	\
786	auditstat	\
787	praudit
788
789#
790# commands not owned by the systems group
791#
792BWOSDIRS=
793
794
795all :=		TARGET = all
796install :=	TARGET = install
797clean :=	TARGET = clean
798clobber :=	TARGET = clobber
799lint :=		TARGET = lint
800_msg :=		TARGET = _msg
801_dc :=		TARGET = _dc
802
803.KEEP_STATE:
804
805SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
806
807.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
808
809all install clean clobber lint: $(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
836mdb:	terminfo
837print:	lp
838fmt:	mailx
839
840$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
841	@if [ -f $@/Makefile  ]; then \
842		cd $@; pwd; $(MAKE) $(TARGET); \
843	else \
844		true; \
845	fi
846
847FRC:
848