xref: /illumos-gate/usr/src/cmd/Makefile (revision b424305435881ac456a9343be2898f1f86440f31)
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#
23#
24# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
25# Use is subject to license terms.
26#
27
28include ../Makefile.master
29include ../Makefile.ksh93switch
30
31#
32#	Note that the commands 'agents', 'lp', 'perl', and 'man' are first in
33#	the list, violating alphabetical order.  This is because they are very
34#	long-running and should be given the most wall-clock time for a
35#	parallel build.
36#
37#	Commands in the FIRST_SUBDIRS list are built before starting the build
38#	of other commands.  Currently this includes only 'isaexec' and
39#	'platexec'.  This is necessary because $(ROOT)/usr/lib/isaexec or
40#	$(ROOT)/usr/lib/platexec must exist when some other commands are built
41#	because their 'make install' creates a hard link to one of them.
42#
43#	Commands are listed one per line so that TeamWare can auto-merge most
44#	changes.
45#
46
47FIRST_SUBDIRS=		\
48	isaexec		\
49	platexec
50
51COMMON_SUBDIRS=		\
52	agents		\
53	availdevs	\
54	lp		\
55	perl		\
56	man		\
57	Adm		\
58	abi		\
59	adbgen		\
60	acct		\
61	acctadm		\
62	arch		\
63	asa		\
64	ast		\
65	audio		\
66	auths		\
67	autopush	\
68	avs		\
69	awk		\
70	awk_xpg4	\
71	backup		\
72	banner		\
73	bart		\
74	basename	\
75	bc		\
76	bdiff		\
77	bfs		\
78	bnu		\
79	boot		\
80	busstat		\
81	cal		\
82	calendar	\
83	captoinfo	\
84	cat		\
85	cdrw		\
86	cfgadm		\
87	checkeq		\
88	checknr		\
89	chgrp		\
90	chmod		\
91	chown		\
92	chroot		\
93	cksum		\
94	clear		\
95	clinfo		\
96	cmd-crypto	\
97	cmd-inet	\
98	cmp		\
99	col		\
100	comm		\
101	compress	\
102	consadm		\
103	coreadm		\
104	cpio		\
105	cpc		\
106	cron		\
107	crypt		\
108	csh		\
109	csplit		\
110	ctrun		\
111	ctstat		\
112	ctwatch		\
113	cut		\
114	datadm		\
115	date		\
116	dc		\
117	dd		\
118	deroff		\
119	des		\
120	devfsadm	\
121	syseventd	\
122	devctl		\
123	devinfo		\
124	devmgmt		\
125	devprop		\
126	dfs.cmds	\
127	diff		\
128	diff3		\
129	diffmk		\
130	dircmp		\
131	dirname		\
132	dis		\
133	diskmgtd	\
134	dispadmin	\
135	dladm		\
136	dmesg		\
137	dtrace		\
138	du		\
139	dumpadm		\
140	dumpcs		\
141	echo		\
142	ed		\
143	eeprom		\
144	egrep		\
145	eject		\
146	emul64ioctl	\
147	enhance		\
148	env		\
149	eqn		\
150	expand		\
151	expr		\
152	exstr		\
153	factor		\
154	false		\
155	fcinfo		\
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	openssl		\
293	pack		\
294	pagesize	\
295	passmgmt	\
296	passwd		\
297	paste		\
298	pathchk		\
299	pbind		\
300	pcidr		\
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	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	rpld		\
353	runat		\
354	sa		\
355	saf		\
356	savecore	\
357	sbdadm		\
358	script		\
359	scsi		\
360	sdiff		\
361	sdpadm		\
362	sendmail	\
363	setfacl		\
364	setmnt		\
365	setpgrp		\
366	setuname	\
367	sgs		\
368	sh		\
369	sleep		\
370	smbios		\
371	smbsrv		\
372	smserverd	\
373	soelim		\
374	sort		\
375	spell		\
376	spline		\
377	split		\
378	sqlite		\
379	srchtxt		\
380	ssh		\
381	stat		\
382	stmfadm		\
383	stmfsvc		\
384	stmsboot	\
385	streams		\
386	strings		\
387	su		\
388	sulogin		\
389	sum		\
390	sunpc		\
391	svc		\
392	swap		\
393	sync		\
394	sysdef		\
395	syseventadm	\
396	syslogd		\
397	tabs		\
398	tar		\
399	tbl		\
400	tcopy		\
401	tcpd		\
402	tee		\
403	terminfo	\
404	th_tools	\
405	tic		\
406	time		\
407	tip		\
408	tnf		\
409	touch		\
410	tplot		\
411	tput		\
412	trapstat	\
413	troff		\
414	true		\
415	truss		\
416	tsol		\
417	tty		\
418	ttymon		\
419	uadmin		\
420	ul		\
421	uname		\
422	uniq		\
423	units		\
424	unlink		\
425	unpack		\
426	users		\
427	utmp_update	\
428	utmpd		\
429	valtools	\
430	vgrind		\
431	vi		\
432	vna		\
433	volcheck	\
434	volrmmount	\
435	vscan		\
436	vt		\
437	w		\
438	wall		\
439	wbem		\
440	wc		\
441	which		\
442	who		\
443	whodo		\
444	wracct		\
445	write		\
446	xntpd		\
447	xargs		\
448	xstr		\
449	yes		\
450	ypcmd		\
451	yppasswd	\
452	zdb		\
453	zdump		\
454	zfs		\
455	zic		\
456	zinject		\
457	zlogin		\
458	zoneadm		\
459	zoneadmd	\
460	zonecfg		\
461	zonename	\
462	zpool		\
463	ztest
464
465$(CLOSED_BUILD)COMMON_SUBDIRS += \
466	$(CLOSED)/cmd/dodatadm	\
467	$(CLOSED)/cmd/iconv	\
468	$(CLOSED)/cmd/ksh	\
469	$(CLOSED)/cmd/llc2	\
470	$(CLOSED)/cmd/localedef	\
471	$(CLOSED)/cmd/more_xpg4	\
472	$(CLOSED)/cmd/mtst	\
473	$(CLOSED)/cmd/od	\
474	$(CLOSED)/cmd/patch	\
475	$(CLOSED)/cmd/pax	\
476	$(CLOSED)/cmd/pcitool	\
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	OWconfig	\
489	rtc		\
490	ucodeadm	\
491	xvm
492
493sparc_SUBDIRS=		\
494	cvcd		\
495	dcs		\
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	raidctl		\
672	ramdiskadm	\
673	rcap		\
674	rcm_daemon	\
675	refer		\
676	regcmp		\
677	renice		\
678	roles		\
679	rm		\
680	rmdir		\
681	rmformat	\
682	rmmount		\
683	rmvolmgr	\
684	sbdadm		\
685	scadm		\
686	script		\
687	scsi		\
688	sdiff		\
689	sdpadm		\
690	sgs		\
691	sh		\
692	sleep		\
693	sort		\
694	split		\
695	ssh		\
696	stat		\
697	stmfadm		\
698	stmsboot	\
699	strings		\
700	su		\
701	sum		\
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#
814# Commands providing manifests must offer a check target.  A recursive check
815# target across all commands directories is not currently provided.
816#
817MANIFEST_TOPDIRS=			\
818	auditd				\
819	bnu				\
820	consadm				\
821	coreadm				\
822	cron				\
823	cvcd				\
824	dispadmin			\
825	drd				\
826	dumpadm				\
827	eeprom				\
828	fm				\
829	intrd				\
830	ipf				\
831	keyserv				\
832	ldapcachemgr			\
833	dlmgmtd				\
834	nscd				\
835	oplhpd				\
836	power				\
837	rexd				\
838	rpcbind				\
839	rpcsvc				\
840	saf				\
841	sf880drd			\
842	smserverd			\
843	syseventd			\
844	syslogd				\
845	utmpd				\
846	vntsd				\
847	ypcmd				\
848	zoneadmd
849
850MANIFEST_SUBDIRS=			\
851	boot/scripts			\
852	cmd-crypto/scripts		\
853	cmd-inet/usr.lib/in.chargend	\
854	cmd-inet/usr.lib/in.daytimed	\
855	cmd-inet/usr.lib/in.dhcpd	\
856	cmd-inet/usr.lib/in.discardd	\
857	cmd-inet/usr.lib/in.echod	\
858	cmd-inet/usr.lib/in.ndpd	\
859	cmd-inet/usr.lib/in.ripngd	\
860	cmd-inet/usr.lib/in.timed	\
861	cmd-inet/usr.lib/inetd		\
862	cmd-inet/usr.lib/mdnsd		\
863	cmd-inet/usr.lib/slpd		\
864	cmd-inet/usr.lib/wpad		\
865	cmd-inet/usr.sbin		\
866	cmd-inet/usr.sbin/in.ftpd	\
867	cmd-inet/usr.sbin/in.rdisc	\
868	cmd-inet/usr.sbin/in.routed	\
869	cmd-inet/usr.sbin/in.talkd	\
870	cmd-inet/usr.sbin/routeadm	\
871	cmd/tsol/labeld			\
872	cmd/tsol/tnctl			\
873	cmd/tsol/tnd			\
874	cmd/tsol/tsol-zones		\
875	dcs/sparc/sun4u			\
876	fs.d/autofs			\
877	fs.d/cachefs			\
878	fs.d/nfs/svc			\
879	gss/gssd			\
880	idmap/idmapd			\
881	krb5/kadmin/server		\
882	krb5/krb5kdc			\
883	krb5/kwarn			\
884	krb5/slave			\
885	lp/cmd/lpsched			\
886	lvm/rpc.metad			\
887	lvm/rpc.metamedd		\
888	lvm/rpc.metamhd			\
889	lvm/md_monitord			\
890	lvm/metassist/sysfiles		\
891	lvm/util			\
892	picl/picld			\
893	print/gateway			\
894	print/lp			\
895	rcap/rcapd			\
896	rpcsvc/rpc.bootparamd		\
897	sendmail/lib			\
898	smartcard/daemon		\
899	ssh/etc				\
900	svc/milestone			\
901	ypcmd/yppasswd			\
902	ypcmd/ypupdated			\
903	xntpd/xntpd
904
905DTEST_SUBDIRS= \
906	dtrace/test/tst
907
908all :=		TARGET = all
909install :=	TARGET = install
910clean :=	TARGET = clean
911clobber :=	TARGET = clobber
912lint :=		TARGET = lint
913check :=	TARGET = check
914_msg :=		TARGET = _msg
915_dc :=		TARGET = _dc
916
917.KEEP_STATE:
918
919SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
920
921.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(BSMSUBDIRS) \
922		$(DTEST_SUBDIRS)
923
924all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) $(BSMSUBDIRS)
925
926# Manifests cannot be checked in parallel, because we are using the global
927# repository that is in $(SRC)/cmd/svc/seed/global.db.  This is a
928# repository that is built from the manifests in this workspace, whereas
929# the build machine's repository may be out of sync with these manifests.
930# Because we are using a private repository, svccfg-native must start up a
931# private copy of configd-native.  We cannot have multiple copies of
932# configd-native trying to access global.db simultaneously.
933
934.NO_PARALLEL:	$(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS)
935
936check: svccfg_check .WAIT $(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS) \
937	$(DTEST_SUBDIRS)
938
939svccfg_check:
940	@$(ECHO) "building requirements for svccfg check ..."; \
941	(cd $(SRC)/cmd/svc/seed && pwd && $(MAKE) $(MFLAGS) global.db)
942
943$(DTEST_SUBDIRS): FRC
944	@cd $@; pwd; $(MAKE) $(TARGET)
945
946#
947# The .WAIT directive works around an apparent bug in parallel make.
948# Evidently make was getting the target _msg vs. _dc confused under
949# some level of parallelization, causing some of the _dc objects
950# not to be built.
951#
952_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
953
954_dc: $(DCSUBDIRS)
955
956#
957# Dependencies
958#
959fs.d: fstyp
960
961$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(BSMSUBDIRS) $(MANIFEST_SUBDIRS): FRC
962	@if [ -f $@/Makefile  ]; then \
963		cd $@; pwd; $(MAKE) $(TARGET); \
964	else \
965		true; \
966	fi
967
968FRC:
969