xref: /titanic_51/usr/src/cmd/Makefile (revision 4e46804c9270efe6670c8fce7ca36af7f9ad130f)
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) 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
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	arcwatch	\
62	arch		\
63	asa		\
64	ast		\
65	audio		\
66	auths		\
67	autopush	\
68	avs		\
69	awk		\
70	awk_xpg4	\
71	backup		\
72	banner		\
73	bart		\
74	basename	\
75	bc		\
76	bdiff		\
77	beadm		\
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	dlutil		\
133	dmesg		\
134	dodatadm	\
135	dtrace		\
136	du		\
137	dumpadm		\
138	dumpcs		\
139	echo		\
140	ed		\
141	eeprom		\
142	egrep		\
143	eject		\
144	emul64ioctl	\
145	enhance		\
146	env		\
147	eqn		\
148	expand		\
149	expr		\
150	exstr		\
151	factor		\
152	false		\
153	fcinfo		\
154	fcoesvc		\
155	fdetach		\
156	fdformat	\
157	fdisk		\
158	filesync	\
159	fgrep		\
160	file		\
161	find		\
162	flowadm		\
163	flowstat	\
164	fm		\
165	fmt		\
166	fmthard		\
167	fmtmsg		\
168	fold		\
169	format		\
170	fs.d		\
171	fstyp		\
172	fuser		\
173	fwflash		\
174	gcore		\
175	gencat		\
176	geniconvtbl	\
177	genmsg		\
178	getconf		\
179	getdevpolicy	\
180	getent		\
181	getfacl		\
182	getmajor	\
183	getopt		\
184	gettext		\
185	gettxt		\
186	grep		\
187	grep_xpg4	\
188	groups		\
189	growfs		\
190	grpck		\
191	gss		\
192	hal		\
193	halt		\
194	head		\
195	hostid		\
196	hostname	\
197	hotplug		\
198	hotplugd	\
199	ibd_upgrade	\
200	id		\
201	idmap		\
202	infocmp		\
203	init		\
204	initpkg		\
205	install.d	\
206	intrd		\
207	intrstat	\
208	ipcrm		\
209	ipcs		\
210	ipdadm		\
211	ipf		\
212	isainfo		\
213	isalist		\
214	itutools	\
215	iscsiadm	\
216	iscsid		\
217	iscsitsvc	\
218	isns		\
219	itadm		\
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	mail		\
252	mailwrapper	\
253	mailx		\
254	make		\
255	makekey		\
256	man		\
257	mandoc		\
258	mdb		\
259	mesg		\
260	mkdir		\
261	mkfifo		\
262	mkfile		\
263	mkmsgs		\
264	mknod		\
265	mkpwdict	\
266	mktemp		\
267	modload		\
268	more		\
269	mpathadm	\
270	msgfmt		\
271	msgid		\
272	mt		\
273	mv		\
274	mvdir		\
275	ndmpadm		\
276	ndmpd		\
277	ndmpstat	\
278	netadm		\
279	netfiles	\
280	newform		\
281	newgrp		\
282	news		\
283	newtask		\
284	nice		\
285	nl		\
286	nlsadmin	\
287	nohup		\
288	nsadmin		\
289	nscd		\
290	oamuser		\
291	oawk		\
292	od		\
293	pack		\
294	pagesize	\
295	passmgmt	\
296	passwd		\
297	pathchk		\
298	pbind		\
299	pcidr		\
300	pcitool		\
301	pfexec		\
302	pfexecd		\
303	pginfo		\
304	pgstat		\
305	pgrep		\
306	picl		\
307	plimit		\
308	policykit	\
309	pools		\
310	power		\
311	powertop	\
312	ppgsz		\
313	pg		\
314	plockstat	\
315	pr		\
316	prctl		\
317	print		\
318	printf		\
319	priocntl	\
320	profiles	\
321	projadd		\
322	projects	\
323	prstat		\
324	prtconf		\
325	prtdiag		\
326	prtvtoc		\
327	ps		\
328	psradm		\
329	psrinfo		\
330	psrset		\
331	ptools		\
332	pwck		\
333	pwconv		\
334	pwd		\
335	pyzfs		\
336	raidctl		\
337	ramdiskadm	\
338	rcap		\
339	rcm_daemon	\
340	rctladm		\
341	refer		\
342	regcmp		\
343	renice		\
344	rexd		\
345	rm		\
346	rmdir		\
347	rmformat	\
348	rmmount		\
349	rmt		\
350	rmvolmgr	\
351	roles		\
352	rpcbind		\
353	rpcgen		\
354	rpcinfo		\
355	rpcsvc		\
356	runat		\
357	sa		\
358	saf		\
359	sasinfo		\
360	savecore	\
361	sbdadm		\
362	script		\
363	scsi		\
364	sdiff		\
365	sdpadm		\
366	sed		\
367	sendmail	\
368	setfacl		\
369	setmnt		\
370	setpgrp		\
371	setuname	\
372	sgs		\
373	sh		\
374	shcomp		\
375	smbios		\
376	smbsrv		\
377	smserverd	\
378	soelim		\
379	sort		\
380	spell		\
381	split		\
382	sqlite		\
383	srchtxt		\
384	srptadm		\
385	srptsvc		\
386	ssh		\
387	stat		\
388	stmfadm		\
389	stmfproxy	\
390	stmfsvc		\
391	stmsboot	\
392	streams		\
393	strings		\
394	su		\
395	sulogin		\
396	sunpc		\
397	svc		\
398	svr4pkg		\
399	swap		\
400	sync		\
401	sysdef		\
402	syseventadm	\
403	syslogd		\
404	tabs		\
405	tail		\
406	tar		\
407	tbl		\
408	tcopy		\
409	tcpd		\
410	terminfo	\
411	th_tools	\
412	tic		\
413	time		\
414	tip		\
415	tnf		\
416	touch		\
417	tput		\
418	tr		\
419	trapstat	\
420	troff		\
421	true		\
422	truss		\
423	tsol		\
424	tty		\
425	ttymon		\
426	tzreload	\
427	uadmin		\
428	ul		\
429	uname		\
430	units		\
431	unlink		\
432	unpack		\
433	userattr	\
434	users		\
435	utmp_update	\
436	utmpd		\
437	uuidgen		\
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	lms		\
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	lvm		\
622	mailx		\
623	make		\
624	man		\
625	mesg		\
626	mkdir		\
627	mkpwdict	\
628	mktemp		\
629	more		\
630	mpathadm	\
631	msgfmt		\
632	mv		\
633	ndmpadm		\
634	ndmpstat	\
635	newgrp		\
636	newtask		\
637	nice		\
638	nohup		\
639	oawk		\
640	pack		\
641	passwd		\
642	passmgmt	\
643	pathchk		\
644	pfexec		\
645	pg		\
646	pgrep		\
647	picl            \
648	pools		\
649	power		\
650	pr		\
651	praudit		\
652	print		\
653	profiles	\
654	projadd		\
655	projects	\
656	prstat		\
657	prtdiag		\
658	ps		\
659	psrinfo		\
660	ptools		\
661	pwconv		\
662	pwd		\
663	pyzfs		\
664	raidctl		\
665	ramdiskadm	\
666	rcap		\
667	rcm_daemon	\
668	refer		\
669	regcmp		\
670	renice		\
671	roles		\
672	rm		\
673	rmdir		\
674	rmformat	\
675	rmmount		\
676	rmvolmgr	\
677	sasinfo		\
678	sbdadm		\
679	scadm		\
680	script		\
681	scsi		\
682	sdiff		\
683	sdpadm		\
684	sgs		\
685	sh		\
686	shcomp		\
687	smbsrv		\
688	sort		\
689	split		\
690	srptadm		\
691	ssh		\
692	stat		\
693	stmfadm		\
694	stmsboot	\
695	strings		\
696	su		\
697	svc		\
698	svr4pkg		\
699	swap		\
700	syseventadm	\
701	syseventd	\
702	tabs		\
703	tar		\
704	tbl		\
705	time		\
706	tnf		\
707	touch		\
708	tput		\
709	troff		\
710	tsol		\
711	tty		\
712	ttymon		\
713	tzreload	\
714	ul		\
715	uname		\
716	units		\
717	unlink		\
718	unpack		\
719	userattr	\
720	valtools	\
721	vgrind		\
722	vi		\
723	volcheck	\
724	volrmmount	\
725	vrrpadm		\
726	vscan		\
727	w		\
728	who		\
729	whodo		\
730	wracct		\
731	write		\
732	xargs		\
733	yppasswd	\
734	zdump		\
735	zevadm		\
736	zfs		\
737	zic		\
738	zlogin		\
739	zoneadm		\
740	zoneadmd	\
741	zonecfg		\
742	zonename	\
743	zpool		\
744	zonestat
745
746sparc_MSGSUBDIRS=	\
747	fruadm		\
748	prtdscp		\
749	prtfru		\
750	virtinfo	\
751	vntsd
752
753i386_MSGSUBDIRS=	\
754	ucodeadm
755
756#
757# commands that use dcgettext for localized time, LC_TIME
758#
759DCSUBDIRS=		\
760	cal		\
761	cfgadm		\
762	diff		\
763	ls		\
764	pr		\
765	ps		\
766	tar		\
767	w		\
768	who		\
769	whodo		\
770	write
771
772#
773# commands that belong only to audit.
774#
775AUDITSUBDIRS=		\
776	amt		\
777	audit		\
778	audit_warn	\
779	auditconfig	\
780	auditd		\
781	auditrecord	\
782	auditreduce	\
783	auditset	\
784	auditstat	\
785	praudit
786
787#
788# commands not owned by the systems group
789#
790BWOSDIRS=
791
792
793all :=		TARGET = all
794install :=	TARGET = install
795clean :=	TARGET = clean
796clobber :=	TARGET = clobber
797lint :=		TARGET = lint
798_msg :=		TARGET = _msg
799_dc :=		TARGET = _dc
800
801.KEEP_STATE:
802
803SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
804
805.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
806
807all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
808	$(AUDITSUBDIRS)
809
810#
811# Manifests cannot be checked in parallel, because we are using
812# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
813# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
814# we spawn off a sub-make to perform the non-parallel 'make check'
815#
816check:
817	$(MAKE) -f Makefile.check check
818
819#
820# The .WAIT directive works around an apparent bug in parallel make.
821# Evidently make was getting the target _msg vs. _dc confused under
822# some level of parallelization, causing some of the _dc objects
823# not to be built.
824#
825_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
826
827_dc: $(DCSUBDIRS)
828
829#
830# Dependencies
831#
832fs.d: fstyp
833ksh:	shcomp isaexec
834mdb:	terminfo
835print:	lp
836fmt:	mailx
837
838$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
839	@if [ -f $@/Makefile  ]; then \
840		cd $@; pwd; $(MAKE) $(TARGET); \
841	else \
842		true; \
843	fi
844
845FRC:
846