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