xref: /titanic_44/usr/src/cmd/Makefile (revision 503ad85c168c7992ccc310af845a581cff3c72b5)
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	rpld		\
354	runat		\
355	sa		\
356	saf		\
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	ztest
466
467$(CLOSED_BUILD)COMMON_SUBDIRS += \
468	$(CLOSED)/cmd/iconv	\
469	$(CLOSED)/cmd/ksh	\
470	$(CLOSED)/cmd/llc2	\
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	$(CLOSED)/cmd/smartcard	\
481	$(CLOSED)/cmd/tail	\
482	$(CLOSED)/cmd/tr_xpg4
483
484i386_SUBDIRS=		\
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	fps		\
501	fruadm		\
502	oplhpd		\
503	prtdscp		\
504	prtfru		\
505	scadm		\
506	sckmd		\
507	sf880drd	\
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	auditd		\
524	auditrecord	\
525	auths		\
526	autopush	\
527	avs		\
528	awk		\
529	awk_xpg4	\
530	backup		\
531	banner		\
532	bart		\
533	basename	\
534	bnu		\
535	bsmconv		\
536	bsmunconv	\
537	busstat		\
538	cal		\
539	cat		\
540	cdrw		\
541	cfgadm		\
542	checkeq		\
543	checknr		\
544	chgrp		\
545	chmod		\
546	chown		\
547	cksum		\
548	cmd-crypto	\
549	cmd-inet	\
550	cmp		\
551	col		\
552	comm		\
553	compress	\
554	consadm		\
555	coreadm		\
556	cpio		\
557	cpc		\
558	cron		\
559	csh		\
560	csplit		\
561	ctrun		\
562	ctstat		\
563	ctwatch		\
564	cut		\
565	datadm		\
566	date		\
567	dc		\
568	dcs		\
569	dd		\
570	deroff		\
571	devfsadm	\
572	dfs.cmds	\
573	diff		\
574	diffmk		\
575	dladm		\
576	du		\
577	dumpcs		\
578	ed		\
579	eject		\
580	env		\
581	eqn		\
582	expand		\
583	expr		\
584	fcinfo		\
585	fgrep		\
586	file		\
587	filesync	\
588	find		\
589	flowadm		\
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	id		\
608	idmap		\
609	isaexec		\
610	iscsi		\
611	iscsiadm	\
612	iscsid		\
613	isns		\
614	itadm		\
615	join		\
616	kbd		\
617	krb5		\
618	ksh		\
619	kstat		\
620	last		\
621	ldap		\
622	ldapcachemgr	\
623	lgrpinfo	\
624	locale		\
625	lofiadm		\
626	logadm		\
627	logger		\
628	logins		\
629	logname		\
630	ls		\
631	luxadm		\
632	lvm		\
633	mailx		\
634	mesg		\
635	mkdir		\
636	mkpwdict	\
637	mktemp		\
638	more		\
639	mpathadm	\
640	msgfmt		\
641	mv		\
642	ndmpadm		\
643	ndmpstat	\
644	newgrp		\
645	newtask		\
646	nice		\
647	nispasswd	\
648	nohup		\
649	oawk		\
650	pack		\
651	passwd		\
652	passmgmt	\
653	paste		\
654	pathchk		\
655	pfexec		\
656	pg		\
657	pgrep		\
658	picl            \
659	pools		\
660	power		\
661	pr		\
662	praudit		\
663	print		\
664	profiles	\
665	projadd		\
666	projects	\
667	prstat		\
668	prtdiag		\
669	ps		\
670	psrinfo		\
671	ptools		\
672	pwconv		\
673	pwd		\
674	pyzfs		\
675	raidctl		\
676	ramdiskadm	\
677	rcap		\
678	rcm_daemon	\
679	refer		\
680	regcmp		\
681	renice		\
682	roles		\
683	rm		\
684	rmdir		\
685	rmformat	\
686	rmmount		\
687	rmvolmgr	\
688	sbdadm		\
689	scadm		\
690	script		\
691	scsi		\
692	sdiff		\
693	sdpadm		\
694	sgs		\
695	sh		\
696	shcomp		\
697	sort		\
698	split		\
699	ssh		\
700	stat		\
701	stmfadm		\
702	stmsboot	\
703	strings		\
704	su		\
705	svc		\
706	svr4pkg		\
707	swap		\
708	syseventadm	\
709	syseventd	\
710	tabs		\
711	tar		\
712	tbl		\
713	tee		\
714	time		\
715	tnf		\
716	touch		\
717	tput		\
718	troff		\
719	tsol		\
720	tty		\
721	ttymon		\
722	ul		\
723	uname		\
724	uniq		\
725	units		\
726	unlink		\
727	unpack		\
728	valtools	\
729	vgrind		\
730	vi		\
731	volcheck	\
732	volrmmount	\
733	w		\
734	wbem		\
735	wc		\
736	who		\
737	whodo		\
738	wracct		\
739	write		\
740	wusbadm		\
741	xargs		\
742	yppasswd	\
743	zdump		\
744	zfs		\
745	zic		\
746	zlogin		\
747	zoneadm		\
748	zoneadmd	\
749	zonecfg		\
750	zonename	\
751	zpool
752
753$(CLOSED_BUILD)MSGSUBDIRS += \
754	$(CLOSED)/cmd/iconv	\
755	$(CLOSED)/cmd/ksh	\
756	$(CLOSED)/cmd/llc2	\
757	$(CLOSED)/cmd/localedef	\
758	$(CLOSED)/cmd/more_xpg4	\
759	$(CLOSED)/cmd/od	\
760	$(CLOSED)/cmd/patch	\
761	$(CLOSED)/cmd/pax	\
762	$(CLOSED)/cmd/printf	\
763	$(CLOSED)/cmd/sed	\
764	$(CLOSED)/cmd/sed_xpg4	\
765	$(CLOSED)/cmd/tail	\
766	$(CLOSED)/cmd/tr_xpg4
767
768sparc_MSGSUBDIRS=	\
769	fruadm		\
770	prtdscp		\
771	prtfru		\
772	vntsd
773
774i386_MSGSUBDIRS=	\
775	ucodeadm
776
777#
778# commands that use dcgettext for localized time, LC_TIME
779#
780DCSUBDIRS=		\
781	cal		\
782	cfgadm		\
783	diff		\
784	ls		\
785	pr		\
786	ps		\
787	tar		\
788	w		\
789	who		\
790	whodo		\
791	write
792
793$(CLOSED_BUILD)DCSUBDIRS += \
794	$(CLOSED)/cmd/pax
795
796#
797# commands that belong only to audit and device allocation
798#
799AUDITSUBDIRS=		\
800	allocate	\
801	amt		\
802	audit		\
803	audit_warn	\
804	auditconfig	\
805	auditd		\
806	auditrecord	\
807	auditreduce	\
808	auditstat	\
809	praudit		\
810	bsmconv		\
811	bsmunconv
812
813#
814# commands not owned by the systems group
815#
816BWOSDIRS=
817
818
819all :=		TARGET = all
820install :=	TARGET = install
821clean :=	TARGET = clean
822clobber :=	TARGET = clobber
823lint :=		TARGET = lint
824_msg :=		TARGET = _msg
825_dc :=		TARGET = _dc
826
827.KEEP_STATE:
828
829SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
830
831.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
832
833all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
834	$(AUDITSUBDIRS)
835
836#
837# Manifests cannot be checked in parallel, because we are using
838# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
839# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
840# we spawn off a sub-make to perform the non-parallel 'make check'
841#
842check:
843	$(MAKE) -f Makefile.check check
844
845#
846# The .WAIT directive works around an apparent bug in parallel make.
847# Evidently make was getting the target _msg vs. _dc confused under
848# some level of parallelization, causing some of the _dc objects
849# not to be built.
850#
851_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
852
853_dc: $(DCSUBDIRS)
854
855#
856# Dependencies
857#
858fs.d: fstyp
859ksh:	shcomp isaexec
860print:	lp
861
862$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
863	@if [ -f $@/Makefile  ]; then \
864		cd $@; pwd; $(MAKE) $(TARGET); \
865	else \
866		true; \
867	fi
868
869FRC:
870