xref: /titanic_52/usr/src/cmd/Makefile (revision 91d7f85e02991954d1e1bd44673df567ad8dcc87)
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	makekey		\
253	man		\
254	mandoc		\
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	xargs		\
450	xstr		\
451	yes		\
452	ypcmd		\
453	yppasswd	\
454	zdb		\
455	zdump		\
456	zfs		\
457	zhack		\
458	zic		\
459	zinject		\
460	zlogin		\
461	zoneadm		\
462	zoneadmd	\
463	zonecfg		\
464	zonename	\
465	zpool		\
466	zlook		\
467	zonestat	\
468	zstreamdump	\
469	ztest
470
471i386_SUBDIRS=		\
472	acpihpd		\
473	addbadsec	\
474	biosdev		\
475	diskscan	\
476	lms		\
477	rtc		\
478	ucodeadm	\
479	xvm
480
481sparc_SUBDIRS=		\
482	cvcd		\
483	dcs		\
484	device_remap	\
485	drd		\
486	fruadm		\
487	ldmad		\
488	oplhpd		\
489	prtdscp		\
490	prtfru		\
491	scadm		\
492	sckmd		\
493	sf880drd	\
494	virtinfo	\
495	vntsd
496
497#
498# Commands that are messaged.  Note that 'lp' comes first
499# (see previous comment about 'lp'.)
500#
501MSGSUBDIRS=		\
502	lp		\
503	abi		\
504	acctadm		\
505	allocate	\
506	asa		\
507	audio		\
508	audit		\
509	auditconfig	\
510	auditd		\
511	auditrecord	\
512	auditset	\
513	auths		\
514	autopush	\
515	avs		\
516	awk		\
517	awk_xpg4	\
518	backup		\
519	banner		\
520	bart		\
521	basename	\
522	beadm		\
523	bnu		\
524	busstat		\
525	cal		\
526	cat		\
527	cdrw		\
528	cfgadm		\
529	checkeq		\
530	checknr		\
531	chgrp		\
532	chmod		\
533	chown		\
534	cmd-crypto	\
535	cmd-inet	\
536	col		\
537	compress	\
538	consadm		\
539	coreadm		\
540	cpio		\
541	cpc		\
542	cron		\
543	csh		\
544	csplit		\
545	ctrun		\
546	ctstat		\
547	ctwatch		\
548	datadm		\
549	date		\
550	dc		\
551	dcs		\
552	dd		\
553	deroff		\
554	devfsadm	\
555	dfs.cmds	\
556	diff		\
557	diffmk		\
558	dladm		\
559	dlstat		\
560	du		\
561	dumpcs		\
562	ed		\
563	eject		\
564	env		\
565	eqn		\
566	expand		\
567	expr		\
568	fcinfo		\
569	fgrep		\
570	file		\
571	filesync	\
572	find		\
573	flowadm		\
574	flowstat	\
575	fm		\
576	fold		\
577	fs.d		\
578	fwflash		\
579	geniconvtbl	\
580	genmsg		\
581	getconf		\
582	getent		\
583	gettext		\
584	gettxt		\
585	grep		\
586	grep_xpg4	\
587	grpck		\
588	gss		\
589	halt		\
590	head		\
591	hostname	\
592	hotplug		\
593	id		\
594	idmap		\
595	isaexec		\
596	iscsiadm	\
597	iscsid		\
598	isns		\
599	itadm		\
600	kbd		\
601	krb5		\
602	ksh		\
603	last		\
604	ldap		\
605	ldapcachemgr	\
606	lgrpinfo	\
607	locale		\
608	lofiadm		\
609	logadm		\
610	logger		\
611	logins		\
612	ls		\
613	luxadm		\
614	lvm		\
615	mailx		\
616	man		\
617	mesg		\
618	mkdir		\
619	mkpwdict	\
620	mktemp		\
621	more		\
622	mpathadm	\
623	msgfmt		\
624	mv		\
625	ndmpadm		\
626	ndmpstat	\
627	newgrp		\
628	newtask		\
629	nice		\
630	nohup		\
631	oawk		\
632	pack		\
633	passwd		\
634	passmgmt	\
635	pathchk		\
636	pfexec		\
637	pg		\
638	pgrep		\
639	picl            \
640	pools		\
641	power		\
642	pr		\
643	praudit		\
644	print		\
645	profiles	\
646	projadd		\
647	projects	\
648	prstat		\
649	prtdiag		\
650	ps		\
651	psrinfo		\
652	ptools		\
653	pwconv		\
654	pwd		\
655	pyzfs		\
656	raidctl		\
657	ramdiskadm	\
658	rcap		\
659	rcm_daemon	\
660	refer		\
661	regcmp		\
662	renice		\
663	roles		\
664	rm		\
665	rmdir		\
666	rmformat	\
667	rmmount		\
668	rmvolmgr	\
669	sasinfo		\
670	sbdadm		\
671	scadm		\
672	script		\
673	scsi		\
674	sdiff		\
675	sdpadm		\
676	sgs		\
677	sh		\
678	shcomp		\
679	smbsrv		\
680	sort		\
681	split		\
682	srptadm		\
683	ssh		\
684	stat		\
685	stmfadm		\
686	stmsboot	\
687	strings		\
688	su		\
689	svc		\
690	svr4pkg		\
691	swap		\
692	syseventadm	\
693	syseventd	\
694	tabs		\
695	tar		\
696	tbl		\
697	time		\
698	tnf		\
699	touch		\
700	tput		\
701	troff		\
702	tsol		\
703	tty		\
704	ttymon		\
705	tzreload	\
706	ul		\
707	uname		\
708	units		\
709	unlink		\
710	unpack		\
711	userattr	\
712	valtools	\
713	vgrind		\
714	vi		\
715	volcheck	\
716	volrmmount	\
717	vrrpadm		\
718	vscan		\
719	w		\
720	who		\
721	whodo		\
722	wracct		\
723	write		\
724	xargs		\
725	yppasswd	\
726	zdump		\
727	zfs		\
728	zic		\
729	zlogin		\
730	zoneadm		\
731	zoneadmd	\
732	zonecfg		\
733	zonename	\
734	zpool		\
735	zonestat
736
737sparc_MSGSUBDIRS=	\
738	fruadm		\
739	prtdscp		\
740	prtfru		\
741	virtinfo	\
742	vntsd
743
744i386_MSGSUBDIRS=	\
745	ucodeadm
746
747#
748# commands that use dcgettext for localized time, LC_TIME
749#
750DCSUBDIRS=		\
751	cal		\
752	cfgadm		\
753	diff		\
754	ls		\
755	pr		\
756	ps		\
757	tar		\
758	w		\
759	who		\
760	whodo		\
761	write
762
763#
764# commands that belong only to audit.
765#
766AUDITSUBDIRS=		\
767	amt		\
768	audit		\
769	audit_warn	\
770	auditconfig	\
771	auditd		\
772	auditrecord	\
773	auditreduce	\
774	auditset	\
775	auditstat	\
776	praudit
777
778#
779# commands not owned by the systems group
780#
781BWOSDIRS=
782
783
784all :=		TARGET = all
785install :=	TARGET = install
786clean :=	TARGET = clean
787clobber :=	TARGET = clobber
788lint :=		TARGET = lint
789_msg :=		TARGET = _msg
790_dc :=		TARGET = _dc
791
792.KEEP_STATE:
793
794SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
795
796.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
797
798all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
799	$(AUDITSUBDIRS)
800
801#
802# Manifests cannot be checked in parallel, because we are using
803# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
804# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
805# we spawn off a sub-make to perform the non-parallel 'make check'
806#
807check:
808	$(MAKE) -f Makefile.check check
809
810#
811# The .WAIT directive works around an apparent bug in parallel make.
812# Evidently make was getting the target _msg vs. _dc confused under
813# some level of parallelization, causing some of the _dc objects
814# not to be built.
815#
816_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
817
818_dc: $(DCSUBDIRS)
819
820#
821# Dependencies
822#
823fs.d: fstyp
824ksh:	shcomp isaexec
825mdb:	terminfo
826print:	lp
827fmt:	mailx
828
829$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
830	@if [ -f $@/Makefile  ]; then \
831		cd $@; pwd; $(MAKE) $(TARGET); \
832	else \
833		true; \
834	fi
835
836FRC:
837