xref: /illumos-gate/usr/src/cmd/Makefile (revision 8e50dcc9f00b393d43e6aa42b820bcbf1d3e1ce4)
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	scsi		\
343	sdiff		\
344	sdpadm		\
345	sendmail	\
346	setfacl		\
347	setmnt		\
348	setpgrp		\
349	setuname	\
350	sgs		\
351	sh		\
352	sleep		\
353	smbios		\
354	smbsrv		\
355	smserverd	\
356	soelim		\
357	sort		\
358	spell		\
359	spline		\
360	split		\
361	sqlite		\
362	srchtxt		\
363	ssh		\
364	stat		\
365	stmsboot	\
366	streams		\
367	strings		\
368	su		\
369	sulogin		\
370	sum		\
371	sunpc		\
372	svc		\
373	swap		\
374	sync		\
375	sysdef		\
376	syseventadm	\
377	syslogd		\
378	tabs		\
379	tar		\
380	tbl		\
381	tcopy		\
382	tcpd		\
383	tee		\
384	terminfo	\
385	th_tools	\
386	tic		\
387	time		\
388	tip		\
389	tnf		\
390	touch		\
391	tplot		\
392	tput		\
393	trapstat	\
394	troff		\
395	true		\
396	truss		\
397	tsol		\
398	tty		\
399	ttymon		\
400	uadmin		\
401	ul		\
402	uname		\
403	uniq		\
404	units		\
405	unlink		\
406	unpack		\
407	users		\
408	utmp_update	\
409	utmpd		\
410	valtools	\
411	vgrind		\
412	vi		\
413	vna		\
414	volcheck	\
415	volrmmount	\
416	vscan		\
417	w		\
418	wall		\
419	wbem		\
420	wc		\
421	which		\
422	who		\
423	whodo		\
424	wracct		\
425	write		\
426	xntpd		\
427	xargs		\
428	xstr		\
429	yes		\
430	ypcmd		\
431	yppasswd	\
432	zdb		\
433	zdump		\
434	zfs		\
435	zic		\
436	zinject		\
437	zlogin		\
438	zoneadm		\
439	zoneadmd	\
440	zonecfg		\
441	zonename	\
442	zpool		\
443	ztest
444
445$(CLOSED_BUILD)COMMON_SUBDIRS += \
446	$(CLOSED)/cmd/dodatadm	\
447	$(CLOSED)/cmd/fwflash	\
448	$(CLOSED)/cmd/iconv	\
449	$(CLOSED)/cmd/ksh	\
450	$(CLOSED)/cmd/llc2	\
451	$(CLOSED)/cmd/localedef	\
452	$(CLOSED)/cmd/more_xpg4	\
453	$(CLOSED)/cmd/mtst	\
454	$(CLOSED)/cmd/ndmpadm	\
455	$(CLOSED)/cmd/ndmpd	\
456	$(CLOSED)/cmd/ndmpstat	\
457	$(CLOSED)/cmd/od	\
458	$(CLOSED)/cmd/patch	\
459	$(CLOSED)/cmd/pax	\
460	$(CLOSED)/cmd/pcitool	\
461	$(CLOSED)/cmd/printf	\
462	$(CLOSED)/cmd/sed	\
463	$(CLOSED)/cmd/sed_xpg4	\
464	$(CLOSED)/cmd/smartcard	\
465	$(CLOSED)/cmd/tail	\
466	$(CLOSED)/cmd/tr	\
467	$(CLOSED)/cmd/tr_xpg4
468
469i386_SUBDIRS=		\
470	addbadsec	\
471	biosdev		\
472	diskscan	\
473	OWconfig	\
474	rtc		\
475	ucodeadm
476
477sparc_SUBDIRS=		\
478	cvcd		\
479	dcs		\
480	drd		\
481	fps		\
482	fruadm		\
483	oplhpd		\
484	prtdscp		\
485	prtfru		\
486	scadm		\
487	sckmd		\
488	sf880drd	\
489	vntsd
490
491#
492# Commands that are messaged.  Note that 'lp' and 'man' come first
493# (see previous comment about 'lp' and 'man').
494#
495MSGSUBDIRS=		\
496	lp		\
497	man		\
498	abi		\
499	acctadm		\
500	allocate	\
501	asa		\
502	audio		\
503	audit		\
504	auditd		\
505	auths		\
506	autopush	\
507	awk		\
508	awk_xpg4	\
509	backup		\
510	banner		\
511	bart		\
512	basename	\
513	bnu		\
514	bsmconv		\
515	bsmrecord	\
516	bsmunconv	\
517	busstat		\
518	cal		\
519	cat		\
520	cdrw		\
521	cfgadm		\
522	checkeq		\
523	checknr		\
524	chgrp		\
525	chmod		\
526	chown		\
527	cksum		\
528	cmd-crypto	\
529	cmd-inet	\
530	cmp		\
531	col		\
532	comm		\
533	compress	\
534	consadm		\
535	coreadm		\
536	cpio		\
537	cpc		\
538	cron		\
539	csh		\
540	csplit		\
541	ctrun		\
542	ctstat		\
543	ctwatch		\
544	cut		\
545	datadm		\
546	date		\
547	dc		\
548	dcs		\
549	dd		\
550	deroff		\
551	devfsadm	\
552	dfs.cmds	\
553	diff		\
554	diffmk		\
555	dladm		\
556	du		\
557	dumpcs		\
558	ed		\
559	eject		\
560	env		\
561	eqn		\
562	expand		\
563	expr		\
564	fgrep		\
565	file		\
566	filesync	\
567	find		\
568	fm		\
569	fold		\
570	fs.d		\
571	geniconvtbl	\
572	genmsg		\
573	getconf		\
574	getent		\
575	gettext		\
576	gettxt		\
577	grep		\
578	grep_xpg4	\
579	grpck		\
580	gss		\
581	halt		\
582	head		\
583	hostname	\
584	id		\
585	idmap		\
586	isaexec		\
587	iscsi		\
588	join		\
589	kbd		\
590	krb5		\
591	ksh		\
592	kstat		\
593	last		\
594	ldap		\
595	ldapcachemgr	\
596	lgrpinfo	\
597	locale		\
598	lofiadm		\
599	logadm		\
600	logger		\
601	logins		\
602	logname		\
603	ls		\
604	lvm		\
605	mailx		\
606	mesg		\
607	mkdir		\
608	mkpwdict	\
609	mktemp		\
610	more		\
611	msgfmt		\
612	mv		\
613	newgrp		\
614	newtask		\
615	nice		\
616	nispasswd	\
617	nohup		\
618	oawk		\
619	pack		\
620	passwd		\
621	passmgmt	\
622	paste		\
623	pathchk		\
624	pfexec		\
625	pg		\
626	pgrep		\
627	picl            \
628	pools		\
629	power		\
630	pr		\
631	praudit		\
632	print		\
633	profiles	\
634	projadd		\
635	projects	\
636	prstat		\
637	prtdiag		\
638	ps		\
639	psrinfo		\
640	ptools		\
641	pwconv		\
642	pwd		\
643	raidctl		\
644	ramdiskadm	\
645	rcap		\
646	rcm_daemon	\
647	refer		\
648	regcmp		\
649	renice		\
650	roles		\
651	rm		\
652	rmdir		\
653	rmformat	\
654	rmmount		\
655	rmvolmgr	\
656	scadm		\
657	script		\
658	scsi		\
659	sdiff		\
660	sdpadm		\
661	sgs		\
662	sh		\
663	sleep		\
664	sort		\
665	split		\
666	ssh		\
667	stat		\
668	stmsboot	\
669	strings		\
670	su		\
671	sum		\
672	svc		\
673	swap		\
674	syseventadm	\
675	syseventd	\
676	tabs		\
677	tar		\
678	tbl		\
679	tee		\
680	time		\
681	tnf		\
682	touch		\
683	tput		\
684	troff		\
685	tsol		\
686	tty		\
687	ttymon		\
688	ul		\
689	uname		\
690	uniq		\
691	units		\
692	unlink		\
693	unpack		\
694	valtools	\
695	vgrind		\
696	vi		\
697	volcheck	\
698	volrmmount	\
699	w		\
700	wbem		\
701	wc		\
702	who		\
703	whodo		\
704	wracct		\
705	write		\
706	xargs		\
707	yppasswd	\
708	zdump		\
709	zfs		\
710	zic		\
711	zlogin		\
712	zoneadm		\
713	zoneadmd	\
714	zonecfg		\
715	zonename	\
716	zpool
717
718$(CLOSED_BUILD)MSGSUBDIRS += \
719	$(CLOSED)/cmd/fwflash	\
720	$(CLOSED)/cmd/iconv	\
721	$(CLOSED)/cmd/ksh	\
722	$(CLOSED)/cmd/llc2	\
723	$(CLOSED)/cmd/localedef	\
724	$(CLOSED)/cmd/more_xpg4	\
725	$(CLOSED)/cmd/ndmpadm   \
726	$(CLOSED)/cmd/ndmpstat  \
727	$(CLOSED)/cmd/od	\
728	$(CLOSED)/cmd/patch	\
729	$(CLOSED)/cmd/pax	\
730	$(CLOSED)/cmd/printf	\
731	$(CLOSED)/cmd/sed	\
732	$(CLOSED)/cmd/sed_xpg4	\
733	$(CLOSED)/cmd/tail	\
734	$(CLOSED)/cmd/tr	\
735	$(CLOSED)/cmd/tr_xpg4
736
737sparc_MSGSUBDIRS=	\
738	fruadm		\
739	prtdscp		\
740	prtfru		\
741	vntsd
742
743i386_MSGSUBDIRS=	\
744	ucodeadm
745
746#
747# commands that use dcgettext for localized time, LC_TIME
748#
749DCSUBDIRS=		\
750	cal		\
751	cfgadm		\
752	diff		\
753	ls		\
754	pr		\
755	ps		\
756	tar		\
757	w		\
758	who		\
759	whodo		\
760	write
761
762$(CLOSED_BUILD)DCSUBDIRS += \
763	$(CLOSED)/cmd/pax
764
765#
766# commands that belong only to the basic security module
767#
768BSMSUBDIRS=		\
769	allocate	\
770	amt		\
771	audit		\
772	audit_warn	\
773	auditconfig	\
774	auditd		\
775	auditreduce	\
776	auditstat	\
777	praudit		\
778	bsmconv		\
779	bsmrecord	\
780	bsmunconv
781
782#
783# commands not owned by the systems group
784#
785BWOSDIRS=
786
787#
788# Commands providing manifests must offer a check target.  A recursive check
789# target across all commands directories is not currently provided.
790#
791MANIFEST_TOPDIRS=			\
792	auditd				\
793	bnu				\
794	consadm				\
795	coreadm				\
796	cron				\
797	cvcd				\
798	dispadmin			\
799	drd				\
800	dumpadm				\
801	eeprom				\
802	fm				\
803	intrd				\
804	ipf				\
805	keyserv				\
806	ldapcachemgr			\
807	dlmgmtd				\
808	nscd				\
809	oplhpd				\
810	power				\
811	rexd				\
812	rpcbind				\
813	rpcsvc				\
814	saf				\
815	sf880drd			\
816	smserverd			\
817	syseventd			\
818	syslogd				\
819	utmpd				\
820	vntsd				\
821	ypcmd				\
822	zoneadmd
823
824MANIFEST_SUBDIRS=			\
825	boot/scripts			\
826	cmd-crypto/scripts		\
827	cmd-inet/usr.lib/in.chargend	\
828	cmd-inet/usr.lib/in.daytimed	\
829	cmd-inet/usr.lib/in.dhcpd	\
830	cmd-inet/usr.lib/in.discardd	\
831	cmd-inet/usr.lib/in.echod	\
832	cmd-inet/usr.lib/in.ndpd	\
833	cmd-inet/usr.lib/in.ripngd	\
834	cmd-inet/usr.lib/in.timed	\
835	cmd-inet/usr.lib/inetd		\
836	cmd-inet/usr.lib/mdnsd		\
837	cmd-inet/usr.lib/slpd		\
838	cmd-inet/usr.lib/wpad		\
839	cmd-inet/usr.sbin		\
840	cmd-inet/usr.sbin/in.ftpd	\
841	cmd-inet/usr.sbin/in.rdisc	\
842	cmd-inet/usr.sbin/in.routed	\
843	cmd-inet/usr.sbin/in.talkd	\
844	cmd-inet/usr.sbin/routeadm	\
845	cmd/tsol/labeld			\
846	cmd/tsol/tnctl			\
847	cmd/tsol/tnd			\
848	cmd/tsol/tsol-zones		\
849	dcs/sparc/sun4u			\
850	fs.d/autofs			\
851	fs.d/cachefs			\
852	fs.d/nfs/svc			\
853	gss/gssd			\
854	idmap/idmapd			\
855	krb5/kadmin/server		\
856	krb5/krb5kdc			\
857	krb5/kwarn			\
858	krb5/slave			\
859	lp/cmd/lpsched			\
860	lvm/rpc.metad			\
861	lvm/rpc.metamedd		\
862	lvm/rpc.metamhd			\
863	lvm/md_monitord			\
864	lvm/metassist/sysfiles		\
865	lvm/util			\
866	picl/picld			\
867	print/gateway			\
868	print/lp			\
869	rcap/rcapd			\
870	rpcsvc/rpc.bootparamd		\
871	sendmail/lib			\
872	smartcard/daemon		\
873	ssh/etc				\
874	svc/milestone			\
875	ypcmd/yppasswd			\
876	ypcmd/ypupdated			\
877	xntpd/xntpd
878
879DTEST_SUBDIRS= \
880	dtrace/test/tst
881
882all :=		TARGET = all
883install :=	TARGET = install
884clean :=	TARGET = clean
885clobber :=	TARGET = clobber
886lint :=		TARGET = lint
887check :=	TARGET = check
888_msg :=		TARGET = _msg
889_dc :=		TARGET = _dc
890
891.KEEP_STATE:
892
893SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
894
895.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(BSMSUBDIRS) \
896		$(MANIFEST_SUBDIRS) $(DTEST_SUBDIRS)
897
898all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) $(BSMSUBDIRS)
899
900check: svccfg_check .WAIT $(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS) \
901	$(DTEST_SUBDIRS)
902
903svccfg_check:
904	@$(ECHO) "building requirements for svccfg check ..."; \
905	(cd $(SRC)/cmd/svc/svccfg && pwd && $(MAKE) $(MFLAGS) native)
906
907$(DTEST_SUBDIRS): FRC
908	@cd $@; pwd; $(MAKE) $(TARGET)
909
910#
911# The .WAIT directive works around an apparent bug in parallel make.
912# Evidently make was getting the target _msg vs. _dc confused under
913# some level of parallelization, causing some of the _dc objects
914# not to be built.
915#
916_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
917
918_dc: $(DCSUBDIRS)
919
920#
921# Dependencies
922#
923fs.d: fstyp
924
925$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(BSMSUBDIRS) $(MANIFEST_SUBDIRS): FRC
926	@if [ -f $@/Makefile  ]; then \
927		cd $@; pwd; $(MAKE) $(TARGET); \
928	else \
929		true; \
930	fi
931
932FRC:
933