xref: /titanic_41/usr/src/cmd/Makefile (revision 32a712da90cea6ff9a05f51e7844944ccfa28d5e)
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# 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	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	man		\
256	mandoc		\
257	mdb		\
258	mesg		\
259	mkdir		\
260	mkfifo		\
261	mkfile		\
262	mkmsgs		\
263	mknod		\
264	mkpwdict	\
265	mktemp		\
266	modload		\
267	more		\
268	mpathadm	\
269	msgfmt		\
270	msgid		\
271	mt		\
272	mv		\
273	mvdir		\
274	ndmpadm		\
275	ndmpd		\
276	ndmpstat	\
277	netadm		\
278	netfiles	\
279	newform		\
280	newgrp		\
281	news		\
282	newtask		\
283	nice		\
284	nl		\
285	nlsadmin	\
286	nohup		\
287	nsadmin		\
288	nscd		\
289	oamuser		\
290	oawk		\
291	od		\
292	pack		\
293	pagesize	\
294	passmgmt	\
295	passwd		\
296	pathchk		\
297	pbind		\
298	pcidr		\
299	pcitool		\
300	pfexec		\
301	pfexecd		\
302	pginfo		\
303	pgstat		\
304	pgrep		\
305	picl		\
306	plimit		\
307	policykit	\
308	pools		\
309	power		\
310	powertop	\
311	ppgsz		\
312	pg		\
313	plockstat	\
314	pr		\
315	prctl		\
316	print		\
317	printf		\
318	priocntl	\
319	profiles	\
320	projadd		\
321	projects	\
322	prstat		\
323	prtconf		\
324	prtdiag		\
325	prtvtoc		\
326	ps		\
327	psradm		\
328	psrinfo		\
329	psrset		\
330	ptools		\
331	pwck		\
332	pwconv		\
333	pwd		\
334	pyzfs		\
335	raidctl		\
336	ramdiskadm	\
337	rcap		\
338	rcm_daemon	\
339	rctladm		\
340	refer		\
341	regcmp		\
342	renice		\
343	rexd		\
344	rm		\
345	rmdir		\
346	rmformat	\
347	rmmount		\
348	rmt		\
349	rmvolmgr	\
350	roles		\
351	rpcbind		\
352	rpcgen		\
353	rpcinfo		\
354	rpcsvc		\
355	runat		\
356	sa		\
357	saf		\
358	sasinfo		\
359	savecore	\
360	sbdadm		\
361	script		\
362	scsi		\
363	sdiff		\
364	sdpadm		\
365	sed		\
366	sendmail	\
367	setfacl		\
368	setmnt		\
369	setpgrp		\
370	setuname	\
371	sgs		\
372	sh		\
373	shcomp		\
374	smbios		\
375	smbsrv		\
376	smserverd	\
377	soelim		\
378	sort		\
379	spell		\
380	split		\
381	sqlite		\
382	srchtxt		\
383	srptadm		\
384	srptsvc		\
385	ssh		\
386	stat		\
387	stmfadm		\
388	stmfproxy	\
389	stmfsvc		\
390	stmsboot	\
391	streams		\
392	strings		\
393	su		\
394	sulogin		\
395	sunpc		\
396	svc		\
397	svr4pkg		\
398	swap		\
399	sync		\
400	sysdef		\
401	syseventadm	\
402	syslogd		\
403	tabs		\
404	tail		\
405	tar		\
406	tbl		\
407	tcopy		\
408	tcpd		\
409	terminfo	\
410	th_tools	\
411	tic		\
412	time		\
413	tip		\
414	tnf		\
415	touch		\
416	tput		\
417	tr		\
418	trapstat	\
419	troff		\
420	true		\
421	truss		\
422	tsol		\
423	tty		\
424	ttymon		\
425	tzreload	\
426	uadmin		\
427	ul		\
428	uname		\
429	units		\
430	unlink		\
431	unpack		\
432	userattr	\
433	users		\
434	utmp_update	\
435	utmpd		\
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	wusbadm		\
452	xargs		\
453	xstr		\
454	yes		\
455	ypcmd		\
456	yppasswd	\
457	zdb		\
458	zdump		\
459	zevadm		\
460	zfs		\
461	zhack		\
462	zic		\
463	zinject		\
464	zlogin		\
465	zoneadm		\
466	zoneadmd	\
467	zonecfg		\
468	zonename	\
469	zpool		\
470	zlook		\
471	zonestat	\
472	zstreamdump	\
473	ztest
474
475i386_SUBDIRS=		\
476	acpihpd		\
477	addbadsec	\
478	biosdev		\
479	diskscan	\
480	lms		\
481	ntfsprogs	\
482	parted		\
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	id		\
600	idmap		\
601	isaexec		\
602	iscsiadm	\
603	iscsid		\
604	isns		\
605	itadm		\
606	kbd		\
607	krb5		\
608	ksh		\
609	last		\
610	ldap		\
611	ldapcachemgr	\
612	lgrpinfo	\
613	locale		\
614	lofiadm		\
615	logadm		\
616	logger		\
617	logins		\
618	ls		\
619	luxadm		\
620	lvm		\
621	mailx		\
622	man		\
623	mesg		\
624	mkdir		\
625	mkpwdict	\
626	mktemp		\
627	more		\
628	mpathadm	\
629	msgfmt		\
630	mv		\
631	ndmpadm		\
632	ndmpstat	\
633	newgrp		\
634	newtask		\
635	nice		\
636	nohup		\
637	oawk		\
638	pack		\
639	passwd		\
640	passmgmt	\
641	pathchk		\
642	pfexec		\
643	pg		\
644	pgrep		\
645	picl            \
646	pools		\
647	power		\
648	pr		\
649	praudit		\
650	print		\
651	profiles	\
652	projadd		\
653	projects	\
654	prstat		\
655	prtdiag		\
656	ps		\
657	psrinfo		\
658	ptools		\
659	pwconv		\
660	pwd		\
661	pyzfs		\
662	raidctl		\
663	ramdiskadm	\
664	rcap		\
665	rcm_daemon	\
666	refer		\
667	regcmp		\
668	renice		\
669	roles		\
670	rm		\
671	rmdir		\
672	rmformat	\
673	rmmount		\
674	rmvolmgr	\
675	sasinfo		\
676	sbdadm		\
677	scadm		\
678	script		\
679	scsi		\
680	sdiff		\
681	sdpadm		\
682	sgs		\
683	sh		\
684	shcomp		\
685	smbsrv		\
686	sort		\
687	split		\
688	srptadm		\
689	ssh		\
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	wusbadm		\
731	xargs		\
732	yppasswd	\
733	zdump		\
734	zevadm		\
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
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