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