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