xref: /illumos-gate/usr/src/cmd/Makefile (revision 613b28719c10e84c1202c1045df44d77767de21d)
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	awk		\
69	awk_xpg4	\
70	backup		\
71	banner		\
72	bart		\
73	basename	\
74	bc		\
75	bdiff		\
76	bfs		\
77	bnu		\
78	boot		\
79	busstat		\
80	cal		\
81	calendar	\
82	captoinfo	\
83	cat		\
84	cdrw		\
85	cfgadm		\
86	checkeq		\
87	checknr		\
88	chgrp		\
89	chmod		\
90	chown		\
91	chroot		\
92	cksum		\
93	clear		\
94	clinfo		\
95	cmd-crypto	\
96	cmd-inet	\
97	cmp		\
98	col		\
99	comm		\
100	compress	\
101	consadm		\
102	coreadm		\
103	cpio		\
104	cpc		\
105	cron		\
106	crypt		\
107	csh		\
108	csplit		\
109	ctrun		\
110	ctstat		\
111	ctwatch		\
112	cut		\
113	datadm		\
114	date		\
115	dc		\
116	dd		\
117	deroff		\
118	des		\
119	devfsadm	\
120	syseventd	\
121	devctl		\
122	devinfo		\
123	devmgmt		\
124	devprop		\
125	dfs.cmds	\
126	diff		\
127	diff3		\
128	diffmk		\
129	dircmp		\
130	dirname		\
131	dis		\
132	diskmgtd	\
133	dispadmin	\
134	dladm		\
135	dmesg		\
136	dtrace		\
137	du		\
138	dumpadm		\
139	dumpcs		\
140	echo		\
141	ed		\
142	eeprom		\
143	egrep		\
144	eject		\
145	emul64ioctl	\
146	enhance		\
147	env		\
148	eqn		\
149	expand		\
150	expr		\
151	exstr		\
152	factor		\
153	false		\
154	fdetach		\
155	fdformat	\
156	fdisk		\
157	filesync	\
158	fgrep		\
159	file		\
160	filebench	\
161	find		\
162	fm		\
163	fmli		\
164	fmt		\
165	fmthard		\
166	fmtmsg		\
167	fold		\
168	format		\
169	fs.d		\
170	fstyp		\
171	fuser		\
172	fwflash		\
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	mms		\
256	modload		\
257	more		\
258	msgfmt		\
259	msgid		\
260	mt		\
261	mv		\
262	mvdir		\
263	netadm		\
264	netfiles	\
265	newform		\
266	newgrp		\
267	news		\
268	newtask		\
269	nice		\
270	nispasswd	\
271	nl		\
272	nlsadmin	\
273	nohup		\
274	nsadmin		\
275	nscd		\
276	oamuser		\
277	oawk		\
278	openssl		\
279	pack		\
280	pagesize	\
281	passmgmt	\
282	passwd		\
283	paste		\
284	pathchk		\
285	pbind		\
286	pcidr		\
287	pcmciad		\
288	pfexec		\
289	pgrep		\
290	picl		\
291	plimit		\
292	policykit	\
293	pools		\
294	power		\
295	ppgsz		\
296	pg		\
297	plockstat	\
298	pr		\
299	prctl		\
300	print		\
301	priocntl	\
302	profiles	\
303	projadd		\
304	projects	\
305	prstat		\
306	prtconf		\
307	prtdiag		\
308	prtvtoc		\
309	ps		\
310	psradm		\
311	psrinfo		\
312	psrset		\
313	ptools		\
314	pwck		\
315	pwconv		\
316	pwd		\
317	raidctl		\
318	ramdiskadm	\
319	rcap		\
320	rcm_daemon	\
321	rctladm		\
322	refer		\
323	regcmp		\
324	renice		\
325	rexd		\
326	rm		\
327	rmdir		\
328	rmformat	\
329	rmmount		\
330	rmt		\
331	rmvolmgr	\
332	roles		\
333	rpcbind		\
334	rpcgen		\
335	rpcinfo		\
336	rpcsvc		\
337	rpld		\
338	runat		\
339	sa		\
340	saf		\
341	savecore	\
342	script		\
343	scsi		\
344	sdiff		\
345	sdpadm		\
346	sendmail	\
347	setfacl		\
348	setmnt		\
349	setpgrp		\
350	setuname	\
351	sgs		\
352	sh		\
353	sleep		\
354	smbios		\
355	smbsrv		\
356	smserverd	\
357	soelim		\
358	sort		\
359	spell		\
360	spline		\
361	split		\
362	sqlite		\
363	srchtxt		\
364	ssh		\
365	stat		\
366	stmsboot	\
367	streams		\
368	strings		\
369	su		\
370	sulogin		\
371	sum		\
372	sunpc		\
373	svc		\
374	swap		\
375	sync		\
376	sysdef		\
377	syseventadm	\
378	syslogd		\
379	tabs		\
380	tar		\
381	tbl		\
382	tcopy		\
383	tcpd		\
384	tee		\
385	terminfo	\
386	th_tools	\
387	tic		\
388	time		\
389	tip		\
390	tnf		\
391	touch		\
392	tplot		\
393	tput		\
394	trapstat	\
395	troff		\
396	true		\
397	truss		\
398	tsol		\
399	tty		\
400	ttymon		\
401	uadmin		\
402	ul		\
403	uname		\
404	uniq		\
405	units		\
406	unlink		\
407	unpack		\
408	users		\
409	utmp_update	\
410	utmpd		\
411	valtools	\
412	vgrind		\
413	vi		\
414	vna		\
415	volcheck	\
416	volrmmount	\
417	vscan		\
418	w		\
419	wall		\
420	wbem		\
421	wc		\
422	which		\
423	who		\
424	whodo		\
425	wracct		\
426	write		\
427	xntpd		\
428	xargs		\
429	xstr		\
430	yes		\
431	ypcmd		\
432	yppasswd	\
433	zdb		\
434	zdump		\
435	zfs		\
436	zic		\
437	zinject		\
438	zlogin		\
439	zoneadm		\
440	zoneadmd	\
441	zonecfg		\
442	zonename	\
443	zpool		\
444	ztest
445
446$(CLOSED_BUILD)COMMON_SUBDIRS += \
447	$(CLOSED)/cmd/dodatadm	\
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_xpg4
467
468i386_SUBDIRS=		\
469	addbadsec	\
470	biosdev		\
471	diskscan	\
472	OWconfig	\
473	rtc		\
474	ucodeadm	\
475	xvm
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	fwflash		\
572	geniconvtbl	\
573	genmsg		\
574	getconf		\
575	getent		\
576	gettext		\
577	gettxt		\
578	grep		\
579	grep_xpg4	\
580	grpck		\
581	gss		\
582	halt		\
583	head		\
584	hostname	\
585	id		\
586	idmap		\
587	isaexec		\
588	iscsi		\
589	join		\
590	kbd		\
591	krb5		\
592	ksh		\
593	kstat		\
594	last		\
595	ldap		\
596	ldapcachemgr	\
597	lgrpinfo	\
598	locale		\
599	lofiadm		\
600	logadm		\
601	logger		\
602	logins		\
603	logname		\
604	ls		\
605	lvm		\
606	mailx		\
607	mesg		\
608	mkdir		\
609	mkpwdict	\
610	mktemp		\
611	more		\
612	msgfmt		\
613	mv		\
614	newgrp		\
615	newtask		\
616	nice		\
617	nispasswd	\
618	nohup		\
619	oawk		\
620	pack		\
621	passwd		\
622	passmgmt	\
623	paste		\
624	pathchk		\
625	pfexec		\
626	pg		\
627	pgrep		\
628	picl            \
629	pools		\
630	power		\
631	pr		\
632	praudit		\
633	print		\
634	profiles	\
635	projadd		\
636	projects	\
637	prstat		\
638	prtdiag		\
639	ps		\
640	psrinfo		\
641	ptools		\
642	pwconv		\
643	pwd		\
644	raidctl		\
645	ramdiskadm	\
646	rcap		\
647	rcm_daemon	\
648	refer		\
649	regcmp		\
650	renice		\
651	roles		\
652	rm		\
653	rmdir		\
654	rmformat	\
655	rmmount		\
656	rmvolmgr	\
657	scadm		\
658	script		\
659	scsi		\
660	sdiff		\
661	sdpadm		\
662	sgs		\
663	sh		\
664	sleep		\
665	sort		\
666	split		\
667	ssh		\
668	stat		\
669	stmsboot	\
670	strings		\
671	su		\
672	sum		\
673	svc		\
674	swap		\
675	syseventadm	\
676	syseventd	\
677	tabs		\
678	tar		\
679	tbl		\
680	tee		\
681	time		\
682	tnf		\
683	touch		\
684	tput		\
685	troff		\
686	tsol		\
687	tty		\
688	ttymon		\
689	ul		\
690	uname		\
691	uniq		\
692	units		\
693	unlink		\
694	unpack		\
695	valtools	\
696	vgrind		\
697	vi		\
698	volcheck	\
699	volrmmount	\
700	w		\
701	wbem		\
702	wc		\
703	who		\
704	whodo		\
705	wracct		\
706	write		\
707	xargs		\
708	yppasswd	\
709	zdump		\
710	zfs		\
711	zic		\
712	zlogin		\
713	zoneadm		\
714	zoneadmd	\
715	zonecfg		\
716	zonename	\
717	zpool
718
719$(CLOSED_BUILD)MSGSUBDIRS += \
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_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