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