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