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