xref: /illumos-gate/usr/src/cmd/Makefile (revision 9110f20833d36083ea5ffa2dcd62e4fe6e669940)
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# Copyright 2011 Joyent, Inc.  All rights reserved.
25
26include ../Makefile.master
27
28#
29#	Note that the commands 'agents', 'lp', 'perl', and 'man' are first in
30#	the list, violating alphabetical order.  This is because they are very
31#	long-running and should be given the most wall-clock time for a
32#	parallel build.
33#
34#	Commands in the FIRST_SUBDIRS list are built before starting the build
35#	of other commands.  Currently this includes only 'isaexec' and
36#	'platexec'.  This is necessary because $(ROOT)/usr/lib/isaexec or
37#	$(ROOT)/usr/lib/platexec must exist when some other commands are built
38#	because their 'make install' creates a hard link to one of them.
39#
40#	Commands are listed one per line so that TeamWare can auto-merge most
41#	changes.
42#
43
44FIRST_SUBDIRS=		\
45	isaexec		\
46	platexec
47
48COMMON_SUBDIRS=		\
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	kvmstat		\
225	last		\
226	lastcomm	\
227	latencytop	\
228	ldap		\
229	ldapcachemgr	\
230	lgrpinfo	\
231	line		\
232	link		\
233	dlmgmtd		\
234	listen		\
235	loadkeys	\
236	locale		\
237	localedef	\
238	lockstat	\
239	locator		\
240	lofiadm		\
241	logadm		\
242	logger		\
243	login		\
244	logins		\
245	look		\
246	ls		\
247	luxadm		\
248	lvm		\
249	mach		\
250	machid		\
251	mail		\
252	mailx		\
253	makekey		\
254	mdb		\
255	mesg		\
256	mkdir		\
257	mkfifo		\
258	mkfile		\
259	mkmsgs		\
260	mknod		\
261	mkpwdict	\
262	mktemp		\
263	modload		\
264	more		\
265	mpathadm	\
266	msgfmt		\
267	msgid		\
268	mt		\
269	mv		\
270	mvdir		\
271	ndmpadm		\
272	ndmpd		\
273	ndmpstat	\
274	netadm		\
275	netfiles	\
276	newform		\
277	newgrp		\
278	news		\
279	newtask		\
280	nice		\
281	nl		\
282	nlsadmin	\
283	nohup		\
284	nsadmin		\
285	nscd		\
286	oamuser		\
287	oawk		\
288	od		\
289	pack		\
290	pagesize	\
291	passmgmt	\
292	passwd		\
293	pathchk		\
294	pbind		\
295	pcidr		\
296	pcitool		\
297	pfexec		\
298	pfexecd		\
299	pginfo		\
300	pgstat		\
301	pgrep		\
302	picl		\
303	plimit		\
304	policykit	\
305	pools		\
306	power		\
307	powertop	\
308	ppgsz		\
309	pg		\
310	plockstat	\
311	pr		\
312	prctl		\
313	print		\
314	printf		\
315	priocntl	\
316	profiles	\
317	projadd		\
318	projects	\
319	prstat		\
320	prtconf		\
321	prtdiag		\
322	prtvtoc		\
323	ps		\
324	psradm		\
325	psrinfo		\
326	psrset		\
327	ptools		\
328	pwck		\
329	pwconv		\
330	pwd		\
331	pyzfs		\
332	raidctl		\
333	ramdiskadm	\
334	rcap		\
335	rcm_daemon	\
336	rctladm		\
337	refer		\
338	regcmp		\
339	renice		\
340	rexd		\
341	rm		\
342	rmdir		\
343	rmformat	\
344	rmmount		\
345	rmt		\
346	rmvolmgr	\
347	roles		\
348	rpcbind		\
349	rpcgen		\
350	rpcinfo		\
351	rpcsvc		\
352	runat		\
353	sa		\
354	saf		\
355	sasinfo		\
356	savecore	\
357	sbdadm		\
358	script		\
359	scsi		\
360	sdiff		\
361	sdpadm		\
362	sed		\
363	sendmail	\
364	setfacl		\
365	setmnt		\
366	setpgrp		\
367	setuname	\
368	sgs		\
369	sh		\
370	shcomp		\
371	smbios		\
372	smbsrv		\
373	smserverd	\
374	soelim		\
375	sort		\
376	spell		\
377	split		\
378	sqlite		\
379	srchtxt		\
380	srptadm		\
381	srptsvc		\
382	ssh		\
383	stat		\
384	stmfadm		\
385	stmfproxy	\
386	stmfsvc		\
387	stmsboot	\
388	streams		\
389	strings		\
390	su		\
391	sulogin		\
392	sunpc		\
393	svc		\
394	svr4pkg		\
395	swap		\
396	sync		\
397	sysdef		\
398	syseventadm	\
399	syslogd		\
400	tabs		\
401	tail		\
402	tar		\
403	tbl		\
404	tcopy		\
405	tcpd		\
406	terminfo	\
407	th_tools	\
408	tic		\
409	time		\
410	tip		\
411	tnf		\
412	touch		\
413	tput		\
414	tr		\
415	trapstat	\
416	troff		\
417	true		\
418	truss		\
419	tsol		\
420	tty		\
421	ttymon		\
422	tzreload	\
423	uadmin		\
424	ul		\
425	uname		\
426	units		\
427	unlink		\
428	unpack		\
429	userattr	\
430	users		\
431	utmp_update	\
432	utmpd		\
433	valtools	\
434	vgrind		\
435	vi		\
436	volcheck	\
437	volrmmount	\
438	vrrpadm		\
439	vscan		\
440	vt		\
441	w		\
442	wall		\
443	which		\
444	who		\
445	whodo		\
446	wracct		\
447	write		\
448	wusbadm		\
449	xargs		\
450	xstr		\
451	yes		\
452	ypcmd		\
453	yppasswd	\
454	zdb		\
455	zdump		\
456	zfs		\
457	zic		\
458	zinject		\
459	zlogin		\
460	zoneadm		\
461	zoneadmd	\
462	zonecfg		\
463	zonename	\
464	zpool		\
465	zlook		\
466	zonestat	\
467	zstreamdump	\
468	ztest
469
470$(CLOSED_BUILD)COMMON_SUBDIRS += \
471	$(CLOSED)/cmd/iconv	\
472	$(CLOSED)/cmd/ksh	\
473	$(CLOSED)/cmd/localedef	\
474	$(CLOSED)/cmd/more_xpg4	\
475	$(CLOSED)/cmd/mtst	\
476	$(CLOSED)/cmd/od	\
477	$(CLOSED)/cmd/patch	\
478	$(CLOSED)/cmd/pax	\
479	$(CLOSED)/cmd/printf	\
480	$(CLOSED)/cmd/sed	\
481	$(CLOSED)/cmd/sed_xpg4
482
483i386_SUBDIRS=		\
484	acpihpd		\
485	addbadsec	\
486	biosdev		\
487	diskscan	\
488	lms		\
489	ntfsprogs	\
490	parted		\
491	rtc		\
492	ucodeadm	\
493	xvm
494
495sparc_SUBDIRS=		\
496	cvcd		\
497	dcs		\
498	device_remap	\
499	drd		\
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