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