xref: /illumos-gate/usr/src/cmd/Makefile (revision cd61ae21816e53b94bc1673f3f1aa651fc3115e8)
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 2019 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#
33
34include ../Makefile.master
35
36#
37#	Note that the commands 'lp', and 'perl' are first in
38#	the list, violating alphabetical order.  This is because they are very
39#	long-running and should be given the most wall-clock time for a
40#	parallel build.
41#
42#	Commands in the FIRST_SUBDIRS list are built before starting the build
43#	of other commands.  Currently this includes only 'isaexec' and
44#	'platexec'.  This is necessary because $(ROOT)/usr/lib/isaexec or
45#	$(ROOT)/usr/lib/platexec must exist when some other commands are built
46#	because their 'make install' creates a hard link to one of them.
47#
48#	Commands are listed one per line so that TeamWare can auto-merge most
49#	changes.
50#
51
52FIRST_SUBDIRS=		\
53	isaexec		\
54	platexec
55
56COMMON_SUBDIRS=		\
57	allocate	\
58	availdevs	\
59	lp		\
60	perl		\
61	Adm		\
62	abi		\
63	adbgen		\
64	acct		\
65	acctadm		\
66	arch		\
67	asa		\
68	ast		\
69	audio		\
70	auths		\
71	autopush	\
72	awk		\
73	awk_xpg4	\
74	backup		\
75	banner		\
76	bart		\
77	basename	\
78	bc		\
79	bdiff		\
80	beadm		\
81	bnu		\
82	boot		\
83	busstat		\
84	cal		\
85	captoinfo	\
86	cat		\
87	ccidadm		\
88	cdrw		\
89	cfgadm		\
90	checkeq		\
91	checknr		\
92	chgrp		\
93	chmod		\
94	chown		\
95	chroot		\
96	clear		\
97	clinfo		\
98	cmd-crypto	\
99	cmd-inet	\
100	col		\
101	compress	\
102	connstat	\
103	consadm		\
104	coreadm		\
105	cpio		\
106	cpc		\
107	cron		\
108	crypt		\
109	csh		\
110	csplit		\
111	ctfconvert	\
112	ctfdiff		\
113	ctfdump		\
114	ctfmerge	\
115	ctrun		\
116	ctstat		\
117	ctwatch		\
118	datadm		\
119	date		\
120	dc		\
121	dd		\
122	demangle	\
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	diskinfo	\
138	diskmgtd	\
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	itutools	\
225	iscsiadm	\
226	iscsid		\
227	iscsitsvc	\
228	isns		\
229	itadm		\
230	kbd		\
231	keyserv		\
232	killall		\
233	krb5		\
234	ksh		\
235	kvmstat		\
236	last		\
237	lastcomm	\
238	latencytop	\
239	ldap		\
240	ldapcachemgr	\
241	lgrpinfo	\
242	line		\
243	link		\
244	dlmgmtd		\
245	listen		\
246	loadkeys	\
247	locale		\
248	localedef	\
249	lockstat	\
250	locator		\
251	lofiadm		\
252	logadm		\
253	logger		\
254	login		\
255	logins		\
256	logname		\
257	look		\
258	ls		\
259	luxadm		\
260	mach		\
261	mail		\
262	mailwrapper	\
263	mailx		\
264	make		\
265	makekey		\
266	man		\
267	mandoc		\
268	mdb		\
269	mesg		\
270	mkdir		\
271	mkfifo		\
272	mkfile		\
273	mkmsgs		\
274	mknod		\
275	mkpwdict	\
276	mktemp		\
277	modload		\
278	more		\
279	mpathadm	\
280	msgfmt		\
281	msgid		\
282	mt		\
283	mv		\
284	mvdir		\
285	ndmpadm		\
286	ndmpd		\
287	ndmpstat	\
288	netadm		\
289	netfiles	\
290	newform		\
291	newgrp		\
292	news		\
293	newtask		\
294	nice		\
295	nl		\
296	nlsadmin	\
297	nohup		\
298	nsadmin		\
299	nscd		\
300	oamuser		\
301	oawk		\
302	od		\
303	pack		\
304	pagesize	\
305	passmgmt	\
306	passwd		\
307	pathchk		\
308	pbind		\
309	pcidr		\
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	ramdiskadm	\
349	rcap		\
350	rcm_daemon	\
351	rctladm		\
352	refer		\
353	regcmp		\
354	renice		\
355	rm		\
356	rmdir		\
357	rmformat	\
358	rmmount		\
359	rmt		\
360	rmvolmgr	\
361	roles		\
362	rpcbind		\
363	rpcgen		\
364	rpcinfo		\
365	rpcsvc		\
366	runat		\
367	sa		\
368	saf		\
369	sasinfo		\
370	savecore	\
371	sbdadm		\
372	script		\
373	scsi		\
374	sdiff		\
375	sdpadm		\
376	sed		\
377	sendmail	\
378	setfacl		\
379	setmnt		\
380	setpgrp		\
381	setuname	\
382	sgs		\
383	sh		\
384	shcomp		\
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	biosdev		\
492	cxgbetool	\
493	diskscan	\
494	nvmeadm		\
495	rdmsr		\
496	rtc		\
497	ucodeadm	\
498	xhci		\
499	xvm
500
501sparc_SUBDIRS=		\
502	dcs		\
503	device_remap	\
504	drd		\
505	fruadm		\
506	ldmad		\
507	oplhpd		\
508	prtdscp		\
509	prtfru		\
510	scadm		\
511	sckmd		\
512	sf880drd	\
513	virtinfo	\
514	vntsd
515
516#
517# Commands that are messaged.  Note that 'lp' comes first
518# (see previous comment about 'lp'.)
519#
520MSGSUBDIRS=		\
521	lp		\
522	abi		\
523	acctadm		\
524	allocate	\
525	asa		\
526	audio		\
527	audit		\
528	auditconfig	\
529	auditd		\
530	auditrecord	\
531	auditset	\
532	auths		\
533	autopush	\
534	awk		\
535	awk_xpg4	\
536	backup		\
537	banner		\
538	bart		\
539	basename	\
540	beadm		\
541	bnu		\
542	busstat		\
543	cal		\
544	cat		\
545	cdrw		\
546	cfgadm		\
547	checkeq		\
548	checknr		\
549	chgrp		\
550	chmod		\
551	chown		\
552	cmd-crypto	\
553	cmd-inet	\
554	col		\
555	compress	\
556	connstat	\
557	consadm		\
558	coreadm		\
559	cpio		\
560	cpc		\
561	cron		\
562	csh		\
563	csplit		\
564	ctrun		\
565	ctstat		\
566	ctwatch		\
567	datadm		\
568	date		\
569	dc		\
570	dcs		\
571	dd		\
572	deroff		\
573	devfsadm	\
574	dfs.cmds	\
575	diff		\
576	diffmk		\
577	dladm		\
578	dlstat		\
579	du		\
580	dumpcs		\
581	ed		\
582	eject		\
583	env		\
584	eqn		\
585	expand		\
586	expr		\
587	fcinfo		\
588	file		\
589	filesync	\
590	find		\
591	flowadm		\
592	flowstat	\
593	fm		\
594	fold		\
595	fs.d		\
596	fwflash		\
597	geniconvtbl	\
598	genmsg		\
599	getconf		\
600	getent		\
601	gettext		\
602	gettxt		\
603	grep		\
604	grpck		\
605	gss		\
606	halt		\
607	head		\
608	hostname	\
609	hotplug		\
610	iconv		\
611	id		\
612	idmap		\
613	isaexec		\
614	iscsiadm	\
615	iscsid		\
616	isns		\
617	itadm		\
618	kbd		\
619	krb5		\
620	ksh		\
621	last		\
622	ldap		\
623	ldapcachemgr	\
624	lgrpinfo	\
625	locale		\
626	lofiadm		\
627	logadm		\
628	logger		\
629	logins		\
630	ls		\
631	luxadm		\
632	mailx		\
633	make		\
634	man		\
635	mesg		\
636	mkdir		\
637	mkpwdict	\
638	mktemp		\
639	more		\
640	mpathadm	\
641	msgfmt		\
642	mv		\
643	ndmpadm		\
644	ndmpstat	\
645	newgrp		\
646	newtask		\
647	nice		\
648	nohup		\
649	oawk		\
650	pack		\
651	passwd		\
652	passmgmt	\
653	pathchk		\
654	pfexec		\
655	pg		\
656	pgrep		\
657	picl            \
658	pools		\
659	power		\
660	pr		\
661	praudit		\
662	print		\
663	profiles	\
664	projadd		\
665	projects	\
666	prstat		\
667	prtdiag		\
668	ps		\
669	psrinfo		\
670	ptools		\
671	pwconv		\
672	pwd		\
673	pyzfs		\
674	raidctl		\
675	ramdiskadm	\
676	rcap		\
677	rcm_daemon	\
678	refer		\
679	regcmp		\
680	renice		\
681	roles		\
682	rm		\
683	rmdir		\
684	rmformat	\
685	rmmount		\
686	rmvolmgr	\
687	sasinfo		\
688	sbdadm		\
689	scadm		\
690	script		\
691	scsi		\
692	sdiff		\
693	sdpadm		\
694	sgs		\
695	sh		\
696	shcomp		\
697	smbsrv		\
698	sort		\
699	split		\
700	srptadm		\
701	stat		\
702	stmfadm		\
703	stmsboot	\
704	strings		\
705	su		\
706	svc		\
707	svr4pkg		\
708	swap		\
709	syseventadm	\
710	syseventd	\
711	tabs		\
712	tar		\
713	tbl		\
714	time		\
715	tnf		\
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
796#
797# commands not owned by the systems group
798#
799BWOSDIRS=
800
801
802all :=		TARGET = all
803install :=	TARGET = install
804clean :=	TARGET = clean
805clobber :=	TARGET = clobber
806lint :=		TARGET = lint
807_msg :=		TARGET = _msg
808_dc :=		TARGET = _dc
809
810.KEEP_STATE:
811
812SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
813
814.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
815
816all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
817	$(AUDITSUBDIRS)
818
819#
820# Manifests cannot be checked in parallel, because we are using
821# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
822# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
823# we spawn off a sub-make to perform the non-parallel 'make check'
824#
825check:
826	$(MAKE) -f Makefile.check check
827
828#
829# The .WAIT directive works around an apparent bug in parallel make.
830# Evidently make was getting the target _msg vs. _dc confused under
831# some level of parallelization, causing some of the _dc objects
832# not to be built.
833#
834_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
835
836_dc: $(DCSUBDIRS)
837
838#
839# Dependencies
840#
841fs.d:	fstyp
842ksh:	shcomp isaexec
843print:	lp
844fmt:	mailx
845
846$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
847	@if [ -f $@/Makefile  ]; then \
848		cd $@; pwd; $(MAKE) $(TARGET); \
849	else \
850		true; \
851	fi
852
853FRC:
854