xref: /titanic_50/usr/src/cmd/Makefile (revision e373b6e444a487df89a5dc6a4a4030b5b2aa87f9)
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	lms		\
484	nvmeadm		\
485	rtc		\
486	ucodeadm	\
487	xvm
488
489sparc_SUBDIRS=		\
490	cvcd		\
491	dcs		\
492	device_remap	\
493	drd		\
494	fruadm		\
495	ldmad		\
496	oplhpd		\
497	prtdscp		\
498	prtfru		\
499	scadm		\
500	sckmd		\
501	sf880drd	\
502	virtinfo	\
503	vntsd
504
505#
506# Commands that are messaged.  Note that 'lp' comes first
507# (see previous comment about 'lp'.)
508#
509MSGSUBDIRS=		\
510	lp		\
511	abi		\
512	acctadm		\
513	allocate	\
514	asa		\
515	audio		\
516	audit		\
517	auditconfig	\
518	auditd		\
519	auditrecord	\
520	auditset	\
521	auths		\
522	autopush	\
523	avs		\
524	awk		\
525	awk_xpg4	\
526	backup		\
527	banner		\
528	bart		\
529	basename	\
530	beadm		\
531	bnu		\
532	busstat		\
533	cal		\
534	cat		\
535	cdrw		\
536	cfgadm		\
537	checkeq		\
538	checknr		\
539	chgrp		\
540	chmod		\
541	chown		\
542	cmd-crypto	\
543	cmd-inet	\
544	col		\
545	compress	\
546	consadm		\
547	coreadm		\
548	cpio		\
549	cpc		\
550	cron		\
551	csh		\
552	csplit		\
553	ctrun		\
554	ctstat		\
555	ctwatch		\
556	datadm		\
557	date		\
558	dc		\
559	dcs		\
560	dd		\
561	deroff		\
562	devfsadm	\
563	dfs.cmds	\
564	diff		\
565	diffmk		\
566	dladm		\
567	dlstat		\
568	du		\
569	dumpcs		\
570	ed		\
571	eject		\
572	env		\
573	eqn		\
574	expand		\
575	expr		\
576	fcinfo		\
577	fgrep		\
578	file		\
579	filesync	\
580	find		\
581	flowadm		\
582	flowstat	\
583	fm		\
584	fold		\
585	fs.d		\
586	fwflash		\
587	geniconvtbl	\
588	genmsg		\
589	getconf		\
590	getent		\
591	gettext		\
592	gettxt		\
593	grep		\
594	grep_xpg4	\
595	grpck		\
596	gss		\
597	halt		\
598	head		\
599	hostname	\
600	hotplug		\
601	id		\
602	idmap		\
603	isaexec		\
604	iscsiadm	\
605	iscsid		\
606	isns		\
607	itadm		\
608	kbd		\
609	krb5		\
610	ksh		\
611	last		\
612	ldap		\
613	ldapcachemgr	\
614	lgrpinfo	\
615	locale		\
616	lofiadm		\
617	logadm		\
618	logger		\
619	logins		\
620	ls		\
621	luxadm		\
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