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