xref: /illumos-gate/usr/src/cmd/Makefile (revision 148434217c040ea38dc844384f6ba68d9b325906)
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	dtrace		\
136	du		\
137	dumpadm		\
138	dumpcs		\
139	echo		\
140	ed		\
141	eeprom		\
142	egrep		\
143	eject		\
144	emul64ioctl	\
145	enhance		\
146	env		\
147	eqn		\
148	expand		\
149	expr		\
150	exstr		\
151	factor		\
152	false		\
153	fcinfo		\
154	fdetach		\
155	fdformat	\
156	fdisk		\
157	filesync	\
158	fgrep		\
159	file		\
160	filebench	\
161	find		\
162	flowadm		\
163	fm		\
164	fmli		\
165	fmt		\
166	fmthard		\
167	fmtmsg		\
168	fold		\
169	format		\
170	fs.d		\
171	fstyp		\
172	fuser		\
173	fwflash		\
174	gcore		\
175	gencat		\
176	geniconvtbl	\
177	genmsg		\
178	getconf		\
179	getdevpolicy	\
180	getent		\
181	getfacl		\
182	getmajor	\
183	getopt		\
184	gettext		\
185	gettxt		\
186	graph		\
187	grep		\
188	grep_xpg4	\
189	groups		\
190	grpck		\
191	gss		\
192	hal		\
193	halt		\
194	head		\
195	hostid		\
196	hostname	\
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	join		\
220	kbd		\
221	keyserv		\
222	killall		\
223	krb5		\
224	ksh		\
225	kstat		\
226	last		\
227	lastcomm	\
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	logname		\
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	mms		\
264	modload		\
265	more		\
266	mpathadm	\
267	msgfmt		\
268	msgid		\
269	mt		\
270	mv		\
271	mvdir		\
272	ndmpadm		\
273	ndmpd		\
274	ndmpstat	\
275	netadm		\
276	netfiles	\
277	newform		\
278	newgrp		\
279	news		\
280	newtask		\
281	nice		\
282	nispasswd	\
283	nl		\
284	nlsadmin	\
285	nohup		\
286	nsadmin		\
287	nscd		\
288	oamuser		\
289	oawk		\
290	openssl		\
291	pack		\
292	pagesize	\
293	passmgmt	\
294	passwd		\
295	paste		\
296	pathchk		\
297	pbind		\
298	pcidr		\
299	pcmciad		\
300	pfexec		\
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	priocntl	\
315	profiles	\
316	projadd		\
317	projects	\
318	prstat		\
319	prtconf		\
320	prtdiag		\
321	prtvtoc		\
322	ps		\
323	psradm		\
324	psrinfo		\
325	psrset		\
326	ptools		\
327	pwck		\
328	pwconv		\
329	pwd		\
330	pyzfs		\
331	raidctl		\
332	ramdiskadm	\
333	rcap		\
334	rcm_daemon	\
335	rctladm		\
336	refer		\
337	regcmp		\
338	renice		\
339	rexd		\
340	rm		\
341	rmdir		\
342	rmformat	\
343	rmmount		\
344	rmt		\
345	rmvolmgr	\
346	roles		\
347	rpcbind		\
348	rpcgen		\
349	rpcinfo		\
350	rpcsvc		\
351	rpld		\
352	runat		\
353	sa		\
354	saf		\
355	savecore	\
356	sbdadm		\
357	script		\
358	scsi		\
359	sdiff		\
360	sdpadm		\
361	sendmail	\
362	setfacl		\
363	setmnt		\
364	setpgrp		\
365	setuname	\
366	sgs		\
367	sh		\
368	shcomp		\
369	smbios		\
370	smbsrv		\
371	smserverd	\
372	soelim		\
373	sort		\
374	spell		\
375	spline		\
376	split		\
377	sqlite		\
378	srchtxt		\
379	ssh		\
380	stat		\
381	stmfadm		\
382	stmfsvc		\
383	stmsboot	\
384	streams		\
385	strings		\
386	su		\
387	sulogin		\
388	sunpc		\
389	svc		\
390	swap		\
391	sync		\
392	sysdef		\
393	syseventadm	\
394	syslogd		\
395	tabs		\
396	tar		\
397	tbl		\
398	tcopy		\
399	tcpd		\
400	tee		\
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	uniq		\
421	units		\
422	unlink		\
423	unpack		\
424	users		\
425	utmp_update	\
426	utmpd		\
427	valtools	\
428	vgrind		\
429	vi		\
430	vna		\
431	volcheck	\
432	volrmmount	\
433	vscan		\
434	vt		\
435	w		\
436	wall		\
437	wbem		\
438	wc		\
439	which		\
440	who		\
441	whodo		\
442	wracct		\
443	write		\
444	xntpd		\
445	xargs		\
446	xstr		\
447	yes		\
448	ypcmd		\
449	yppasswd	\
450	zdb		\
451	zdump		\
452	zfs		\
453	zic		\
454	zinject		\
455	zlogin		\
456	zoneadm		\
457	zoneadmd	\
458	zonecfg		\
459	zonename	\
460	zpool		\
461	ztest
462
463$(CLOSED_BUILD)COMMON_SUBDIRS += \
464	$(CLOSED)/cmd/dodatadm	\
465	$(CLOSED)/cmd/iconv	\
466	$(CLOSED)/cmd/ksh	\
467	$(CLOSED)/cmd/llc2	\
468	$(CLOSED)/cmd/localedef	\
469	$(CLOSED)/cmd/more_xpg4	\
470	$(CLOSED)/cmd/mtst	\
471	$(CLOSED)/cmd/od	\
472	$(CLOSED)/cmd/patch	\
473	$(CLOSED)/cmd/pax	\
474	$(CLOSED)/cmd/pcitool	\
475	$(CLOSED)/cmd/printf	\
476	$(CLOSED)/cmd/sed	\
477	$(CLOSED)/cmd/sed_xpg4	\
478	$(CLOSED)/cmd/smartcard	\
479	$(CLOSED)/cmd/tail	\
480	$(CLOSED)/cmd/tr_xpg4
481
482i386_SUBDIRS=		\
483	addbadsec	\
484	biosdev		\
485	diskscan	\
486	lms		\
487	OWconfig	\
488	rtc		\
489	ucodeadm	\
490	xvm
491
492sparc_SUBDIRS=		\
493	cvcd		\
494	dcs		\
495	device_remap	\
496	drd		\
497	fps		\
498	fruadm		\
499	oplhpd		\
500	prtdscp		\
501	prtfru		\
502	scadm		\
503	sckmd		\
504	sf880drd	\
505	vntsd
506
507#
508# Commands that are messaged.  Note that 'lp' and 'man' come first
509# (see previous comment about 'lp' and 'man').
510#
511MSGSUBDIRS=		\
512	lp		\
513	man		\
514	abi		\
515	acctadm		\
516	allocate	\
517	asa		\
518	audio		\
519	audit		\
520	auditd		\
521	auths		\
522	autopush	\
523	avs		\
524	awk		\
525	awk_xpg4	\
526	backup		\
527	banner		\
528	bart		\
529	basename	\
530	bnu		\
531	bsmconv		\
532	bsmrecord	\
533	bsmunconv	\
534	busstat		\
535	cal		\
536	cat		\
537	cdrw		\
538	cfgadm		\
539	checkeq		\
540	checknr		\
541	chgrp		\
542	chmod		\
543	chown		\
544	cksum		\
545	cmd-crypto	\
546	cmd-inet	\
547	cmp		\
548	col		\
549	comm		\
550	compress	\
551	consadm		\
552	coreadm		\
553	cpio		\
554	cpc		\
555	cron		\
556	csh		\
557	csplit		\
558	ctrun		\
559	ctstat		\
560	ctwatch		\
561	cut		\
562	datadm		\
563	date		\
564	dc		\
565	dcs		\
566	dd		\
567	deroff		\
568	devfsadm	\
569	dfs.cmds	\
570	diff		\
571	diffmk		\
572	dladm		\
573	du		\
574	dumpcs		\
575	ed		\
576	eject		\
577	env		\
578	eqn		\
579	expand		\
580	expr		\
581	fcinfo		\
582	fgrep		\
583	file		\
584	filesync	\
585	find		\
586	flowadm		\
587	fm		\
588	fold		\
589	fs.d		\
590	fwflash		\
591	geniconvtbl	\
592	genmsg		\
593	getconf		\
594	getent		\
595	gettext		\
596	gettxt		\
597	grep		\
598	grep_xpg4	\
599	grpck		\
600	gss		\
601	halt		\
602	head		\
603	hostname	\
604	id		\
605	idmap		\
606	isaexec		\
607	iscsi		\
608	iscsiadm	\
609	iscsid		\
610	isns		\
611	itadm		\
612	join		\
613	kbd		\
614	krb5		\
615	ksh		\
616	kstat		\
617	last		\
618	ldap		\
619	ldapcachemgr	\
620	lgrpinfo	\
621	locale		\
622	lofiadm		\
623	logadm		\
624	logger		\
625	logins		\
626	logname		\
627	ls		\
628	luxadm		\
629	lvm		\
630	mailx		\
631	mesg		\
632	mkdir		\
633	mkpwdict	\
634	mktemp		\
635	more		\
636	mpathadm	\
637	msgfmt		\
638	mv		\
639	ndmpadm		\
640	ndmpstat	\
641	newgrp		\
642	newtask		\
643	nice		\
644	nispasswd	\
645	nohup		\
646	oawk		\
647	pack		\
648	passwd		\
649	passmgmt	\
650	paste		\
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	sbdadm		\
686	scadm		\
687	script		\
688	scsi		\
689	sdiff		\
690	sdpadm		\
691	sgs		\
692	sh		\
693	shcomp		\
694	sort		\
695	split		\
696	ssh		\
697	stat		\
698	stmfadm		\
699	stmsboot	\
700	strings		\
701	su		\
702	svc		\
703	swap		\
704	syseventadm	\
705	syseventd	\
706	tabs		\
707	tar		\
708	tbl		\
709	tee		\
710	time		\
711	tnf		\
712	touch		\
713	tput		\
714	troff		\
715	tsol		\
716	tty		\
717	ttymon		\
718	ul		\
719	uname		\
720	uniq		\
721	units		\
722	unlink		\
723	unpack		\
724	valtools	\
725	vgrind		\
726	vi		\
727	volcheck	\
728	volrmmount	\
729	w		\
730	wbem		\
731	wc		\
732	who		\
733	whodo		\
734	wracct		\
735	write		\
736	xargs		\
737	yppasswd	\
738	zdump		\
739	zfs		\
740	zic		\
741	zlogin		\
742	zoneadm		\
743	zoneadmd	\
744	zonecfg		\
745	zonename	\
746	zpool
747
748$(CLOSED_BUILD)MSGSUBDIRS += \
749	$(CLOSED)/cmd/iconv	\
750	$(CLOSED)/cmd/ksh	\
751	$(CLOSED)/cmd/llc2	\
752	$(CLOSED)/cmd/localedef	\
753	$(CLOSED)/cmd/more_xpg4	\
754	$(CLOSED)/cmd/od	\
755	$(CLOSED)/cmd/patch	\
756	$(CLOSED)/cmd/pax	\
757	$(CLOSED)/cmd/printf	\
758	$(CLOSED)/cmd/sed	\
759	$(CLOSED)/cmd/sed_xpg4	\
760	$(CLOSED)/cmd/tail	\
761	$(CLOSED)/cmd/tr_xpg4
762
763sparc_MSGSUBDIRS=	\
764	fruadm		\
765	prtdscp		\
766	prtfru		\
767	vntsd
768
769i386_MSGSUBDIRS=	\
770	ucodeadm
771
772#
773# commands that use dcgettext for localized time, LC_TIME
774#
775DCSUBDIRS=		\
776	cal		\
777	cfgadm		\
778	diff		\
779	ls		\
780	pr		\
781	ps		\
782	tar		\
783	w		\
784	who		\
785	whodo		\
786	write
787
788$(CLOSED_BUILD)DCSUBDIRS += \
789	$(CLOSED)/cmd/pax
790
791#
792# commands that belong only to the basic security module
793#
794BSMSUBDIRS=		\
795	allocate	\
796	amt		\
797	audit		\
798	audit_warn	\
799	auditconfig	\
800	auditd		\
801	auditreduce	\
802	auditstat	\
803	praudit		\
804	bsmconv		\
805	bsmrecord	\
806	bsmunconv
807
808#
809# commands not owned by the systems group
810#
811BWOSDIRS=
812
813
814all :=		TARGET = all
815install :=	TARGET = install
816clean :=	TARGET = clean
817clobber :=	TARGET = clobber
818lint :=		TARGET = lint
819_msg :=		TARGET = _msg
820_dc :=		TARGET = _dc
821
822.KEEP_STATE:
823
824SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
825
826.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(BSMSUBDIRS)
827
828all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) $(BSMSUBDIRS)
829
830#
831# Manifests cannot be checked in parallel, because we are using
832# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
833# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
834# we spawn off a sub-make to perform the non-parallel 'make check'
835#
836check:
837	$(MAKE) -f Makefile.check check
838
839#
840# The .WAIT directive works around an apparent bug in parallel make.
841# Evidently make was getting the target _msg vs. _dc confused under
842# some level of parallelization, causing some of the _dc objects
843# not to be built.
844#
845_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
846
847_dc: $(DCSUBDIRS)
848
849#
850# Dependencies
851#
852fs.d: fstyp
853ksh:	shcomp isaexec
854
855$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(BSMSUBDIRS): FRC
856	@if [ -f $@/Makefile  ]; then \
857		cd $@; pwd; $(MAKE) $(TARGET); \
858	else \
859		true; \
860	fi
861
862FRC:
863