xref: /illumos-gate/usr/src/cmd/Makefile (revision 17a5fa85fe0c34b1146222e40a80b42f2aae8500)
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	dcs		\
496	device_remap	\
497	drd		\
498	fruadm		\
499	ldmad		\
500	oplhpd		\
501	prtdscp		\
502	prtfru		\
503	scadm		\
504	sckmd		\
505	sf880drd	\
506	virtinfo	\
507	vntsd
508
509#
510# Commands that are messaged.  Note that 'lp' comes first
511# (see previous comment about 'lp'.)
512#
513MSGSUBDIRS=		\
514	lp		\
515	abi		\
516	acctadm		\
517	allocate	\
518	asa		\
519	audio		\
520	audit		\
521	auditconfig	\
522	auditd		\
523	auditrecord	\
524	auditset	\
525	auths		\
526	autopush	\
527	awk		\
528	awk_xpg4	\
529	backup		\
530	banner		\
531	bart		\
532	basename	\
533	beadm		\
534	bnu		\
535	busstat		\
536	cal		\
537	cat		\
538	cdrw		\
539	cfgadm		\
540	checkeq		\
541	checknr		\
542	chgrp		\
543	chmod		\
544	chown		\
545	cmd-crypto	\
546	cmd-inet	\
547	col		\
548	compress	\
549	consadm		\
550	coreadm		\
551	cpio		\
552	cpc		\
553	cron		\
554	csh		\
555	csplit		\
556	ctrun		\
557	ctstat		\
558	ctwatch		\
559	datadm		\
560	date		\
561	dc		\
562	dcs		\
563	dd		\
564	deroff		\
565	devfsadm	\
566	dfs.cmds	\
567	diff		\
568	diffmk		\
569	dladm		\
570	dlstat		\
571	du		\
572	dumpcs		\
573	ed		\
574	eject		\
575	env		\
576	eqn		\
577	expand		\
578	expr		\
579	fcinfo		\
580	file		\
581	filesync	\
582	find		\
583	flowadm		\
584	flowstat	\
585	fm		\
586	fold		\
587	fs.d		\
588	fwflash		\
589	geniconvtbl	\
590	genmsg		\
591	getconf		\
592	getent		\
593	gettext		\
594	gettxt		\
595	grep		\
596	grpck		\
597	gss		\
598	halt		\
599	head		\
600	hostname	\
601	hotplug		\
602	iconv		\
603	id		\
604	idmap		\
605	isaexec		\
606	iscsiadm	\
607	iscsid		\
608	isns		\
609	itadm		\
610	kbd		\
611	krb5		\
612	ksh		\
613	last		\
614	ldap		\
615	ldapcachemgr	\
616	lgrpinfo	\
617	locale		\
618	lofiadm		\
619	logadm		\
620	logger		\
621	logins		\
622	ls		\
623	luxadm		\
624	mailx		\
625	make		\
626	man		\
627	mesg		\
628	mkdir		\
629	mkpwdict	\
630	mktemp		\
631	more		\
632	mpathadm	\
633	msgfmt		\
634	mv		\
635	ndmpadm		\
636	ndmpstat	\
637	newgrp		\
638	newtask		\
639	nice		\
640	nohup		\
641	oawk		\
642	pack		\
643	passwd		\
644	passmgmt	\
645	pathchk		\
646	pfexec		\
647	pg		\
648	pgrep		\
649	picl            \
650	pools		\
651	power		\
652	pr		\
653	praudit		\
654	print		\
655	profiles	\
656	projadd		\
657	projects	\
658	prstat		\
659	prtdiag		\
660	ps		\
661	psrinfo		\
662	ptools		\
663	pwconv		\
664	pwd		\
665	pyzfs		\
666	raidctl		\
667	ramdiskadm	\
668	rcap		\
669	rcm_daemon	\
670	refer		\
671	regcmp		\
672	renice		\
673	roles		\
674	rm		\
675	rmdir		\
676	rmformat	\
677	rmmount		\
678	rmvolmgr	\
679	sasinfo		\
680	sbdadm		\
681	scadm		\
682	script		\
683	scsi		\
684	sdiff		\
685	sdpadm		\
686	sgs		\
687	sh		\
688	shcomp		\
689	smbsrv		\
690	sort		\
691	split		\
692	srptadm		\
693	stat		\
694	stmfadm		\
695	stmsboot	\
696	strings		\
697	su		\
698	svc		\
699	svr4pkg		\
700	swap		\
701	syseventadm	\
702	syseventd	\
703	tabs		\
704	tar		\
705	tbl		\
706	time		\
707	tnf		\
708	touch		\
709	tput		\
710	troff		\
711	tsol		\
712	tty		\
713	ttymon		\
714	tzreload	\
715	ul		\
716	uname		\
717	units		\
718	unlink		\
719	unpack		\
720	userattr	\
721	valtools	\
722	vgrind		\
723	vi		\
724	volcheck	\
725	volrmmount	\
726	vrrpadm		\
727	vscan		\
728	w		\
729	who		\
730	whodo		\
731	wracct		\
732	write		\
733	xargs		\
734	yppasswd	\
735	zdump		\
736	zfs		\
737	zic		\
738	zlogin		\
739	zoneadm		\
740	zoneadmd	\
741	zonecfg		\
742	zonename	\
743	zpool		\
744	zonestat
745
746sparc_MSGSUBDIRS=	\
747	fruadm		\
748	prtdscp		\
749	prtfru		\
750	virtinfo	\
751	vntsd
752
753i386_MSGSUBDIRS=	\
754	ucodeadm
755
756#
757# commands that use dcgettext for localized time, LC_TIME
758#
759DCSUBDIRS=		\
760	cal		\
761	cfgadm		\
762	diff		\
763	ls		\
764	pr		\
765	ps		\
766	tar		\
767	w		\
768	who		\
769	whodo		\
770	write
771
772#
773# commands that belong only to audit.
774#
775AUDITSUBDIRS=		\
776	amt		\
777	audit		\
778	audit_warn	\
779	auditconfig	\
780	auditd		\
781	auditrecord	\
782	auditreduce	\
783	auditset	\
784	auditstat	\
785	praudit
786
787#
788# commands not owned by the systems group
789#
790BWOSDIRS=
791
792
793all :=		TARGET = all
794install :=	TARGET = install
795clean :=	TARGET = clean
796clobber :=	TARGET = clobber
797lint :=		TARGET = lint
798_msg :=		TARGET = _msg
799_dc :=		TARGET = _dc
800
801.KEEP_STATE:
802
803SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
804
805.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
806
807all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
808	$(AUDITSUBDIRS)
809
810#
811# Manifests cannot be checked in parallel, because we are using
812# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
813# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
814# we spawn off a sub-make to perform the non-parallel 'make check'
815#
816check:
817	$(MAKE) -f Makefile.check check
818
819#
820# The .WAIT directive works around an apparent bug in parallel make.
821# Evidently make was getting the target _msg vs. _dc confused under
822# some level of parallelization, causing some of the _dc objects
823# not to be built.
824#
825_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
826
827_dc: $(DCSUBDIRS)
828
829#
830# Dependencies
831#
832fs.d:	fstyp
833ksh:	shcomp isaexec
834print:	lp
835fmt:	mailx
836
837$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
838	@if [ -f $@/Makefile  ]; then \
839		cd $@; pwd; $(MAKE) $(TARGET); \
840	else \
841		true; \
842	fi
843
844FRC:
845