xref: /illumos-gate/usr/src/cmd/Makefile (revision 31358b0d3ea5b07f4167f88ac393a5eb2a2249d6)
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	calendar	\
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	ctrun		\
110	ctstat		\
111	ctwatch		\
112	datadm		\
113	date		\
114	dc		\
115	dd		\
116	deroff		\
117	devfsadm	\
118	syseventd	\
119	devctl		\
120	devinfo		\
121	devmgmt		\
122	devprop		\
123	dfs.cmds	\
124	diff		\
125	diff3		\
126	diffmk		\
127	dircmp		\
128	dirname		\
129	dis		\
130	diskinfo	\
131	diskmgtd	\
132	dispadmin	\
133	dladm		\
134	dlstat		\
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	hwdata		\
203	ibd_upgrade	\
204	iconv		\
205	id		\
206	idmap		\
207	infocmp		\
208	init		\
209	initpkg		\
210	install.d	\
211	intrd		\
212	intrstat	\
213	ipcrm		\
214	ipcs		\
215	ipdadm		\
216	ipf		\
217	isainfo		\
218	isalist		\
219	itutools	\
220	iscsiadm	\
221	iscsid		\
222	iscsitsvc	\
223	isns		\
224	itadm		\
225	kbd		\
226	keyserv		\
227	killall		\
228	krb5		\
229	ksh		\
230	kvmstat		\
231	last		\
232	lastcomm	\
233	latencytop	\
234	ldap		\
235	ldapcachemgr	\
236	lgrpinfo	\
237	line		\
238	link		\
239	dlmgmtd		\
240	listen		\
241	loadkeys	\
242	locale		\
243	localedef	\
244	lockstat	\
245	locator		\
246	lofiadm		\
247	logadm		\
248	logger		\
249	login		\
250	logins		\
251	look		\
252	ls		\
253	luxadm		\
254	mach		\
255	mail		\
256	mailwrapper	\
257	mailx		\
258	make		\
259	makekey		\
260	man		\
261	mandoc		\
262	mdb		\
263	mesg		\
264	mkdir		\
265	mkfifo		\
266	mkfile		\
267	mkmsgs		\
268	mknod		\
269	mkpwdict	\
270	mktemp		\
271	modload		\
272	more		\
273	mpathadm	\
274	msgfmt		\
275	msgid		\
276	mt		\
277	mv		\
278	mvdir		\
279	ndmpadm		\
280	ndmpd		\
281	ndmpstat	\
282	netadm		\
283	netfiles	\
284	newform		\
285	newgrp		\
286	news		\
287	newtask		\
288	nice		\
289	nl		\
290	nlsadmin	\
291	nohup		\
292	nsadmin		\
293	nscd		\
294	oamuser		\
295	oawk		\
296	od		\
297	pack		\
298	pagesize	\
299	passmgmt	\
300	passwd		\
301	pathchk		\
302	pbind		\
303	pcidr		\
304	pcitool		\
305	pfexec		\
306	pfexecd		\
307	pginfo		\
308	pgstat		\
309	pgrep		\
310	picl		\
311	plimit		\
312	policykit	\
313	pools		\
314	power		\
315	powertop	\
316	ppgsz		\
317	pg		\
318	plockstat	\
319	pr		\
320	prctl		\
321	print		\
322	printf		\
323	priocntl	\
324	profiles	\
325	projadd		\
326	projects	\
327	prstat		\
328	prtconf		\
329	prtdiag		\
330	prtvtoc		\
331	ps		\
332	psradm		\
333	psrinfo		\
334	psrset		\
335	ptools		\
336	pwck		\
337	pwconv		\
338	pwd		\
339	pyzfs		\
340	raidctl		\
341	ramdiskadm	\
342	rcap		\
343	rcm_daemon	\
344	rctladm		\
345	refer		\
346	regcmp		\
347	renice		\
348	rm		\
349	rmdir		\
350	rmformat	\
351	rmmount		\
352	rmt		\
353	rmvolmgr	\
354	roles		\
355	rpcbind		\
356	rpcgen		\
357	rpcinfo		\
358	rpcsvc		\
359	runat		\
360	sa		\
361	saf		\
362	sasinfo		\
363	savecore	\
364	sbdadm		\
365	script		\
366	scsi		\
367	sdiff		\
368	sdpadm		\
369	sed		\
370	sendmail	\
371	setfacl		\
372	setmnt		\
373	setpgrp		\
374	setuname	\
375	sgs		\
376	sh		\
377	shcomp		\
378	smbios		\
379	smbsrv		\
380	smserverd	\
381	soelim		\
382	sort		\
383	spell		\
384	split		\
385	sqlite		\
386	srchtxt		\
387	srptadm		\
388	srptsvc		\
389	ssh		\
390	stat		\
391	stmfadm		\
392	stmfproxy	\
393	stmfsvc		\
394	stmsboot	\
395	streams		\
396	strings		\
397	su		\
398	sulogin		\
399	sunpc		\
400	svc		\
401	svr4pkg		\
402	swap		\
403	sync		\
404	sysdef		\
405	syseventadm	\
406	syslogd		\
407	tabs		\
408	tail		\
409	tar		\
410	tbl		\
411	tcopy		\
412	tcpd		\
413	terminfo	\
414	th_tools	\
415	tic		\
416	time		\
417	tip		\
418	tnf		\
419	touch		\
420	tput		\
421	tr		\
422	trapstat	\
423	troff		\
424	true		\
425	truss		\
426	tsol		\
427	tty		\
428	ttymon		\
429	tzreload	\
430	uadmin		\
431	ul		\
432	uname		\
433	units		\
434	unlink		\
435	unpack		\
436	userattr	\
437	users		\
438	utmp_update	\
439	utmpd		\
440	uuidgen		\
441	valtools	\
442	vgrind		\
443	vi		\
444	volcheck	\
445	volrmmount	\
446	vrrpadm		\
447	vscan		\
448	vt		\
449	w		\
450	wall		\
451	which		\
452	who		\
453	whodo		\
454	wracct		\
455	write		\
456	xargs		\
457	xhci		\
458	xstr		\
459	yes		\
460	ypcmd		\
461	yppasswd	\
462	zdb		\
463	zdump		\
464	zfs		\
465	zhack		\
466	zic		\
467	zinject		\
468	zlogin		\
469	zoneadm		\
470	zoneadmd	\
471	zonecfg		\
472	zonename	\
473	zpool		\
474	zlook		\
475	zonestat	\
476	zstreamdump	\
477	ztest
478
479i386_SUBDIRS=		\
480	acpi		\
481	acpihpd		\
482	addbadsec	\
483	biosdev		\
484	diskscan	\
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
833mdb:	terminfo
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