xref: /illumos-gate/usr/src/cmd/Makefile (revision ead1f93ee620d7580f7e53350fe5a884fc4f158a)
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 2010 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
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	agents		\
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	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	des		\
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	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	fm		\
161	fmli		\
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	graph		\
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	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	iscsi		\
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	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	mms		\
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	pack		\
288	pagesize	\
289	passmgmt	\
290	passwd		\
291	pathchk		\
292	pbind		\
293	pcidr		\
294	pcitool		\
295	pfexec		\
296	pgrep		\
297	picl		\
298	plimit		\
299	policykit	\
300	pools		\
301	power		\
302	powertop	\
303	ppgsz		\
304	pg		\
305	plockstat	\
306	pr		\
307	prctl		\
308	print		\
309	priocntl	\
310	profiles	\
311	projadd		\
312	projects	\
313	prstat		\
314	prtconf		\
315	prtdiag		\
316	prtvtoc		\
317	ps		\
318	psradm		\
319	psrinfo		\
320	psrset		\
321	ptools		\
322	pwck		\
323	pwconv		\
324	pwd		\
325	pyzfs		\
326	raidctl		\
327	ramdiskadm	\
328	rcap		\
329	rcm_daemon	\
330	rctladm		\
331	refer		\
332	regcmp		\
333	renice		\
334	rexd		\
335	rm		\
336	rmdir		\
337	rmformat	\
338	rmmount		\
339	rmt		\
340	rmvolmgr	\
341	roles		\
342	rpcbind		\
343	rpcgen		\
344	rpcinfo		\
345	rpcsvc		\
346	runat		\
347	sa		\
348	saf		\
349	sasinfo		\
350	savecore	\
351	sbdadm		\
352	script		\
353	scsi		\
354	sdiff		\
355	sdpadm		\
356	sendmail	\
357	setfacl		\
358	setmnt		\
359	setpgrp		\
360	setuname	\
361	sgs		\
362	sh		\
363	shcomp		\
364	smbios		\
365	smbsrv		\
366	smserverd	\
367	soelim		\
368	sort		\
369	spell		\
370	spline		\
371	split		\
372	sqlite		\
373	srchtxt		\
374	srptsvc		\
375	ssh		\
376	stat		\
377	stmfadm		\
378	stmfproxy	\
379	stmfsvc		\
380	stmsboot	\
381	streams		\
382	strings		\
383	su		\
384	sulogin		\
385	sunpc		\
386	svc		\
387	svr4pkg		\
388	swap		\
389	sync		\
390	sysdef		\
391	syseventadm	\
392	syslogd		\
393	tabs		\
394	tar		\
395	tbl		\
396	tcopy		\
397	tcpd		\
398	terminfo	\
399	th_tools	\
400	tic		\
401	time		\
402	tip		\
403	tnf		\
404	touch		\
405	tplot		\
406	tput		\
407	trapstat	\
408	troff		\
409	true		\
410	truss		\
411	tsol		\
412	tty		\
413	ttymon		\
414	tzreload	\
415	uadmin		\
416	ul		\
417	uname		\
418	units		\
419	unlink		\
420	unpack		\
421	users		\
422	utmp_update	\
423	utmpd		\
424	valtools	\
425	vgrind		\
426	vi		\
427	volcheck	\
428	volrmmount	\
429	vrrpadm		\
430	vscan		\
431	vt		\
432	w		\
433	wall		\
434	wbem		\
435	which		\
436	who		\
437	whodo		\
438	wracct		\
439	write		\
440	wusbadm		\
441	xargs		\
442	xstr		\
443	yes		\
444	ypcmd		\
445	yppasswd	\
446	zdb		\
447	zdump		\
448	zfs		\
449	zic		\
450	zinject		\
451	zlogin		\
452	zoneadm		\
453	zoneadmd	\
454	zonecfg		\
455	zonename	\
456	zpool		\
457	zlook		\
458	zstreamdump	\
459	ztest
460
461$(CLOSED_BUILD)COMMON_SUBDIRS += \
462	$(CLOSED)/cmd/iconv	\
463	$(CLOSED)/cmd/ksh	\
464	$(CLOSED)/cmd/llc2	\
465	$(CLOSED)/cmd/localedef	\
466	$(CLOSED)/cmd/more_xpg4	\
467	$(CLOSED)/cmd/mtst	\
468	$(CLOSED)/cmd/od	\
469	$(CLOSED)/cmd/patch	\
470	$(CLOSED)/cmd/pax	\
471	$(CLOSED)/cmd/printf	\
472	$(CLOSED)/cmd/sed	\
473	$(CLOSED)/cmd/sed_xpg4	\
474ODE	$(CLOSED)/cmd/tail	\
475	$(CLOSED)/cmd/tr_xpg4
476
477i386_SUBDIRS=		\
478	addbadsec	\
479	biosdev		\
480	diskscan	\
481	lms		\
482	ntfsprogs	\
483	parted		\
484	rtc		\
485	ucodeadm	\
486	xvm
487
488sparc_SUBDIRS=		\
489	cvcd		\
490	dcs		\
491	device_remap	\
492	drd		\
493	fps		\
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' and 'man' come first
507# (see previous comment about 'lp' and 'man').
508#
509MSGSUBDIRS=		\
510	lp		\
511	man		\
512	abi		\
513	acctadm		\
514	allocate	\
515	asa		\
516	audio		\
517	audit		\
518	auditd		\
519	auditrecord	\
520	auths		\
521	autopush	\
522	avs		\
523	awk		\
524	awk_xpg4	\
525	backup		\
526	banner		\
527	bart		\
528	basename	\
529	bnu		\
530	bsmconv		\
531	bsmunconv	\
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	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	fm		\
582	fold		\
583	fs.d		\
584	fwflash		\
585	geniconvtbl	\
586	genmsg		\
587	getconf		\
588	getent		\
589	gettext		\
590	gettxt		\
591	grep		\
592	grep_xpg4	\
593	grpck		\
594	gss		\
595	halt		\
596	head		\
597	hostname	\
598	hotplug		\
599	id		\
600	idmap		\
601	isaexec		\
602	iscsi		\
603	iscsiadm	\
604	iscsid		\
605	isns		\
606	itadm		\
607	kbd		\
608	krb5		\
609	ksh		\
610	kstat		\
611	last		\
612	ldap		\
613	ldapcachemgr	\
614	lgrpinfo	\
615	locale		\
616	lofiadm		\
617	logadm		\
618	logger		\
619	logins		\
620	ls		\
621	luxadm		\
622	lvm		\
623	mailx		\
624	mesg		\
625	mkdir		\
626	mkpwdict	\
627	mktemp		\
628	more		\
629	mpathadm	\
630	msgfmt		\
631	mv		\
632	ndmpadm		\
633	ndmpstat	\
634	newgrp		\
635	newtask		\
636	nice		\
637	nohup		\
638	oawk		\
639	pack		\
640	passwd		\
641	passmgmt	\
642	pathchk		\
643	pfexec		\
644	pg		\
645	pgrep		\
646	picl            \
647	pools		\
648	power		\
649	pr		\
650	praudit		\
651	print		\
652	profiles	\
653	projadd		\
654	projects	\
655	prstat		\
656	prtdiag		\
657	ps		\
658	psrinfo		\
659	ptools		\
660	pwconv		\
661	pwd		\
662	pyzfs		\
663	raidctl		\
664	ramdiskadm	\
665	rcap		\
666	rcm_daemon	\
667	refer		\
668	regcmp		\
669	renice		\
670	roles		\
671	rm		\
672	rmdir		\
673	rmformat	\
674	rmmount		\
675	rmvolmgr	\
676	sasinfo		\
677	sbdadm		\
678	scadm		\
679	script		\
680	scsi		\
681	sdiff		\
682	sdpadm		\
683	sgs		\
684	sh		\
685	shcomp		\
686	smbsrv		\
687	sort		\
688	split		\
689	ssh		\
690	stat		\
691	stmfadm		\
692	stmsboot	\
693	strings		\
694	su		\
695	svc		\
696	svr4pkg		\
697	swap		\
698	syseventadm	\
699	syseventd	\
700	tabs		\
701	tar		\
702	tbl		\
703	time		\
704	tnf		\
705	touch		\
706	tput		\
707	troff		\
708	tsol		\
709	tty		\
710	ttymon		\
711	tzreload	\
712	ul		\
713	uname		\
714	units		\
715	unlink		\
716	unpack		\
717	valtools	\
718	vgrind		\
719	vi		\
720	volcheck	\
721	volrmmount	\
722	vrrpadm		\
723	vscan		\
724	w		\
725	wbem		\
726	who		\
727	whodo		\
728	wracct		\
729	write		\
730	wusbadm		\
731	xargs		\
732	yppasswd	\
733	zdump		\
734	zfs		\
735	zic		\
736	zlogin		\
737	zoneadm		\
738	zoneadmd	\
739	zonecfg		\
740	zonename	\
741	zpool
742
743$(CLOSED_BUILD)MSGSUBDIRS += \
744	$(CLOSED)/cmd/iconv	\
745	$(CLOSED)/cmd/ksh	\
746	$(CLOSED)/cmd/llc2	\
747	$(CLOSED)/cmd/localedef	\
748	$(CLOSED)/cmd/more_xpg4	\
749	$(CLOSED)/cmd/od	\
750	$(CLOSED)/cmd/patch	\
751	$(CLOSED)/cmd/pax	\
752	$(CLOSED)/cmd/printf	\
753	$(CLOSED)/cmd/sed	\
754	$(CLOSED)/cmd/sed_xpg4	\
755	$(CLOSED)/cmd/tail	\
756	$(CLOSED)/cmd/tr_xpg4
757
758sparc_MSGSUBDIRS=	\
759	fruadm		\
760	prtdscp		\
761	prtfru		\
762	virtinfo	\
763	vntsd
764
765i386_MSGSUBDIRS=	\
766	ucodeadm
767
768#
769# commands that use dcgettext for localized time, LC_TIME
770#
771DCSUBDIRS=		\
772	cal		\
773	cfgadm		\
774	diff		\
775	ls		\
776	pr		\
777	ps		\
778	tar		\
779	w		\
780	who		\
781	whodo		\
782	write
783
784$(CLOSED_BUILD)DCSUBDIRS += \
785	$(CLOSED)/cmd/pax
786
787#
788# commands that belong only to audit and device allocation
789#
790AUDITSUBDIRS=		\
791	allocate	\
792	amt		\
793	audit		\
794	audit_warn	\
795	auditconfig	\
796	auditd		\
797	auditrecord	\
798	auditreduce	\
799	auditstat	\
800	praudit		\
801	bsmconv		\
802	bsmunconv
803
804#
805# commands not owned by the systems group
806#
807BWOSDIRS=
808
809
810all :=		TARGET = all
811install :=	TARGET = install
812clean :=	TARGET = clean
813clobber :=	TARGET = clobber
814lint :=		TARGET = lint
815_msg :=		TARGET = _msg
816_dc :=		TARGET = _dc
817
818.KEEP_STATE:
819
820SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
821
822.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
823
824all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
825	$(AUDITSUBDIRS)
826
827#
828# Manifests cannot be checked in parallel, because we are using
829# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
830# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
831# we spawn off a sub-make to perform the non-parallel 'make check'
832#
833check:
834	$(MAKE) -f Makefile.check check
835
836#
837# The .WAIT directive works around an apparent bug in parallel make.
838# Evidently make was getting the target _msg vs. _dc confused under
839# some level of parallelization, causing some of the _dc objects
840# not to be built.
841#
842_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
843
844_dc: $(DCSUBDIRS)
845
846#
847# Dependencies
848#
849fs.d: fstyp
850ksh:	shcomp isaexec
851print:	lp
852
853$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
854	@if [ -f $@/Makefile  ]; then \
855		cd $@; pwd; $(MAKE) $(TARGET); \
856	else \
857		true; \
858	fi
859
860FRC:
861