xref: /titanic_52/usr/src/cmd/Makefile (revision 1f0c339e39c0c782f9d4c4f3f11d373e24e1d76f)
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 (c) 2017, 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 Nexenta Systems, Inc.
29#
30
31include ../Makefile.master
32
33#
34#	Note that the commands 'lp', and 'perl' are first in
35#	the list, violating alphabetical order.  This is because they are very
36#	long-running and should be given the most wall-clock time for a
37#	parallel build.
38#
39#	Commands in the FIRST_SUBDIRS list are built before starting the build
40#	of other commands.  Currently this includes only 'isaexec' and
41#	'platexec'.  This is necessary because $(ROOT)/usr/lib/isaexec or
42#	$(ROOT)/usr/lib/platexec must exist when some other commands are built
43#	because their 'make install' creates a hard link to one of them.
44#
45#	Commands are listed one per line so that TeamWare can auto-merge most
46#	changes.
47#
48
49FIRST_SUBDIRS=		\
50	isaexec		\
51	platexec
52
53COMMON_SUBDIRS=		\
54	allocate	\
55	availdevs	\
56	lp		\
57	perl		\
58	Adm		\
59	abi		\
60	adbgen		\
61	acct		\
62	acctadm		\
63	arcwatch	\
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	diskmgtd	\
131	dispadmin	\
132	dladm		\
133	dlstat		\
134	dlutil		\
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	filesync	\
161	fgrep		\
162	file		\
163	find		\
164	flowadm		\
165	flowstat	\
166	fm		\
167	fmt		\
168	fmthard		\
169	fmtmsg		\
170	fold		\
171	format		\
172	fs.d		\
173	fstyp		\
174	fuser		\
175	fwflash		\
176	gcore		\
177	gencat		\
178	geniconvtbl	\
179	genmsg		\
180	getconf		\
181	getdevpolicy	\
182	getent		\
183	getfacl		\
184	getmajor	\
185	getopt		\
186	gettext		\
187	gettxt		\
188	grep		\
189	grep_xpg4	\
190	groups		\
191	growfs		\
192	grpck		\
193	gss		\
194	hal		\
195	halt		\
196	head		\
197	hostid		\
198	hostname	\
199	hotplug		\
200	hotplugd	\
201	ibd_upgrade	\
202	id		\
203	idmap		\
204	infocmp		\
205	init		\
206	initpkg		\
207	install.d	\
208	intrd		\
209	intrstat	\
210	ipcrm		\
211	ipcs		\
212	ipdadm		\
213	ipf		\
214	isainfo		\
215	isalist		\
216	itutools	\
217	iscsiadm	\
218	iscsid		\
219	iscsitsvc	\
220	isns		\
221	itadm		\
222	kbd		\
223	keyserv		\
224	killall		\
225	krb5		\
226	ksh		\
227	kvmstat		\
228	last		\
229	lastcomm	\
230	latencytop	\
231	ldap		\
232	ldapcachemgr	\
233	lgrpinfo	\
234	line		\
235	link		\
236	dlmgmtd		\
237	listen		\
238	loadkeys	\
239	locale		\
240	localedef	\
241	lockstat	\
242	locator		\
243	lofiadm		\
244	logadm		\
245	logger		\
246	login		\
247	logins		\
248	look		\
249	ls		\
250	luxadm		\
251	mach		\
252	mail		\
253	mailwrapper	\
254	mailx		\
255	make		\
256	makekey		\
257	man		\
258	mandoc		\
259	mdb		\
260	mesg		\
261	mkdir		\
262	mkfifo		\
263	mkfile		\
264	mkmsgs		\
265	mknod		\
266	mkpwdict	\
267	mktemp		\
268	modload		\
269	more		\
270	mpathadm	\
271	msgfmt		\
272	msgid		\
273	mt		\
274	mv		\
275	mvdir		\
276	ndmpadm		\
277	ndmpd		\
278	ndmpstat	\
279	netadm		\
280	netfiles	\
281	newform		\
282	newgrp		\
283	news		\
284	newtask		\
285	nice		\
286	nl		\
287	nlsadmin	\
288	nohup		\
289	nsadmin		\
290	nscd		\
291	oamuser		\
292	oawk		\
293	od		\
294	pack		\
295	pagesize	\
296	passmgmt	\
297	passwd		\
298	pathchk		\
299	pbind		\
300	pcidr		\
301	pcitool		\
302	pfexec		\
303	pfexecd		\
304	pginfo		\
305	pgstat		\
306	pgrep		\
307	picl		\
308	plimit		\
309	policykit	\
310	pools		\
311	power		\
312	powertop	\
313	ppgsz		\
314	pg		\
315	plockstat	\
316	pr		\
317	prctl		\
318	print		\
319	printf		\
320	priocntl	\
321	profiles	\
322	projadd		\
323	projects	\
324	prstat		\
325	prtconf		\
326	prtdiag		\
327	prtvtoc		\
328	ps		\
329	psradm		\
330	psrinfo		\
331	psrset		\
332	ptools		\
333	pwck		\
334	pwconv		\
335	pwd		\
336	pyzfs		\
337	raidctl		\
338	ramdiskadm	\
339	rcap		\
340	rcm_daemon	\
341	rctladm		\
342	refer		\
343	regcmp		\
344	renice		\
345	rexd		\
346	rm		\
347	rmdir		\
348	rmformat	\
349	rmmount		\
350	rmt		\
351	rmvolmgr	\
352	roles		\
353	rpcbind		\
354	rpcgen		\
355	rpcinfo		\
356	rpcsvc		\
357	runat		\
358	sa		\
359	saf		\
360	sasinfo		\
361	savecore	\
362	sbdadm		\
363	script		\
364	scsi		\
365	sdiff		\
366	sdpadm		\
367	sed		\
368	sendmail	\
369	setfacl		\
370	setmnt		\
371	setpgrp		\
372	setuname	\
373	sgs		\
374	sh		\
375	shcomp		\
376	smbios		\
377	smbsrv		\
378	smserverd	\
379	soelim		\
380	sort		\
381	spell		\
382	split		\
383	sqlite		\
384	srchtxt		\
385	srptadm		\
386	srptsvc		\
387	ssh		\
388	stat		\
389	stmfadm		\
390	stmfproxy	\
391	stmfsvc		\
392	stmsboot	\
393	streams		\
394	strings		\
395	su		\
396	sulogin		\
397	sunpc		\
398	svc		\
399	svr4pkg		\
400	swap		\
401	sync		\
402	sysdef		\
403	syseventadm	\
404	syslogd		\
405	tabs		\
406	tail		\
407	tar		\
408	tbl		\
409	tcopy		\
410	tcpd		\
411	terminfo	\
412	th_tools	\
413	tic		\
414	time		\
415	tip		\
416	tnf		\
417	touch		\
418	tput		\
419	tr		\
420	trapstat	\
421	troff		\
422	true		\
423	truss		\
424	tsol		\
425	tty		\
426	ttymon		\
427	tzreload	\
428	uadmin		\
429	ul		\
430	uname		\
431	units		\
432	unlink		\
433	unpack		\
434	userattr	\
435	users		\
436	utmp_update	\
437	utmpd		\
438	uuidgen		\
439	valtools	\
440	vgrind		\
441	vi		\
442	volcheck	\
443	volrmmount	\
444	vrrpadm		\
445	vscan		\
446	vt		\
447	w		\
448	wall		\
449	which		\
450	who		\
451	whodo		\
452	wracct		\
453	write		\
454	xargs		\
455	xstr		\
456	yes		\
457	ypcmd		\
458	yppasswd	\
459	zdb		\
460	zdump		\
461	zevadm		\
462	zfs		\
463	zhack		\
464	zic		\
465	zinject		\
466	zlogin		\
467	zoneadm		\
468	zoneadmd	\
469	zonecfg		\
470	zonename	\
471	zpool		\
472	zlook		\
473	zonestat	\
474	zstreamdump	\
475	ztest
476
477i386_SUBDIRS=		\
478	acpi		\
479	acpihpd		\
480	addbadsec	\
481	biosdev		\
482	diskscan	\
483	nvmeadm		\
484	rtc		\
485	ucodeadm	\
486	xvm
487
488sparc_SUBDIRS=		\
489	cvcd		\
490	dcs		\
491	device_remap	\
492	drd		\
493	fruadm		\
494	ldmad		\
495	oplhpd		\
496	prtdscp		\
497	prtfru		\
498	scadm		\
499	sckmd		\
500	sf880drd	\
501	virtinfo	\
502	vntsd
503
504#
505# Commands that are messaged.  Note that 'lp' comes first
506# (see previous comment about 'lp'.)
507#
508MSGSUBDIRS=		\
509	lp		\
510	abi		\
511	acctadm		\
512	allocate	\
513	asa		\
514	audio		\
515	audit		\
516	auditconfig	\
517	auditd		\
518	auditrecord	\
519	auditset	\
520	auths		\
521	autopush	\
522	avs		\
523	awk		\
524	awk_xpg4	\
525	backup		\
526	banner		\
527	bart		\
528	basename	\
529	beadm		\
530	bnu		\
531	busstat		\
532	cal		\
533	cat		\
534	cdrw		\
535	cfgadm		\
536	checkeq		\
537	checknr		\
538	chgrp		\
539	chmod		\
540	chown		\
541	cmd-crypto	\
542	cmd-inet	\
543	col		\
544	compress	\
545	consadm		\
546	coreadm		\
547	cpio		\
548	cpc		\
549	cron		\
550	csh		\
551	csplit		\
552	ctrun		\
553	ctstat		\
554	ctwatch		\
555	datadm		\
556	date		\
557	dc		\
558	dcs		\
559	dd		\
560	deroff		\
561	devfsadm	\
562	dfs.cmds	\
563	diff		\
564	diffmk		\
565	dladm		\
566	dlstat		\
567	du		\
568	dumpcs		\
569	ed		\
570	eject		\
571	env		\
572	eqn		\
573	expand		\
574	expr		\
575	fcinfo		\
576	fgrep		\
577	file		\
578	filesync	\
579	find		\
580	flowadm		\
581	flowstat	\
582	fm		\
583	fold		\
584	fs.d		\
585	fwflash		\
586	geniconvtbl	\
587	genmsg		\
588	getconf		\
589	getent		\
590	gettext		\
591	gettxt		\
592	grep		\
593	grep_xpg4	\
594	grpck		\
595	gss		\
596	halt		\
597	head		\
598	hostname	\
599	hotplug		\
600	id		\
601	idmap		\
602	isaexec		\
603	iscsiadm	\
604	iscsid		\
605	isns		\
606	itadm		\
607	kbd		\
608	krb5		\
609	ksh		\
610	last		\
611	ldap		\
612	ldapcachemgr	\
613	lgrpinfo	\
614	locale		\
615	lofiadm		\
616	logadm		\
617	logger		\
618	logins		\
619	ls		\
620	luxadm		\
621	mailx		\
622	make		\
623	man		\
624	mesg		\
625	mkdir		\
626	mkpwdict	\
627	mktemp		\
628	more		\
629	mpathadm	\
630	msgfmt		\
631	mv		\
632	ndmpadm		\
633	ndmpstat	\
634	newgrp		\
635	newtask		\
636	nice		\
637	nohup		\
638	oawk		\
639	pack		\
640	passwd		\
641	passmgmt	\
642	pathchk		\
643	pfexec		\
644	pg		\
645	pgrep		\
646	picl            \
647	pools		\
648	power		\
649	pr		\
650	praudit		\
651	print		\
652	profiles	\
653	projadd		\
654	projects	\
655	prstat		\
656	prtdiag		\
657	ps		\
658	psrinfo		\
659	ptools		\
660	pwconv		\
661	pwd		\
662	pyzfs		\
663	raidctl		\
664	ramdiskadm	\
665	rcap		\
666	rcm_daemon	\
667	refer		\
668	regcmp		\
669	renice		\
670	roles		\
671	rm		\
672	rmdir		\
673	rmformat	\
674	rmmount		\
675	rmvolmgr	\
676	sasinfo		\
677	sbdadm		\
678	scadm		\
679	script		\
680	scsi		\
681	sdiff		\
682	sdpadm		\
683	sgs		\
684	sh		\
685	shcomp		\
686	smbsrv		\
687	sort		\
688	split		\
689	srptadm		\
690	ssh		\
691	stat		\
692	stmfadm		\
693	stmsboot	\
694	strings		\
695	su		\
696	svc		\
697	svr4pkg		\
698	swap		\
699	syseventadm	\
700	syseventd	\
701	tabs		\
702	tar		\
703	tbl		\
704	time		\
705	tnf		\
706	touch		\
707	tput		\
708	troff		\
709	tsol		\
710	tty		\
711	ttymon		\
712	tzreload	\
713	ul		\
714	uname		\
715	units		\
716	unlink		\
717	unpack		\
718	userattr	\
719	valtools	\
720	vgrind		\
721	vi		\
722	volcheck	\
723	volrmmount	\
724	vrrpadm		\
725	vscan		\
726	w		\
727	who		\
728	whodo		\
729	wracct		\
730	write		\
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
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