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