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