xref: /illumos-gate/usr/src/cmd/Makefile (revision 4dfd3a951f98bde88f1fe577490f5403db4db9d6)
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) 2018, 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 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	cdrw		\
88	cfgadm		\
89	checkeq		\
90	checknr		\
91	chgrp		\
92	chmod		\
93	chown		\
94	chroot		\
95	clear		\
96	clinfo		\
97	cmd-crypto	\
98	cmd-inet	\
99	col		\
100	compress	\
101	consadm		\
102	coreadm		\
103	cpio		\
104	cpc		\
105	cron		\
106	crypt		\
107	csh		\
108	csplit		\
109	ctfconvert	\
110	ctfdiff		\
111	ctfdump		\
112	ctfmerge	\
113	ctrun		\
114	ctstat		\
115	ctwatch		\
116	datadm		\
117	date		\
118	dc		\
119	dd		\
120	deroff		\
121	devfsadm	\
122	syseventd	\
123	devctl		\
124	devinfo		\
125	devmgmt		\
126	devprop		\
127	dfs.cmds	\
128	diff		\
129	diff3		\
130	diffmk		\
131	dircmp		\
132	dirname		\
133	dis		\
134	diskinfo	\
135	diskmgtd	\
136	dispadmin	\
137	dladm		\
138	dlstat		\
139	dlutil		\
140	dmesg		\
141	dodatadm	\
142	dtrace		\
143	du		\
144	dumpadm		\
145	dumpcs		\
146	echo		\
147	ed		\
148	eeprom		\
149	eject		\
150	emul64ioctl	\
151	enhance		\
152	env		\
153	eqn		\
154	etdump		\
155	expand		\
156	expr		\
157	exstr		\
158	factor		\
159	false		\
160	fcinfo		\
161	fcoesvc		\
162	fdetach		\
163	fdformat	\
164	fdisk		\
165	ficl		\
166	filesync	\
167	file		\
168	find		\
169	flowadm		\
170	flowstat	\
171	fm		\
172	fmt		\
173	fmthard		\
174	fmtmsg		\
175	fold		\
176	format		\
177	fs.d		\
178	fstyp		\
179	fuser		\
180	fwflash		\
181	gcore		\
182	gencat		\
183	geniconvtbl	\
184	genmsg		\
185	getconf		\
186	getdevpolicy	\
187	getent		\
188	getfacl		\
189	getmajor	\
190	getopt		\
191	gettext		\
192	gettxt		\
193	grep		\
194	groups		\
195	growfs		\
196	grpck		\
197	gss		\
198	hal		\
199	halt		\
200	head		\
201	hostid		\
202	hostname	\
203	hotplug		\
204	hotplugd	\
205	ibd_upgrade	\
206	iconv		\
207	id		\
208	idmap		\
209	infocmp		\
210	init		\
211	initpkg		\
212	install.d	\
213	intrd		\
214	intrstat	\
215	ipcrm		\
216	ipcs		\
217	ipdadm		\
218	ipf		\
219	isainfo		\
220	isalist		\
221	itutools	\
222	iscsiadm	\
223	iscsid		\
224	iscsitsvc	\
225	isns		\
226	itadm		\
227	kbd		\
228	keyserv		\
229	killall		\
230	krb5		\
231	ksh		\
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	look		\
254	ls		\
255	luxadm		\
256	mach		\
257	mail		\
258	mailwrapper	\
259	mailx		\
260	make		\
261	makekey		\
262	man		\
263	mandoc		\
264	mdb		\
265	mesg		\
266	mkdir		\
267	mkfifo		\
268	mkfile		\
269	mkmsgs		\
270	mknod		\
271	mkpwdict	\
272	mktemp		\
273	modload		\
274	more		\
275	mpathadm	\
276	msgfmt		\
277	msgid		\
278	mt		\
279	mv		\
280	mvdir		\
281	ndmpadm		\
282	ndmpd		\
283	ndmpstat	\
284	netadm		\
285	netfiles	\
286	newform		\
287	newgrp		\
288	news		\
289	newtask		\
290	nice		\
291	nl		\
292	nlsadmin	\
293	nohup		\
294	nsadmin		\
295	nscd		\
296	oamuser		\
297	oawk		\
298	od		\
299	pack		\
300	pagesize	\
301	passmgmt	\
302	passwd		\
303	pathchk		\
304	pbind		\
305	pcidr		\
306	pcitool		\
307	pfexec		\
308	pfexecd		\
309	pginfo		\
310	pgstat		\
311	pgrep		\
312	picl		\
313	plimit		\
314	policykit	\
315	pools		\
316	power		\
317	powertop	\
318	ppgsz		\
319	pg		\
320	plockstat	\
321	pr		\
322	prctl		\
323	print		\
324	printf		\
325	priocntl	\
326	profiles	\
327	projadd		\
328	projects	\
329	prstat		\
330	prtconf		\
331	prtdiag		\
332	prtvtoc		\
333	ps		\
334	psradm		\
335	psrinfo		\
336	psrset		\
337	ptools		\
338	pwck		\
339	pwconv		\
340	pwd		\
341	pyzfs		\
342	raidctl		\
343	ramdiskadm	\
344	rcap		\
345	rcm_daemon	\
346	rctladm		\
347	refer		\
348	regcmp		\
349	renice		\
350	rm		\
351	rmdir		\
352	rmformat	\
353	rmmount		\
354	rmt		\
355	rmvolmgr	\
356	roles		\
357	rpcbind		\
358	rpcgen		\
359	rpcinfo		\
360	rpcsvc		\
361	runat		\
362	sa		\
363	saf		\
364	sasinfo		\
365	savecore	\
366	sbdadm		\
367	script		\
368	scsi		\
369	sdiff		\
370	sdpadm		\
371	sed		\
372	sendmail	\
373	setfacl		\
374	setmnt		\
375	setpgrp		\
376	setuname	\
377	sgs		\
378	sh		\
379	shcomp		\
380	smbios		\
381	smbsrv		\
382	smserverd	\
383	soelim		\
384	sort		\
385	spell		\
386	split		\
387	sqlite		\
388	srchtxt		\
389	srptadm		\
390	srptsvc		\
391	ssh		\
392	stat		\
393	stmfadm		\
394	stmfproxy	\
395	stmfsvc		\
396	stmsboot	\
397	streams		\
398	strings		\
399	su		\
400	sulogin		\
401	sunpc		\
402	svc		\
403	svr4pkg		\
404	swap		\
405	sync		\
406	sysdef		\
407	syseventadm	\
408	syslogd		\
409	tabs		\
410	tail		\
411	tar		\
412	tbl		\
413	tcopy		\
414	tcpd		\
415	th_tools	\
416	tic		\
417	time		\
418	tip		\
419	tnf		\
420	touch		\
421	tput		\
422	tr		\
423	trapstat	\
424	troff		\
425	true		\
426	truss		\
427	tsol		\
428	tty		\
429	ttymon		\
430	tzreload	\
431	uadmin		\
432	ul		\
433	uname		\
434	units		\
435	unlink		\
436	unpack		\
437	userattr	\
438	users		\
439	utmp_update	\
440	utmpd		\
441	uuidgen		\
442	valtools	\
443	vgrind		\
444	vi		\
445	volcheck	\
446	volrmmount	\
447	vrrpadm		\
448	vscan		\
449	vt		\
450	vtfontcvt	\
451	w		\
452	wall		\
453	which		\
454	who		\
455	whodo		\
456	wracct		\
457	write		\
458	xargs		\
459	xstr		\
460	yes		\
461	ypcmd		\
462	yppasswd	\
463	zdb		\
464	zdump		\
465	zfs		\
466	zhack		\
467	zic		\
468	zinject		\
469	zlogin		\
470	zoneadm		\
471	zoneadmd	\
472	zonecfg		\
473	zonename	\
474	zpool		\
475	zlook		\
476	zonestat	\
477	zstreamdump	\
478	ztest
479
480i386_SUBDIRS=		\
481	acpi		\
482	acpihpd		\
483	addbadsec	\
484	ahciem		\
485	biosdev		\
486	cxgbetool	\
487	diskscan	\
488	nvmeadm		\
489	rtc		\
490	ucodeadm	\
491	xhci		\
492	xvm
493
494sparc_SUBDIRS=		\
495	cvcd		\
496	dcs		\
497	device_remap	\
498	drd		\
499	fruadm		\
500	ldmad		\
501	oplhpd		\
502	prtdscp		\
503	prtfru		\
504	scadm		\
505	sckmd		\
506	sf880drd	\
507	virtinfo	\
508	vntsd
509
510#
511# Commands that are messaged.  Note that 'lp' comes first
512# (see previous comment about 'lp'.)
513#
514MSGSUBDIRS=		\
515	lp		\
516	abi		\
517	acctadm		\
518	allocate	\
519	asa		\
520	audio		\
521	audit		\
522	auditconfig	\
523	auditd		\
524	auditrecord	\
525	auditset	\
526	auths		\
527	autopush	\
528	awk		\
529	awk_xpg4	\
530	backup		\
531	banner		\
532	bart		\
533	basename	\
534	beadm		\
535	bnu		\
536	busstat		\
537	cal		\
538	cat		\
539	cdrw		\
540	cfgadm		\
541	checkeq		\
542	checknr		\
543	chgrp		\
544	chmod		\
545	chown		\
546	cmd-crypto	\
547	cmd-inet	\
548	col		\
549	compress	\
550	consadm		\
551	coreadm		\
552	cpio		\
553	cpc		\
554	cron		\
555	csh		\
556	csplit		\
557	ctrun		\
558	ctstat		\
559	ctwatch		\
560	datadm		\
561	date		\
562	dc		\
563	dcs		\
564	dd		\
565	deroff		\
566	devfsadm	\
567	dfs.cmds	\
568	diff		\
569	diffmk		\
570	dladm		\
571	dlstat		\
572	du		\
573	dumpcs		\
574	ed		\
575	eject		\
576	env		\
577	eqn		\
578	expand		\
579	expr		\
580	fcinfo		\
581	file		\
582	filesync	\
583	find		\
584	flowadm		\
585	flowstat	\
586	fm		\
587	fold		\
588	fs.d		\
589	fwflash		\
590	geniconvtbl	\
591	genmsg		\
592	getconf		\
593	getent		\
594	gettext		\
595	gettxt		\
596	grep		\
597	grpck		\
598	gss		\
599	halt		\
600	head		\
601	hostname	\
602	hotplug		\
603	iconv		\
604	id		\
605	idmap		\
606	isaexec		\
607	iscsiadm	\
608	iscsid		\
609	isns		\
610	itadm		\
611	kbd		\
612	krb5		\
613	ksh		\
614	last		\
615	ldap		\
616	ldapcachemgr	\
617	lgrpinfo	\
618	locale		\
619	lofiadm		\
620	logadm		\
621	logger		\
622	logins		\
623	ls		\
624	luxadm		\
625	mailx		\
626	make		\
627	man		\
628	mesg		\
629	mkdir		\
630	mkpwdict	\
631	mktemp		\
632	more		\
633	mpathadm	\
634	msgfmt		\
635	mv		\
636	ndmpadm		\
637	ndmpstat	\
638	newgrp		\
639	newtask		\
640	nice		\
641	nohup		\
642	oawk		\
643	pack		\
644	passwd		\
645	passmgmt	\
646	pathchk		\
647	pfexec		\
648	pg		\
649	pgrep		\
650	picl            \
651	pools		\
652	power		\
653	pr		\
654	praudit		\
655	print		\
656	profiles	\
657	projadd		\
658	projects	\
659	prstat		\
660	prtdiag		\
661	ps		\
662	psrinfo		\
663	ptools		\
664	pwconv		\
665	pwd		\
666	pyzfs		\
667	raidctl		\
668	ramdiskadm	\
669	rcap		\
670	rcm_daemon	\
671	refer		\
672	regcmp		\
673	renice		\
674	roles		\
675	rm		\
676	rmdir		\
677	rmformat	\
678	rmmount		\
679	rmvolmgr	\
680	sasinfo		\
681	sbdadm		\
682	scadm		\
683	script		\
684	scsi		\
685	sdiff		\
686	sdpadm		\
687	sgs		\
688	sh		\
689	shcomp		\
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	zfs		\
738	zic		\
739	zlogin		\
740	zoneadm		\
741	zoneadmd	\
742	zonecfg		\
743	zonename	\
744	zpool		\
745	zonestat
746
747sparc_MSGSUBDIRS=	\
748	fruadm		\
749	prtdscp		\
750	prtfru		\
751	virtinfo	\
752	vntsd
753
754i386_MSGSUBDIRS=	\
755	ucodeadm
756
757#
758# commands that use dcgettext for localized time, LC_TIME
759#
760DCSUBDIRS=		\
761	cal		\
762	cfgadm		\
763	diff		\
764	ls		\
765	pr		\
766	ps		\
767	tar		\
768	w		\
769	who		\
770	whodo		\
771	write
772
773#
774# commands that belong only to audit.
775#
776AUDITSUBDIRS=		\
777	amt		\
778	audit		\
779	audit_warn	\
780	auditconfig	\
781	auditd		\
782	auditrecord	\
783	auditreduce	\
784	auditset	\
785	auditstat	\
786	praudit
787
788#
789# commands not owned by the systems group
790#
791BWOSDIRS=
792
793
794all :=		TARGET = all
795install :=	TARGET = install
796clean :=	TARGET = clean
797clobber :=	TARGET = clobber
798lint :=		TARGET = lint
799_msg :=		TARGET = _msg
800_dc :=		TARGET = _dc
801
802.KEEP_STATE:
803
804SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
805
806.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
807
808all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
809	$(AUDITSUBDIRS)
810
811#
812# Manifests cannot be checked in parallel, because we are using
813# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
814# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
815# we spawn off a sub-make to perform the non-parallel 'make check'
816#
817check:
818	$(MAKE) -f Makefile.check check
819
820#
821# The .WAIT directive works around an apparent bug in parallel make.
822# Evidently make was getting the target _msg vs. _dc confused under
823# some level of parallelization, causing some of the _dc objects
824# not to be built.
825#
826_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
827
828_dc: $(DCSUBDIRS)
829
830#
831# Dependencies
832#
833fs.d:	fstyp
834ksh:	shcomp isaexec
835print:	lp
836fmt:	mailx
837
838$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
839	@if [ -f $@/Makefile  ]; then \
840		cd $@; pwd; $(MAKE) $(TARGET); \
841	else \
842		true; \
843	fi
844
845FRC:
846