xref: /titanic_52/usr/src/cmd/Makefile (revision 5403172acfed6a387c70d9cddbc195d9ba8c1e05)
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	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	des		\
114	devfsadm	\
115	syseventd	\
116	devctl		\
117	devinfo		\
118	devmgmt		\
119	devprop		\
120	dfs.cmds	\
121	diff		\
122	diff3		\
123	diffmk		\
124	dircmp		\
125	dirname		\
126	dis		\
127	diskmgtd	\
128	dispadmin	\
129	dladm		\
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	fm		\
162	fmli		\
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	graph		\
185	grep		\
186	grep_xpg4	\
187	groups		\
188	grpck		\
189	gss		\
190	hal		\
191	halt		\
192	head		\
193	hostid		\
194	hostname	\
195	hotplug		\
196	hotplugd	\
197	hwdata		\
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	iscsi		\
212	itutools	\
213	iscsiadm	\
214	iscsid		\
215	iscsitsvc	\
216	isns		\
217	itadm		\
218	java		\
219	kbd		\
220	keyserv		\
221	killall		\
222	krb5		\
223	ksh		\
224	kstat		\
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	lockstat	\
238	locator		\
239	lofiadm		\
240	logadm		\
241	logger		\
242	login		\
243	logins		\
244	look		\
245	ls		\
246	luxadm		\
247	lvm		\
248	mach		\
249	machid		\
250	mail		\
251	mailx		\
252	makekey		\
253	mdb		\
254	mesg		\
255	mkdir		\
256	mkfifo		\
257	mkfile		\
258	mkmsgs		\
259	mknod		\
260	mkpwdict	\
261	mktemp		\
262	mms		\
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	nispasswd	\
282	nl		\
283	nlsadmin	\
284	nohup		\
285	nsadmin		\
286	nscd		\
287	oamuser		\
288	oawk		\
289	pack		\
290	pagesize	\
291	passmgmt	\
292	passwd		\
293	pathchk		\
294	pbind		\
295	pcidr		\
296	pcitool		\
297	pcmciad		\
298	pfexec		\
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	priocntl	\
313	profiles	\
314	projadd		\
315	projects	\
316	prstat		\
317	prtconf		\
318	prtdiag		\
319	prtvtoc		\
320	ps		\
321	psradm		\
322	psrinfo		\
323	psrset		\
324	ptools		\
325	pwck		\
326	pwconv		\
327	pwd		\
328	pyzfs		\
329	raidctl		\
330	ramdiskadm	\
331	rcap		\
332	rcm_daemon	\
333	rctladm		\
334	refer		\
335	regcmp		\
336	renice		\
337	rexd		\
338	rm		\
339	rmdir		\
340	rmformat	\
341	rmmount		\
342	rmt		\
343	rmvolmgr	\
344	roles		\
345	rpcbind		\
346	rpcgen		\
347	rpcinfo		\
348	rpcsvc		\
349	runat		\
350	sa		\
351	saf		\
352	sasinfo		\
353	savecore	\
354	sbdadm		\
355	script		\
356	scsi		\
357	sdiff		\
358	sdpadm		\
359	sendmail	\
360	setfacl		\
361	setmnt		\
362	setpgrp		\
363	setuname	\
364	sgs		\
365	sh		\
366	shcomp		\
367	smbios		\
368	smbsrv		\
369	smserverd	\
370	soelim		\
371	sort		\
372	spell		\
373	spline		\
374	split		\
375	sqlite		\
376	srchtxt		\
377	srptsvc		\
378	ssh		\
379	stat		\
380	stmfadm		\
381	stmfproxy	\
382	stmfsvc		\
383	stmsboot	\
384	streams		\
385	strings		\
386	su		\
387	sulogin		\
388	sunpc		\
389	svc		\
390	svr4pkg		\
391	swap		\
392	sync		\
393	sysdef		\
394	syseventadm	\
395	syslogd		\
396	tabs		\
397	tar		\
398	tbl		\
399	tcopy		\
400	tcpd		\
401	terminfo	\
402	th_tools	\
403	tic		\
404	time		\
405	tip		\
406	tnf		\
407	touch		\
408	tplot		\
409	tput		\
410	trapstat	\
411	troff		\
412	true		\
413	truss		\
414	tsol		\
415	tty		\
416	ttymon		\
417	uadmin		\
418	ul		\
419	uname		\
420	units		\
421	unlink		\
422	unpack		\
423	users		\
424	utmp_update	\
425	utmpd		\
426	valtools	\
427	vgrind		\
428	vi		\
429	volcheck	\
430	volrmmount	\
431	vscan		\
432	vt		\
433	w		\
434	wall		\
435	wbem		\
436	which		\
437	who		\
438	whodo		\
439	wracct		\
440	write		\
441	wusbadm		\
442	xargs		\
443	xstr		\
444	yes		\
445	ypcmd		\
446	yppasswd	\
447	zdb		\
448	zdump		\
449	zfs		\
450	zic		\
451	zinject		\
452	zlogin		\
453	zoneadm		\
454	zoneadmd	\
455	zonecfg		\
456	zonename	\
457	zpool		\
458	zlook		\
459	zstreamdump	\
460	ztest
461
462$(CLOSED_BUILD)COMMON_SUBDIRS += \
463	$(CLOSED)/cmd/iconv	\
464	$(CLOSED)/cmd/ksh	\
465	$(CLOSED)/cmd/llc2	\
466	$(CLOSED)/cmd/localedef	\
467	$(CLOSED)/cmd/more_xpg4	\
468	$(CLOSED)/cmd/mtst	\
469	$(CLOSED)/cmd/od	\
470	$(CLOSED)/cmd/patch	\
471	$(CLOSED)/cmd/pax	\
472	$(CLOSED)/cmd/printf	\
473	$(CLOSED)/cmd/sed	\
474	$(CLOSED)/cmd/sed_xpg4	\
475ODE	$(CLOSED)/cmd/tail	\
476	$(CLOSED)/cmd/tr_xpg4
477
478i386_SUBDIRS=		\
479	addbadsec	\
480	biosdev		\
481	diskscan	\
482	lms		\
483	ntfsprogs	\
484	parted		\
485	rtc		\
486	ucodeadm	\
487	xvm
488
489sparc_SUBDIRS=		\
490	cvcd		\
491	dcs		\
492	device_remap	\
493	drd		\
494	fps		\
495	fruadm		\
496	ldmad		\
497	oplhpd		\
498	prtdscp		\
499	prtfru		\
500	scadm		\
501	sckmd		\
502	sf880drd	\
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	nispasswd	\
638	nohup		\
639	oawk		\
640	pack		\
641	passwd		\
642	passmgmt	\
643	pathchk		\
644	pfexec		\
645	pg		\
646	pgrep		\
647	picl            \
648	pools		\
649	power		\
650	pr		\
651	praudit		\
652	print		\
653	profiles	\
654	projadd		\
655	projects	\
656	prstat		\
657	prtdiag		\
658	ps		\
659	psrinfo		\
660	ptools		\
661	pwconv		\
662	pwd		\
663	pyzfs		\
664	raidctl		\
665	ramdiskadm	\
666	rcap		\
667	rcm_daemon	\
668	refer		\
669	regcmp		\
670	renice		\
671	roles		\
672	rm		\
673	rmdir		\
674	rmformat	\
675	rmmount		\
676	rmvolmgr	\
677	sasinfo		\
678	sbdadm		\
679	scadm		\
680	script		\
681	scsi		\
682	sdiff		\
683	sdpadm		\
684	sgs		\
685	sh		\
686	shcomp		\
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	ul		\
712	uname		\
713	units		\
714	unlink		\
715	unpack		\
716	valtools	\
717	vgrind		\
718	vi		\
719	volcheck	\
720	volrmmount	\
721	w		\
722	wbem		\
723	who		\
724	whodo		\
725	wracct		\
726	write		\
727	wusbadm		\
728	xargs		\
729	yppasswd	\
730	zdump		\
731	zfs		\
732	zic		\
733	zlogin		\
734	zoneadm		\
735	zoneadmd	\
736	zonecfg		\
737	zonename	\
738	zpool
739
740$(CLOSED_BUILD)MSGSUBDIRS += \
741	$(CLOSED)/cmd/iconv	\
742	$(CLOSED)/cmd/ksh	\
743	$(CLOSED)/cmd/llc2	\
744	$(CLOSED)/cmd/localedef	\
745	$(CLOSED)/cmd/more_xpg4	\
746	$(CLOSED)/cmd/od	\
747	$(CLOSED)/cmd/patch	\
748	$(CLOSED)/cmd/pax	\
749	$(CLOSED)/cmd/printf	\
750	$(CLOSED)/cmd/sed	\
751	$(CLOSED)/cmd/sed_xpg4	\
752	$(CLOSED)/cmd/tail	\
753	$(CLOSED)/cmd/tr_xpg4
754
755sparc_MSGSUBDIRS=	\
756	fruadm		\
757	prtdscp		\
758	prtfru		\
759	vntsd
760
761i386_MSGSUBDIRS=	\
762	ucodeadm
763
764#
765# commands that use dcgettext for localized time, LC_TIME
766#
767DCSUBDIRS=		\
768	cal		\
769	cfgadm		\
770	diff		\
771	ls		\
772	pr		\
773	ps		\
774	tar		\
775	w		\
776	who		\
777	whodo		\
778	write
779
780$(CLOSED_BUILD)DCSUBDIRS += \
781	$(CLOSED)/cmd/pax
782
783#
784# commands that belong only to audit and device allocation
785#
786AUDITSUBDIRS=		\
787	allocate	\
788	amt		\
789	audit		\
790	audit_warn	\
791	auditconfig	\
792	auditd		\
793	auditrecord	\
794	auditreduce	\
795	auditstat	\
796	praudit		\
797	bsmconv		\
798	bsmunconv
799
800#
801# commands not owned by the systems group
802#
803BWOSDIRS=
804
805
806all :=		TARGET = all
807install :=	TARGET = install
808clean :=	TARGET = clean
809clobber :=	TARGET = clobber
810lint :=		TARGET = lint
811_msg :=		TARGET = _msg
812_dc :=		TARGET = _dc
813
814.KEEP_STATE:
815
816SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
817
818.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
819
820all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
821	$(AUDITSUBDIRS)
822
823#
824# Manifests cannot be checked in parallel, because we are using
825# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
826# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
827# we spawn off a sub-make to perform the non-parallel 'make check'
828#
829check:
830	$(MAKE) -f Makefile.check check
831
832#
833# The .WAIT directive works around an apparent bug in parallel make.
834# Evidently make was getting the target _msg vs. _dc confused under
835# some level of parallelization, causing some of the _dc objects
836# not to be built.
837#
838_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
839
840_dc: $(DCSUBDIRS)
841
842#
843# Dependencies
844#
845fs.d: fstyp
846ksh:	shcomp isaexec
847print:	lp
848
849$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
850	@if [ -f $@/Makefile  ]; then \
851		cd $@; pwd; $(MAKE) $(TARGET); \
852	else \
853		true; \
854	fi
855
856FRC:
857