xref: /illumos-gate/usr/src/cmd/Makefile (revision a38ddfee9c8c6b6c5a2947ff52fd2338362a4444)
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	fm		\
165	fmli		\
166	fmt		\
167	fmthard		\
168	fmtmsg		\
169	fold		\
170	format		\
171	fs.d		\
172	fstyp		\
173	fuser		\
174	fwflash		\
175	gcore		\
176	gencat		\
177	geniconvtbl	\
178	genmsg		\
179	getconf		\
180	getdevpolicy	\
181	getent		\
182	getfacl		\
183	getmajor	\
184	getopt		\
185	gettext		\
186	gettxt		\
187	graph		\
188	grep		\
189	grep_xpg4	\
190	groups		\
191	grpck		\
192	gss		\
193	hal		\
194	halt		\
195	head		\
196	hostid		\
197	hostname	\
198	hwdata		\
199	id		\
200	idmap		\
201	infocmp		\
202	init		\
203	initpkg		\
204	install.d	\
205	intrd		\
206	intrstat	\
207	ipcrm		\
208	ipcs		\
209	ipf		\
210	isainfo		\
211	isalist		\
212	iscsi		\
213	itutools	\
214	iscsiadm	\
215	iscsid		\
216	iscsitsvc	\
217	isns		\
218	itadm		\
219	java		\
220	join		\
221	kbd		\
222	keyserv		\
223	killall		\
224	krb5		\
225	ksh		\
226	kstat		\
227	last		\
228	lastcomm	\
229	ldap		\
230	ldapcachemgr	\
231	lgrpinfo	\
232	line		\
233	link		\
234	dlmgmtd		\
235	listen		\
236	loadkeys	\
237	locale		\
238	lockstat	\
239	locator		\
240	lofiadm		\
241	logadm		\
242	logger		\
243	login		\
244	logins		\
245	logname		\
246	look		\
247	ls		\
248	luxadm		\
249	lvm		\
250	mach		\
251	machid		\
252	mail		\
253	mailx		\
254	makekey		\
255	mdb		\
256	mesg		\
257	mkdir		\
258	mkfifo		\
259	mkfile		\
260	mkmsgs		\
261	mknod		\
262	mkpwdict	\
263	mktemp		\
264	mms		\
265	modload		\
266	more		\
267	mpathadm	\
268	msgfmt		\
269	msgid		\
270	mt		\
271	mv		\
272	mvdir		\
273	ndmpadm		\
274	ndmpd		\
275	ndmpstat	\
276	netadm		\
277	netfiles	\
278	newform		\
279	newgrp		\
280	news		\
281	newtask		\
282	nice		\
283	nispasswd	\
284	nl		\
285	nlsadmin	\
286	nohup		\
287	nsadmin		\
288	nscd		\
289	oamuser		\
290	oawk		\
291	openssl		\
292	pack		\
293	pagesize	\
294	passmgmt	\
295	passwd		\
296	paste		\
297	pathchk		\
298	pbind		\
299	pcidr		\
300	pcmciad		\
301	pfexec		\
302	pgrep		\
303	picl		\
304	plimit		\
305	policykit	\
306	pools		\
307	power		\
308	powertop	\
309	ppgsz		\
310	pg		\
311	plockstat	\
312	pr		\
313	prctl		\
314	print		\
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	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	sleep		\
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	sum		\
389	sunpc		\
390	svc		\
391	swap		\
392	sync		\
393	sysdef		\
394	syseventadm	\
395	syslogd		\
396	tabs		\
397	tar		\
398	tbl		\
399	tcopy		\
400	tcpd		\
401	tee		\
402	terminfo	\
403	th_tools	\
404	tic		\
405	time		\
406	tip		\
407	tnf		\
408	touch		\
409	tplot		\
410	tput		\
411	trapstat	\
412	troff		\
413	true		\
414	truss		\
415	tsol		\
416	tty		\
417	ttymon		\
418	uadmin		\
419	ul		\
420	uname		\
421	uniq		\
422	units		\
423	unlink		\
424	unpack		\
425	users		\
426	utmp_update	\
427	utmpd		\
428	valtools	\
429	vgrind		\
430	vi		\
431	vna		\
432	volcheck	\
433	volrmmount	\
434	vscan		\
435	vt		\
436	w		\
437	wall		\
438	wbem		\
439	wc		\
440	which		\
441	who		\
442	whodo		\
443	wracct		\
444	write		\
445	xntpd		\
446	xargs		\
447	xstr		\
448	yes		\
449	ypcmd		\
450	yppasswd	\
451	zdb		\
452	zdump		\
453	zfs		\
454	zic		\
455	zinject		\
456	zlogin		\
457	zoneadm		\
458	zoneadmd	\
459	zonecfg		\
460	zonename	\
461	zpool		\
462	ztest
463
464$(CLOSED_BUILD)COMMON_SUBDIRS += \
465	$(CLOSED)/cmd/dodatadm	\
466	$(CLOSED)/cmd/iconv	\
467	$(CLOSED)/cmd/ksh	\
468	$(CLOSED)/cmd/llc2	\
469	$(CLOSED)/cmd/localedef	\
470	$(CLOSED)/cmd/more_xpg4	\
471	$(CLOSED)/cmd/mtst	\
472	$(CLOSED)/cmd/od	\
473	$(CLOSED)/cmd/patch	\
474	$(CLOSED)/cmd/pax	\
475	$(CLOSED)/cmd/pcitool	\
476	$(CLOSED)/cmd/printf	\
477	$(CLOSED)/cmd/sed	\
478	$(CLOSED)/cmd/sed_xpg4	\
479	$(CLOSED)/cmd/smartcard	\
480	$(CLOSED)/cmd/tail	\
481	$(CLOSED)/cmd/tr_xpg4
482
483i386_SUBDIRS=		\
484	addbadsec	\
485	biosdev		\
486	diskscan	\
487	OWconfig	\
488	rtc		\
489	ucodeadm	\
490	xvm
491
492sparc_SUBDIRS=		\
493	cvcd		\
494	dcs		\
495	drd		\
496	fps		\
497	fruadm		\
498	oplhpd		\
499	prtdscp		\
500	prtfru		\
501	scadm		\
502	sckmd		\
503	sf880drd	\
504	vntsd
505
506#
507# Commands that are messaged.  Note that 'lp' and 'man' come first
508# (see previous comment about 'lp' and 'man').
509#
510MSGSUBDIRS=		\
511	lp		\
512	man		\
513	abi		\
514	acctadm		\
515	allocate	\
516	asa		\
517	audio		\
518	audit		\
519	auditd		\
520	auths		\
521	autopush	\
522	avs		\
523	awk		\
524	awk_xpg4	\
525	backup		\
526	banner		\
527	bart		\
528	basename	\
529	bnu		\
530	bsmconv		\
531	bsmrecord	\
532	bsmunconv	\
533	busstat		\
534	cal		\
535	cat		\
536	cdrw		\
537	cfgadm		\
538	checkeq		\
539	checknr		\
540	chgrp		\
541	chmod		\
542	chown		\
543	cksum		\
544	cmd-crypto	\
545	cmd-inet	\
546	cmp		\
547	col		\
548	comm		\
549	compress	\
550	consadm		\
551	coreadm		\
552	cpio		\
553	cpc		\
554	cron		\
555	csh		\
556	csplit		\
557	ctrun		\
558	ctstat		\
559	ctwatch		\
560	cut		\
561	datadm		\
562	date		\
563	dc		\
564	dcs		\
565	dd		\
566	deroff		\
567	devfsadm	\
568	dfs.cmds	\
569	diff		\
570	diffmk		\
571	dladm		\
572	du		\
573	dumpcs		\
574	ed		\
575	eject		\
576	env		\
577	eqn		\
578	expand		\
579	expr		\
580	fcinfo		\
581	fgrep		\
582	file		\
583	filesync	\
584	find		\
585	fm		\
586	fold		\
587	fs.d		\
588	fwflash		\
589	geniconvtbl	\
590	genmsg		\
591	getconf		\
592	getent		\
593	gettext		\
594	gettxt		\
595	grep		\
596	grep_xpg4	\
597	grpck		\
598	gss		\
599	halt		\
600	head		\
601	hostname	\
602	id		\
603	idmap		\
604	isaexec		\
605	iscsi		\
606	iscsiadm	\
607	iscsid		\
608	isns		\
609	itadm		\
610	join		\
611	kbd		\
612	krb5		\
613	ksh		\
614	kstat		\
615	last		\
616	ldap		\
617	ldapcachemgr	\
618	lgrpinfo	\
619	locale		\
620	lofiadm		\
621	logadm		\
622	logger		\
623	logins		\
624	logname		\
625	ls		\
626	luxadm		\
627	lvm		\
628	mailx		\
629	mesg		\
630	mkdir		\
631	mkpwdict	\
632	mktemp		\
633	more		\
634	mpathadm	\
635	msgfmt		\
636	mv		\
637	ndmpadm		\
638	ndmpstat	\
639	newgrp		\
640	newtask		\
641	nice		\
642	nispasswd	\
643	nohup		\
644	oawk		\
645	pack		\
646	passwd		\
647	passmgmt	\
648	paste		\
649	pathchk		\
650	pfexec		\
651	pg		\
652	pgrep		\
653	picl            \
654	pools		\
655	power		\
656	pr		\
657	praudit		\
658	print		\
659	profiles	\
660	projadd		\
661	projects	\
662	prstat		\
663	prtdiag		\
664	ps		\
665	psrinfo		\
666	ptools		\
667	pwconv		\
668	pwd		\
669	raidctl		\
670	ramdiskadm	\
671	rcap		\
672	rcm_daemon	\
673	refer		\
674	regcmp		\
675	renice		\
676	roles		\
677	rm		\
678	rmdir		\
679	rmformat	\
680	rmmount		\
681	rmvolmgr	\
682	sbdadm		\
683	scadm		\
684	script		\
685	scsi		\
686	sdiff		\
687	sdpadm		\
688	sgs		\
689	sh		\
690	sleep		\
691	sort		\
692	split		\
693	ssh		\
694	stat		\
695	stmfadm		\
696	stmsboot	\
697	strings		\
698	su		\
699	sum		\
700	svc		\
701	swap		\
702	syseventadm	\
703	syseventd	\
704	tabs		\
705	tar		\
706	tbl		\
707	tee		\
708	time		\
709	tnf		\
710	touch		\
711	tput		\
712	troff		\
713	tsol		\
714	tty		\
715	ttymon		\
716	ul		\
717	uname		\
718	uniq		\
719	units		\
720	unlink		\
721	unpack		\
722	valtools	\
723	vgrind		\
724	vi		\
725	volcheck	\
726	volrmmount	\
727	w		\
728	wbem		\
729	wc		\
730	who		\
731	whodo		\
732	wracct		\
733	write		\
734	xargs		\
735	yppasswd	\
736	zdump		\
737	zfs		\
738	zic		\
739	zlogin		\
740	zoneadm		\
741	zoneadmd	\
742	zonecfg		\
743	zonename	\
744	zpool
745
746$(CLOSED_BUILD)MSGSUBDIRS += \
747	$(CLOSED)/cmd/iconv	\
748	$(CLOSED)/cmd/ksh	\
749	$(CLOSED)/cmd/llc2	\
750	$(CLOSED)/cmd/localedef	\
751	$(CLOSED)/cmd/more_xpg4	\
752	$(CLOSED)/cmd/od	\
753	$(CLOSED)/cmd/patch	\
754	$(CLOSED)/cmd/pax	\
755	$(CLOSED)/cmd/printf	\
756	$(CLOSED)/cmd/sed	\
757	$(CLOSED)/cmd/sed_xpg4	\
758	$(CLOSED)/cmd/tail	\
759	$(CLOSED)/cmd/tr_xpg4
760
761sparc_MSGSUBDIRS=	\
762	fruadm		\
763	prtdscp		\
764	prtfru		\
765	vntsd
766
767i386_MSGSUBDIRS=	\
768	ucodeadm
769
770#
771# commands that use dcgettext for localized time, LC_TIME
772#
773DCSUBDIRS=		\
774	cal		\
775	cfgadm		\
776	diff		\
777	ls		\
778	pr		\
779	ps		\
780	tar		\
781	w		\
782	who		\
783	whodo		\
784	write
785
786$(CLOSED_BUILD)DCSUBDIRS += \
787	$(CLOSED)/cmd/pax
788
789#
790# commands that belong only to the basic security module
791#
792BSMSUBDIRS=		\
793	allocate	\
794	amt		\
795	audit		\
796	audit_warn	\
797	auditconfig	\
798	auditd		\
799	auditreduce	\
800	auditstat	\
801	praudit		\
802	bsmconv		\
803	bsmrecord	\
804	bsmunconv
805
806#
807# commands not owned by the systems group
808#
809BWOSDIRS=
810
811#
812# Commands providing manifests must offer a check target.  A recursive check
813# target across all commands directories is not currently provided.
814#
815MANIFEST_TOPDIRS=			\
816	auditd				\
817	bnu				\
818	consadm				\
819	coreadm				\
820	cron				\
821	cvcd				\
822	dispadmin			\
823	drd				\
824	dumpadm				\
825	eeprom				\
826	fm				\
827	intrd				\
828	ipf				\
829	keyserv				\
830	ldapcachemgr			\
831	dlmgmtd				\
832	nscd				\
833	oplhpd				\
834	power				\
835	rexd				\
836	rpcbind				\
837	rpcsvc				\
838	saf				\
839	sf880drd			\
840	smserverd			\
841	syseventd			\
842	syslogd				\
843	utmpd				\
844	vntsd				\
845	ypcmd				\
846	zoneadmd
847
848MANIFEST_SUBDIRS=			\
849	boot/scripts			\
850	cmd-crypto/scripts		\
851	cmd-inet/usr.lib/in.chargend	\
852	cmd-inet/usr.lib/in.daytimed	\
853	cmd-inet/usr.lib/in.dhcpd	\
854	cmd-inet/usr.lib/in.discardd	\
855	cmd-inet/usr.lib/in.echod	\
856	cmd-inet/usr.lib/in.ndpd	\
857	cmd-inet/usr.lib/in.ripngd	\
858	cmd-inet/usr.lib/in.timed	\
859	cmd-inet/usr.lib/inetd		\
860	cmd-inet/usr.lib/mdnsd		\
861	cmd-inet/usr.lib/slpd		\
862	cmd-inet/usr.lib/wpad		\
863	cmd-inet/usr.sbin		\
864	cmd-inet/usr.sbin/in.ftpd	\
865	cmd-inet/usr.sbin/in.rdisc	\
866	cmd-inet/usr.sbin/in.routed	\
867	cmd-inet/usr.sbin/in.talkd	\
868	cmd-inet/usr.sbin/routeadm	\
869	cmd/tsol/labeld			\
870	cmd/tsol/tnctl			\
871	cmd/tsol/tnd			\
872	cmd/tsol/tsol-zones		\
873	dcs/sparc/sun4u			\
874	fs.d/autofs			\
875	fs.d/cachefs			\
876	fs.d/nfs/svc			\
877	gss/gssd			\
878	idmap/idmapd			\
879	krb5/kadmin/server		\
880	krb5/krb5kdc			\
881	krb5/kwarn			\
882	krb5/slave			\
883	lp/cmd/lpsched			\
884	lvm/rpc.metad			\
885	lvm/rpc.metamedd		\
886	lvm/rpc.metamhd			\
887	lvm/md_monitord			\
888	lvm/metassist/sysfiles		\
889	lvm/util			\
890	picl/picld			\
891	print/gateway			\
892	print/lp			\
893	rcap/rcapd			\
894	rpcsvc/rpc.bootparamd		\
895	sendmail/lib			\
896	smartcard/daemon		\
897	ssh/etc				\
898	svc/milestone			\
899	ypcmd/yppasswd			\
900	ypcmd/ypupdated			\
901	xntpd/xntpd
902
903DTEST_SUBDIRS= \
904	dtrace/test/tst
905
906all :=		TARGET = all
907install :=	TARGET = install
908clean :=	TARGET = clean
909clobber :=	TARGET = clobber
910lint :=		TARGET = lint
911check :=	TARGET = check
912_msg :=		TARGET = _msg
913_dc :=		TARGET = _dc
914
915.KEEP_STATE:
916
917SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
918
919.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(BSMSUBDIRS) \
920		$(DTEST_SUBDIRS)
921
922all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) $(BSMSUBDIRS)
923
924# Manifests cannot be checked in parallel, because we are using the global
925# repository that is in $(SRC)/cmd/svc/seed/global.db.  This is a
926# repository that is built from the manifests in this workspace, whereas
927# the build machine's repository may be out of sync with these manifests.
928# Because we are using a private repository, svccfg-native must start up a
929# private copy of configd-native.  We cannot have multiple copies of
930# configd-native trying to access global.db simultaneously.
931
932.NO_PARALLEL:	$(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS)
933
934check: svccfg_check .WAIT $(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS) \
935	$(DTEST_SUBDIRS)
936
937svccfg_check:
938	@$(ECHO) "building requirements for svccfg check ..."; \
939	(cd $(SRC)/cmd/svc/seed && pwd && $(MAKE) $(MFLAGS) global.db)
940
941$(DTEST_SUBDIRS): FRC
942	@cd $@; pwd; $(MAKE) $(TARGET)
943
944#
945# The .WAIT directive works around an apparent bug in parallel make.
946# Evidently make was getting the target _msg vs. _dc confused under
947# some level of parallelization, causing some of the _dc objects
948# not to be built.
949#
950_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
951
952_dc: $(DCSUBDIRS)
953
954#
955# Dependencies
956#
957fs.d: fstyp
958
959$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(BSMSUBDIRS) $(MANIFEST_SUBDIRS): FRC
960	@if [ -f $@/Makefile  ]; then \
961		cd $@; pwd; $(MAKE) $(TARGET); \
962	else \
963		true; \
964	fi
965
966FRC:
967