xref: /illumos-gate/usr/src/cmd/Makefile (revision 83eaeac78ef2f69de16c2fecd3077c0ee9269743)
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 2010 Nexenta Systems, Inc.  All rights reserved.
24
25include ../Makefile.master
26
27#
28#	Note that the commands 'agents', 'lp', 'perl', and 'man' are first in
29#	the list, violating alphabetical order.  This is because they are very
30#	long-running and should be given the most wall-clock time for a
31#	parallel build.
32#
33#	Commands in the FIRST_SUBDIRS list are built before starting the build
34#	of other commands.  Currently this includes only 'isaexec' and
35#	'platexec'.  This is necessary because $(ROOT)/usr/lib/isaexec or
36#	$(ROOT)/usr/lib/platexec must exist when some other commands are built
37#	because their 'make install' creates a hard link to one of them.
38#
39#	Commands are listed one per line so that TeamWare can auto-merge most
40#	changes.
41#
42
43FIRST_SUBDIRS=		\
44	isaexec		\
45	platexec
46
47COMMON_SUBDIRS=		\
48	agents		\
49	allocate	\
50	availdevs	\
51	lp		\
52	perl		\
53	man		\
54	Adm		\
55	abi		\
56	adbgen		\
57	acct		\
58	acctadm		\
59	arch		\
60	asa		\
61	ast		\
62	audio		\
63	auths		\
64	autopush	\
65	avs		\
66	awk		\
67	awk_xpg4	\
68	backup		\
69	banner		\
70	bart		\
71	basename	\
72	bc		\
73	bdiff		\
74	beadm		\
75	bfs		\
76	bnu		\
77	boot		\
78	busstat		\
79	cal		\
80	calendar	\
81	captoinfo	\
82	cat		\
83	cdrw		\
84	cfgadm		\
85	checkeq		\
86	checknr		\
87	chgrp		\
88	chmod		\
89	chown		\
90	chroot		\
91	clear		\
92	clinfo		\
93	cmd-crypto	\
94	cmd-inet	\
95	col		\
96	compress	\
97	consadm		\
98	coreadm		\
99	cpio		\
100	cpc		\
101	cron		\
102	crypt		\
103	csh		\
104	csplit		\
105	ctrun		\
106	ctstat		\
107	ctwatch		\
108	datadm		\
109	date		\
110	dc		\
111	dd		\
112	deroff		\
113	devfsadm	\
114	syseventd	\
115	devctl		\
116	devinfo		\
117	devmgmt		\
118	devprop		\
119	dfs.cmds	\
120	diff		\
121	diff3		\
122	diffmk		\
123	dircmp		\
124	dirname		\
125	dis		\
126	diskmgtd	\
127	dispadmin	\
128	dladm		\
129	dlstat		\
130	dmesg		\
131	dodatadm	\
132	dtrace		\
133	du		\
134	dumpadm		\
135	dumpcs		\
136	echo		\
137	ed		\
138	eeprom		\
139	egrep		\
140	eject		\
141	emul64ioctl	\
142	enhance		\
143	env		\
144	eqn		\
145	expand		\
146	expr		\
147	exstr		\
148	factor		\
149	false		\
150	fcinfo		\
151	fcoesvc		\
152	fdetach		\
153	fdformat	\
154	fdisk		\
155	filesync	\
156	fgrep		\
157	file		\
158	filebench	\
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	ipf		\
209	isainfo		\
210	isalist		\
211	itutools	\
212	iscsiadm	\
213	iscsid		\
214	iscsitsvc	\
215	isns		\
216	itadm		\
217	java		\
218	kbd		\
219	keyserv		\
220	killall		\
221	krb5		\
222	ksh		\
223	kstat		\
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	machid		\
250	mail		\
251	mailx		\
252	makekey		\
253	mdb		\
254	mesg		\
255	mkdir		\
256	mkfifo		\
257	mkfile		\
258	mkmsgs		\
259	mknod		\
260	mkpwdict	\
261	mktemp		\
262	modload		\
263	more		\
264	mpathadm	\
265	msgfmt		\
266	msgid		\
267	mt		\
268	mv		\
269	mvdir		\
270	ndmpadm		\
271	ndmpd		\
272	ndmpstat	\
273	netadm		\
274	netfiles	\
275	newform		\
276	newgrp		\
277	news		\
278	newtask		\
279	nice		\
280	nl		\
281	nlsadmin	\
282	nohup		\
283	nsadmin		\
284	nscd		\
285	oamuser		\
286	oawk		\
287	od		\
288	pack		\
289	pagesize	\
290	passmgmt	\
291	passwd		\
292	pathchk		\
293	pbind		\
294	pcidr		\
295	pcitool		\
296	pfexec		\
297	pfexecd		\
298	pginfo		\
299	pgstat		\
300	pgrep		\
301	picl		\
302	plimit		\
303	policykit	\
304	pools		\
305	power		\
306	powertop	\
307	ppgsz		\
308	pg		\
309	plockstat	\
310	pr		\
311	prctl		\
312	print		\
313	printf		\
314	priocntl	\
315	profiles	\
316	projadd		\
317	projects	\
318	prstat		\
319	prtconf		\
320	prtdiag		\
321	prtvtoc		\
322	ps		\
323	psradm		\
324	psrinfo		\
325	psrset		\
326	ptools		\
327	pwck		\
328	pwconv		\
329	pwd		\
330	pyzfs		\
331	raidctl		\
332	ramdiskadm	\
333	rcap		\
334	rcm_daemon	\
335	rctladm		\
336	refer		\
337	regcmp		\
338	renice		\
339	rexd		\
340	rm		\
341	rmdir		\
342	rmformat	\
343	rmmount		\
344	rmt		\
345	rmvolmgr	\
346	roles		\
347	rpcbind		\
348	rpcgen		\
349	rpcinfo		\
350	rpcsvc		\
351	runat		\
352	sa		\
353	saf		\
354	sasinfo		\
355	savecore	\
356	sbdadm		\
357	script		\
358	scsi		\
359	sdiff		\
360	sdpadm		\
361	sendmail	\
362	setfacl		\
363	setmnt		\
364	setpgrp		\
365	setuname	\
366	sgs		\
367	sh		\
368	shcomp		\
369	smbios		\
370	smbsrv		\
371	smserverd	\
372	soelim		\
373	sort		\
374	spell		\
375	split		\
376	sqlite		\
377	srchtxt		\
378	srptadm		\
379	srptsvc		\
380	ssh		\
381	stat		\
382	stmfadm		\
383	stmfproxy	\
384	stmfsvc		\
385	stmsboot	\
386	streams		\
387	strings		\
388	su		\
389	sulogin		\
390	sunpc		\
391	svc		\
392	svr4pkg		\
393	swap		\
394	sync		\
395	sysdef		\
396	syseventadm	\
397	syslogd		\
398	tabs		\
399	tail		\
400	tar		\
401	tbl		\
402	tcopy		\
403	tcpd		\
404	terminfo	\
405	th_tools	\
406	tic		\
407	time		\
408	tip		\
409	tnf		\
410	touch		\
411	tplot		\
412	tput		\
413	tr		\
414	trapstat	\
415	troff		\
416	true		\
417	truss		\
418	tsol		\
419	tty		\
420	ttymon		\
421	tzreload	\
422	uadmin		\
423	ul		\
424	uname		\
425	units		\
426	unlink		\
427	unpack		\
428	userattr	\
429	users		\
430	utmp_update	\
431	utmpd		\
432	valtools	\
433	vgrind		\
434	vi		\
435	volcheck	\
436	volrmmount	\
437	vrrpadm		\
438	vscan		\
439	vt		\
440	w		\
441	wall		\
442	which		\
443	who		\
444	whodo		\
445	wracct		\
446	write		\
447	wusbadm		\
448	xargs		\
449	xstr		\
450	yes		\
451	ypcmd		\
452	yppasswd	\
453	zdb		\
454	zdump		\
455	zfs		\
456	zic		\
457	zinject		\
458	zlogin		\
459	zoneadm		\
460	zoneadmd	\
461	zonecfg		\
462	zonename	\
463	zpool		\
464	zlook		\
465	zonestat	\
466	zstreamdump	\
467	ztest
468
469$(CLOSED_BUILD)COMMON_SUBDIRS += \
470	$(CLOSED)/cmd/iconv	\
471	$(CLOSED)/cmd/ksh	\
472	$(CLOSED)/cmd/localedef	\
473	$(CLOSED)/cmd/more_xpg4	\
474	$(CLOSED)/cmd/mtst	\
475	$(CLOSED)/cmd/od	\
476	$(CLOSED)/cmd/patch	\
477	$(CLOSED)/cmd/pax	\
478	$(CLOSED)/cmd/printf	\
479	$(CLOSED)/cmd/sed	\
480	$(CLOSED)/cmd/sed_xpg4
481
482i386_SUBDIRS=		\
483	acpihpd		\
484	addbadsec	\
485	biosdev		\
486	diskscan	\
487	lms		\
488	ntfsprogs	\
489	parted		\
490	rtc		\
491	ucodeadm	\
492	xvm
493
494sparc_SUBDIRS=		\
495	cvcd		\
496	dcs		\
497	device_remap	\
498	drd		\
499	fps		\
500	fruadm		\
501	ldmad		\
502	oplhpd		\
503	prtdscp		\
504	prtfru		\
505	scadm		\
506	sckmd		\
507	sf880drd	\
508	virtinfo	\
509	vntsd
510
511#
512# Commands that are messaged.  Note that 'lp' and 'man' come first
513# (see previous comment about 'lp' and 'man').
514#
515MSGSUBDIRS=		\
516	lp		\
517	man		\
518	abi		\
519	acctadm		\
520	allocate	\
521	asa		\
522	audio		\
523	audit		\
524	auditconfig	\
525	auditd		\
526	auditrecord	\
527	auditset	\
528	auths		\
529	autopush	\
530	avs		\
531	awk		\
532	awk_xpg4	\
533	backup		\
534	banner		\
535	bart		\
536	basename	\
537	beadm		\
538	bnu		\
539	busstat		\
540	cal		\
541	cat		\
542	cdrw		\
543	cfgadm		\
544	checkeq		\
545	checknr		\
546	chgrp		\
547	chmod		\
548	chown		\
549	cmd-crypto	\
550	cmd-inet	\
551	col		\
552	compress	\
553	consadm		\
554	coreadm		\
555	cpio		\
556	cpc		\
557	cron		\
558	csh		\
559	csplit		\
560	ctrun		\
561	ctstat		\
562	ctwatch		\
563	datadm		\
564	date		\
565	dc		\
566	dcs		\
567	dd		\
568	deroff		\
569	devfsadm	\
570	dfs.cmds	\
571	diff		\
572	diffmk		\
573	dladm		\
574	dlstat		\
575	du		\
576	dumpcs		\
577	ed		\
578	eject		\
579	env		\
580	eqn		\
581	expand		\
582	expr		\
583	fcinfo		\
584	fgrep		\
585	file		\
586	filesync	\
587	find		\
588	flowadm		\
589	flowstat	\
590	fm		\
591	fold		\
592	fs.d		\
593	fwflash		\
594	geniconvtbl	\
595	genmsg		\
596	getconf		\
597	getent		\
598	gettext		\
599	gettxt		\
600	grep		\
601	grep_xpg4	\
602	grpck		\
603	gss		\
604	halt		\
605	head		\
606	hostname	\
607	hotplug		\
608	id		\
609	idmap		\
610	isaexec		\
611	iscsiadm	\
612	iscsid		\
613	isns		\
614	itadm		\
615	kbd		\
616	krb5		\
617	ksh		\
618	kstat		\
619	last		\
620	ldap		\
621	ldapcachemgr	\
622	lgrpinfo	\
623	locale		\
624	lofiadm		\
625	logadm		\
626	logger		\
627	logins		\
628	ls		\
629	luxadm		\
630	lvm		\
631	mailx		\
632	mesg		\
633	mkdir		\
634	mkpwdict	\
635	mktemp		\
636	more		\
637	mpathadm	\
638	msgfmt		\
639	mv		\
640	ndmpadm		\
641	ndmpstat	\
642	newgrp		\
643	newtask		\
644	nice		\
645	nohup		\
646	oawk		\
647	pack		\
648	passwd		\
649	passmgmt	\
650	pathchk		\
651	pfexec		\
652	pg		\
653	pgrep		\
654	picl            \
655	pools		\
656	power		\
657	pr		\
658	praudit		\
659	print		\
660	profiles	\
661	projadd		\
662	projects	\
663	prstat		\
664	prtdiag		\
665	ps		\
666	psrinfo		\
667	ptools		\
668	pwconv		\
669	pwd		\
670	pyzfs		\
671	raidctl		\
672	ramdiskadm	\
673	rcap		\
674	rcm_daemon	\
675	refer		\
676	regcmp		\
677	renice		\
678	roles		\
679	rm		\
680	rmdir		\
681	rmformat	\
682	rmmount		\
683	rmvolmgr	\
684	sasinfo		\
685	sbdadm		\
686	scadm		\
687	script		\
688	scsi		\
689	sdiff		\
690	sdpadm		\
691	sgs		\
692	sh		\
693	shcomp		\
694	smbsrv		\
695	sort		\
696	split		\
697	srptadm		\
698	ssh		\
699	stat		\
700	stmfadm		\
701	stmsboot	\
702	strings		\
703	su		\
704	svc		\
705	svr4pkg		\
706	swap		\
707	syseventadm	\
708	syseventd	\
709	tabs		\
710	tar		\
711	tbl		\
712	time		\
713	tnf		\
714	touch		\
715	tput		\
716	troff		\
717	tsol		\
718	tty		\
719	ttymon		\
720	tzreload	\
721	ul		\
722	uname		\
723	units		\
724	unlink		\
725	unpack		\
726	userattr	\
727	valtools	\
728	vgrind		\
729	vi		\
730	volcheck	\
731	volrmmount	\
732	vrrpadm		\
733	vscan		\
734	w		\
735	who		\
736	whodo		\
737	wracct		\
738	write		\
739	wusbadm		\
740	xargs		\
741	yppasswd	\
742	zdump		\
743	zfs		\
744	zic		\
745	zlogin		\
746	zoneadm		\
747	zoneadmd	\
748	zonecfg		\
749	zonename	\
750	zpool		\
751	zonestat
752
753$(CLOSED_BUILD)MSGSUBDIRS += \
754	$(CLOSED)/cmd/iconv	\
755	$(CLOSED)/cmd/ksh	\
756	$(CLOSED)/cmd/localedef	\
757	$(CLOSED)/cmd/more_xpg4	\
758	$(CLOSED)/cmd/od	\
759	$(CLOSED)/cmd/patch	\
760	$(CLOSED)/cmd/pax	\
761	$(CLOSED)/cmd/printf	\
762	$(CLOSED)/cmd/sed	\
763	$(CLOSED)/cmd/sed_xpg4
764
765sparc_MSGSUBDIRS=	\
766	fruadm		\
767	prtdscp		\
768	prtfru		\
769	virtinfo	\
770	vntsd
771
772i386_MSGSUBDIRS=	\
773	ucodeadm
774
775#
776# commands that use dcgettext for localized time, LC_TIME
777#
778DCSUBDIRS=		\
779	cal		\
780	cfgadm		\
781	diff		\
782	ls		\
783	pr		\
784	ps		\
785	tar		\
786	w		\
787	who		\
788	whodo		\
789	write
790
791$(CLOSED_BUILD)DCSUBDIRS += \
792	$(CLOSED)/cmd/pax
793
794#
795# commands that belong only to audit.
796#
797AUDITSUBDIRS=		\
798	amt		\
799	audit		\
800	audit_warn	\
801	auditconfig	\
802	auditd		\
803	auditrecord	\
804	auditreduce	\
805	auditset	\
806	auditstat	\
807	praudit
808
809#
810# commands not owned by the systems group
811#
812BWOSDIRS=
813
814
815all :=		TARGET = all
816install :=	TARGET = install
817clean :=	TARGET = clean
818clobber :=	TARGET = clobber
819lint :=		TARGET = lint
820_msg :=		TARGET = _msg
821_dc :=		TARGET = _dc
822
823.KEEP_STATE:
824
825SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
826
827.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
828
829all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
830	$(AUDITSUBDIRS)
831
832#
833# Manifests cannot be checked in parallel, because we are using
834# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
835# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
836# we spawn off a sub-make to perform the non-parallel 'make check'
837#
838check:
839	$(MAKE) -f Makefile.check check
840
841#
842# The .WAIT directive works around an apparent bug in parallel make.
843# Evidently make was getting the target _msg vs. _dc confused under
844# some level of parallelization, causing some of the _dc objects
845# not to be built.
846#
847_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
848
849_dc: $(DCSUBDIRS)
850
851#
852# Dependencies
853#
854fs.d: fstyp
855ksh:	shcomp isaexec
856mdb:	terminfo
857print:	lp
858
859$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
860	@if [ -f $@/Makefile  ]; then \
861		cd $@; pwd; $(MAKE) $(TARGET); \
862	else \
863		true; \
864	fi
865
866FRC:
867