xref: /titanic_44/usr/src/cmd/Makefile (revision e2dcee5754c56d91c6e1ff847db294541069ca0d)
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	valtools	\
439	vgrind		\
440	vi		\
441	volcheck	\
442	volrmmount	\
443	vrrpadm		\
444	vscan		\
445	vt		\
446	w		\
447	wall		\
448	which		\
449	who		\
450	whodo		\
451	wracct		\
452	write		\
453	xargs		\
454	xstr		\
455	yes		\
456	ypcmd		\
457	yppasswd	\
458	zdb		\
459	zdump		\
460	zevadm		\
461	zfs		\
462	zhack		\
463	zic		\
464	zinject		\
465	zlogin		\
466	zoneadm		\
467	zoneadmd	\
468	zonecfg		\
469	zonename	\
470	zpool		\
471	zlook		\
472	zonestat	\
473	zstreamdump	\
474	ztest
475
476i386_SUBDIRS=		\
477	acpi		\
478	acpihpd		\
479	addbadsec	\
480	biosdev		\
481	diskscan	\
482	nvmeadm		\
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	mailx		\
621	make		\
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	xargs		\
731	yppasswd	\
732	zdump		\
733	zevadm		\
734	zfs		\
735	zic		\
736	zlogin		\
737	zoneadm		\
738	zoneadmd	\
739	zonecfg		\
740	zonename	\
741	zpool		\
742	zonestat
743
744sparc_MSGSUBDIRS=	\
745	fruadm		\
746	prtdscp		\
747	prtfru		\
748	virtinfo	\
749	vntsd
750
751i386_MSGSUBDIRS=	\
752	ucodeadm
753
754#
755# commands that use dcgettext for localized time, LC_TIME
756#
757DCSUBDIRS=		\
758	cal		\
759	cfgadm		\
760	diff		\
761	ls		\
762	pr		\
763	ps		\
764	tar		\
765	w		\
766	who		\
767	whodo		\
768	write
769
770#
771# commands that belong only to audit.
772#
773AUDITSUBDIRS=		\
774	amt		\
775	audit		\
776	audit_warn	\
777	auditconfig	\
778	auditd		\
779	auditrecord	\
780	auditreduce	\
781	auditset	\
782	auditstat	\
783	praudit
784
785#
786# commands not owned by the systems group
787#
788BWOSDIRS=
789
790
791all :=		TARGET = all
792install :=	TARGET = install
793clean :=	TARGET = clean
794clobber :=	TARGET = clobber
795lint :=		TARGET = lint
796_msg :=		TARGET = _msg
797_dc :=		TARGET = _dc
798
799.KEEP_STATE:
800
801SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
802
803.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
804
805all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
806	$(AUDITSUBDIRS)
807
808#
809# Manifests cannot be checked in parallel, because we are using
810# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
811# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
812# we spawn off a sub-make to perform the non-parallel 'make check'
813#
814check:
815	$(MAKE) -f Makefile.check check
816
817#
818# The .WAIT directive works around an apparent bug in parallel make.
819# Evidently make was getting the target _msg vs. _dc confused under
820# some level of parallelization, causing some of the _dc objects
821# not to be built.
822#
823_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
824
825_dc: $(DCSUBDIRS)
826
827#
828# Dependencies
829#
830fs.d: fstyp
831ksh:	shcomp isaexec
832mdb:	terminfo
833print:	lp
834fmt:	mailx
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