xref: /titanic_44/usr/src/cmd/Makefile (revision f05d7fc81533be643136e12ce92516d1d4292921)
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# Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
24# Copyright 2011 Joyent, Inc.  All rights reserved.
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	allocate	\
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	beadm		\
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	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	dlstat		\
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	flowstat	\
162	fm		\
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	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	ibd_upgrade	\
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	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	kvmstat		\
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	localedef	\
238	lockstat	\
239	locator		\
240	lofiadm		\
241	logadm		\
242	logger		\
243	login		\
244	logins		\
245	look		\
246	ls		\
247	luxadm		\
248	lvm		\
249	mach		\
250	machid		\
251	mail		\
252	mailx		\
253	makekey		\
254	mdb		\
255	mesg		\
256	mkdir		\
257	mkfifo		\
258	mkfile		\
259	mkmsgs		\
260	mknod		\
261	mkpwdict	\
262	mktemp		\
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	nl		\
282	nlsadmin	\
283	nohup		\
284	nsadmin		\
285	nscd		\
286	oamuser		\
287	oawk		\
288	od		\
289	pack		\
290	pagesize	\
291	passmgmt	\
292	passwd		\
293	pathchk		\
294	pbind		\
295	pcidr		\
296	pcitool		\
297	pfexec		\
298	pfexecd		\
299	pginfo		\
300	pgstat		\
301	pgrep		\
302	picl		\
303	plimit		\
304	policykit	\
305	pools		\
306	power		\
307	powertop	\
308	ppgsz		\
309	pg		\
310	plockstat	\
311	pr		\
312	prctl		\
313	print		\
314	printf		\
315	priocntl	\
316	profiles	\
317	projadd		\
318	projects	\
319	prstat		\
320	prtconf		\
321	prtdiag		\
322	prtvtoc		\
323	ps		\
324	psradm		\
325	psrinfo		\
326	psrset		\
327	ptools		\
328	pwck		\
329	pwconv		\
330	pwd		\
331	pyzfs		\
332	raidctl		\
333	ramdiskadm	\
334	rcap		\
335	rcm_daemon	\
336	rctladm		\
337	refer		\
338	regcmp		\
339	renice		\
340	rexd		\
341	rm		\
342	rmdir		\
343	rmformat	\
344	rmmount		\
345	rmt		\
346	rmvolmgr	\
347	roles		\
348	rpcbind		\
349	rpcgen		\
350	rpcinfo		\
351	rpcsvc		\
352	runat		\
353	sa		\
354	saf		\
355	sasinfo		\
356	savecore	\
357	sbdadm		\
358	script		\
359	scsi		\
360	sdiff		\
361	sdpadm		\
362	sed		\
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	split		\
378	sqlite		\
379	srchtxt		\
380	srptadm		\
381	srptsvc		\
382	ssh		\
383	stat		\
384	stmfadm		\
385	stmfproxy	\
386	stmfsvc		\
387	stmsboot	\
388	streams		\
389	strings		\
390	su		\
391	sulogin		\
392	sunpc		\
393	svc		\
394	svr4pkg		\
395	swap		\
396	sync		\
397	sysdef		\
398	syseventadm	\
399	syslogd		\
400	tabs		\
401	tail		\
402	tar		\
403	tbl		\
404	tcopy		\
405	tcpd		\
406	terminfo	\
407	th_tools	\
408	tic		\
409	time		\
410	tip		\
411	tnf		\
412	touch		\
413	tput		\
414	tr		\
415	trapstat	\
416	troff		\
417	true		\
418	truss		\
419	tsol		\
420	tty		\
421	ttymon		\
422	tzreload	\
423	uadmin		\
424	ul		\
425	uname		\
426	units		\
427	unlink		\
428	unpack		\
429	userattr	\
430	users		\
431	utmp_update	\
432	utmpd		\
433	valtools	\
434	vgrind		\
435	vi		\
436	volcheck	\
437	volrmmount	\
438	vrrpadm		\
439	vscan		\
440	vt		\
441	w		\
442	wall		\
443	which		\
444	who		\
445	whodo		\
446	wracct		\
447	write		\
448	wusbadm		\
449	xargs		\
450	xstr		\
451	yes		\
452	ypcmd		\
453	yppasswd	\
454	zdb		\
455	zdump		\
456	zfs		\
457	zic		\
458	zinject		\
459	zlogin		\
460	zoneadm		\
461	zoneadmd	\
462	zonecfg		\
463	zonename	\
464	zpool		\
465	zlook		\
466	zonestat	\
467	zstreamdump	\
468	ztest
469
470$(CLOSED_BUILD)COMMON_SUBDIRS += \
471	$(CLOSED)/cmd/iconv	\
472	$(CLOSED)/cmd/ksh	\
473	$(CLOSED)/cmd/localedef	\
474	$(CLOSED)/cmd/more_xpg4	\
475	$(CLOSED)/cmd/mtst	\
476	$(CLOSED)/cmd/od	\
477	$(CLOSED)/cmd/patch	\
478	$(CLOSED)/cmd/pax	\
479	$(CLOSED)/cmd/printf	\
480	$(CLOSED)/cmd/sed	\
481	$(CLOSED)/cmd/sed_xpg4
482
483i386_SUBDIRS=		\
484	acpihpd		\
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	ldmad		\
503	oplhpd		\
504	prtdscp		\
505	prtfru		\
506	scadm		\
507	sckmd		\
508	sf880drd	\
509	virtinfo	\
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	auditconfig	\
526	auditd		\
527	auditrecord	\
528	auditset	\
529	auths		\
530	autopush	\
531	avs		\
532	awk		\
533	awk_xpg4	\
534	backup		\
535	banner		\
536	bart		\
537	basename	\
538	beadm		\
539	bnu		\
540	busstat		\
541	cal		\
542	cat		\
543	cdrw		\
544	cfgadm		\
545	checkeq		\
546	checknr		\
547	chgrp		\
548	chmod		\
549	chown		\
550	cmd-crypto	\
551	cmd-inet	\
552	col		\
553	compress	\
554	consadm		\
555	coreadm		\
556	cpio		\
557	cpc		\
558	cron		\
559	csh		\
560	csplit		\
561	ctrun		\
562	ctstat		\
563	ctwatch		\
564	datadm		\
565	date		\
566	dc		\
567	dcs		\
568	dd		\
569	deroff		\
570	devfsadm	\
571	dfs.cmds	\
572	diff		\
573	diffmk		\
574	dladm		\
575	dlstat		\
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	flowstat	\
591	fm		\
592	fold		\
593	fs.d		\
594	fwflash		\
595	geniconvtbl	\
596	genmsg		\
597	getconf		\
598	getent		\
599	gettext		\
600	gettxt		\
601	grep		\
602	grep_xpg4	\
603	grpck		\
604	gss		\
605	halt		\
606	head		\
607	hostname	\
608	hotplug		\
609	id		\
610	idmap		\
611	isaexec		\
612	iscsiadm	\
613	iscsid		\
614	isns		\
615	itadm		\
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	ls		\
630	luxadm		\
631	lvm		\
632	mailx		\
633	mesg		\
634	mkdir		\
635	mkpwdict	\
636	mktemp		\
637	more		\
638	mpathadm	\
639	msgfmt		\
640	mv		\
641	ndmpadm		\
642	ndmpstat	\
643	newgrp		\
644	newtask		\
645	nice		\
646	nohup		\
647	oawk		\
648	pack		\
649	passwd		\
650	passmgmt	\
651	pathchk		\
652	pfexec		\
653	pg		\
654	pgrep		\
655	picl            \
656	pools		\
657	power		\
658	pr		\
659	praudit		\
660	print		\
661	profiles	\
662	projadd		\
663	projects	\
664	prstat		\
665	prtdiag		\
666	ps		\
667	psrinfo		\
668	ptools		\
669	pwconv		\
670	pwd		\
671	pyzfs		\
672	raidctl		\
673	ramdiskadm	\
674	rcap		\
675	rcm_daemon	\
676	refer		\
677	regcmp		\
678	renice		\
679	roles		\
680	rm		\
681	rmdir		\
682	rmformat	\
683	rmmount		\
684	rmvolmgr	\
685	sasinfo		\
686	sbdadm		\
687	scadm		\
688	script		\
689	scsi		\
690	sdiff		\
691	sdpadm		\
692	sgs		\
693	sh		\
694	shcomp		\
695	smbsrv		\
696	sort		\
697	split		\
698	srptadm		\
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	time		\
714	tnf		\
715	touch		\
716	tput		\
717	troff		\
718	tsol		\
719	tty		\
720	ttymon		\
721	tzreload	\
722	ul		\
723	uname		\
724	units		\
725	unlink		\
726	unpack		\
727	userattr	\
728	valtools	\
729	vgrind		\
730	vi		\
731	volcheck	\
732	volrmmount	\
733	vrrpadm		\
734	vscan		\
735	w		\
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	zonestat
753
754$(CLOSED_BUILD)MSGSUBDIRS += \
755	$(CLOSED)/cmd/iconv	\
756	$(CLOSED)/cmd/ksh	\
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
766sparc_MSGSUBDIRS=	\
767	fruadm		\
768	prtdscp		\
769	prtfru		\
770	virtinfo	\
771	vntsd
772
773i386_MSGSUBDIRS=	\
774	ucodeadm
775
776#
777# commands that use dcgettext for localized time, LC_TIME
778#
779DCSUBDIRS=		\
780	cal		\
781	cfgadm		\
782	diff		\
783	ls		\
784	pr		\
785	ps		\
786	tar		\
787	w		\
788	who		\
789	whodo		\
790	write
791
792$(CLOSED_BUILD)DCSUBDIRS += \
793	$(CLOSED)/cmd/pax
794
795#
796# commands that belong only to audit.
797#
798AUDITSUBDIRS=		\
799	amt		\
800	audit		\
801	audit_warn	\
802	auditconfig	\
803	auditd		\
804	auditrecord	\
805	auditreduce	\
806	auditset	\
807	auditstat	\
808	praudit
809
810#
811# commands not owned by the systems group
812#
813BWOSDIRS=
814
815
816all :=		TARGET = all
817install :=	TARGET = install
818clean :=	TARGET = clean
819clobber :=	TARGET = clobber
820lint :=		TARGET = lint
821_msg :=		TARGET = _msg
822_dc :=		TARGET = _dc
823
824.KEEP_STATE:
825
826SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
827
828.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
829
830all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
831	$(AUDITSUBDIRS)
832
833#
834# Manifests cannot be checked in parallel, because we are using
835# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
836# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
837# we spawn off a sub-make to perform the non-parallel 'make check'
838#
839check:
840	$(MAKE) -f Makefile.check check
841
842#
843# The .WAIT directive works around an apparent bug in parallel make.
844# Evidently make was getting the target _msg vs. _dc confused under
845# some level of parallelization, causing some of the _dc objects
846# not to be built.
847#
848_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
849
850_dc: $(DCSUBDIRS)
851
852#
853# Dependencies
854#
855fs.d: fstyp
856ksh:	shcomp isaexec
857mdb:	terminfo
858print:	lp
859
860$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
861	@if [ -f $@/Makefile  ]; then \
862		cd $@; pwd; $(MAKE) $(TARGET); \
863	else \
864		true; \
865	fi
866
867FRC:
868