xref: /illumos-gate/usr/src/cmd/Makefile (revision 074e084f68dd0b08686612bec695a0cfe249da6d)
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	fwflash		\
174	gcore		\
175	gencat		\
176	geniconvtbl	\
177	genmsg		\
178	getconf		\
179	getdevpolicy	\
180	getent		\
181	getfacl		\
182	getmajor	\
183	getopt		\
184	gettext		\
185	gettxt		\
186	graph		\
187	grep		\
188	grep_xpg4	\
189	groups		\
190	grpck		\
191	gss		\
192	hal		\
193	halt		\
194	head		\
195	hostid		\
196	hostname	\
197	hwdata		\
198	id		\
199	idmap		\
200	infocmp		\
201	init		\
202	initpkg		\
203	install.d	\
204	intrd		\
205	intrstat	\
206	ipcrm		\
207	ipcs		\
208	ipf		\
209	isainfo		\
210	isalist		\
211	iscsi		\
212	java		\
213	join		\
214	kbd		\
215	keyserv		\
216	killall		\
217	krb5		\
218	ksh		\
219	kstat		\
220	last		\
221	lastcomm	\
222	ldap		\
223	ldapcachemgr	\
224	lgrpinfo	\
225	line		\
226	link		\
227	dlmgmtd		\
228	listen		\
229	loadkeys	\
230	locale		\
231	lockstat	\
232	locator		\
233	lofiadm		\
234	logadm		\
235	logger		\
236	login		\
237	logins		\
238	logname		\
239	look		\
240	ls		\
241	lvm		\
242	mach		\
243	machid		\
244	mail		\
245	mailx		\
246	makekey		\
247	mdb		\
248	mesg		\
249	mkdir		\
250	mkfifo		\
251	mkfile		\
252	mkmsgs		\
253	mknod		\
254	mkpwdict	\
255	mktemp		\
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
476sparc_SUBDIRS=		\
477	cvcd		\
478	dcs		\
479	drd		\
480	fps		\
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	fwflash		\
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/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_xpg4
734
735sparc_MSGSUBDIRS=	\
736	fruadm		\
737	prtdscp		\
738	prtfru		\
739	vntsd
740
741i386_MSGSUBDIRS=	\
742	ucodeadm
743
744#
745# commands that use dcgettext for localized time, LC_TIME
746#
747DCSUBDIRS=		\
748	cal		\
749	cfgadm		\
750	diff		\
751	ls		\
752	pr		\
753	ps		\
754	tar		\
755	w		\
756	who		\
757	whodo		\
758	write
759
760$(CLOSED_BUILD)DCSUBDIRS += \
761	$(CLOSED)/cmd/pax
762
763#
764# commands that belong only to the basic security module
765#
766BSMSUBDIRS=		\
767	allocate	\
768	amt		\
769	audit		\
770	audit_warn	\
771	auditconfig	\
772	auditd		\
773	auditreduce	\
774	auditstat	\
775	praudit		\
776	bsmconv		\
777	bsmrecord	\
778	bsmunconv
779
780#
781# commands not owned by the systems group
782#
783BWOSDIRS=
784
785#
786# Commands providing manifests must offer a check target.  A recursive check
787# target across all commands directories is not currently provided.
788#
789MANIFEST_TOPDIRS=			\
790	auditd				\
791	bnu				\
792	consadm				\
793	coreadm				\
794	cron				\
795	cvcd				\
796	dispadmin			\
797	drd				\
798	dumpadm				\
799	eeprom				\
800	fm				\
801	intrd				\
802	ipf				\
803	keyserv				\
804	ldapcachemgr			\
805	dlmgmtd				\
806	nscd				\
807	oplhpd				\
808	power				\
809	rexd				\
810	rpcbind				\
811	rpcsvc				\
812	saf				\
813	sf880drd			\
814	smserverd			\
815	syseventd			\
816	syslogd				\
817	utmpd				\
818	vntsd				\
819	ypcmd				\
820	zoneadmd
821
822MANIFEST_SUBDIRS=			\
823	boot/scripts			\
824	cmd-crypto/scripts		\
825	cmd-inet/usr.lib/in.chargend	\
826	cmd-inet/usr.lib/in.daytimed	\
827	cmd-inet/usr.lib/in.dhcpd	\
828	cmd-inet/usr.lib/in.discardd	\
829	cmd-inet/usr.lib/in.echod	\
830	cmd-inet/usr.lib/in.ndpd	\
831	cmd-inet/usr.lib/in.ripngd	\
832	cmd-inet/usr.lib/in.timed	\
833	cmd-inet/usr.lib/inetd		\
834	cmd-inet/usr.lib/mdnsd		\
835	cmd-inet/usr.lib/slpd		\
836	cmd-inet/usr.lib/wpad		\
837	cmd-inet/usr.sbin		\
838	cmd-inet/usr.sbin/in.ftpd	\
839	cmd-inet/usr.sbin/in.rdisc	\
840	cmd-inet/usr.sbin/in.routed	\
841	cmd-inet/usr.sbin/in.talkd	\
842	cmd-inet/usr.sbin/routeadm	\
843	cmd/tsol/labeld			\
844	cmd/tsol/tnctl			\
845	cmd/tsol/tnd			\
846	cmd/tsol/tsol-zones		\
847	dcs/sparc/sun4u			\
848	fs.d/autofs			\
849	fs.d/cachefs			\
850	fs.d/nfs/svc			\
851	gss/gssd			\
852	idmap/idmapd			\
853	krb5/kadmin/server		\
854	krb5/krb5kdc			\
855	krb5/kwarn			\
856	krb5/slave			\
857	lp/cmd/lpsched			\
858	lvm/rpc.metad			\
859	lvm/rpc.metamedd		\
860	lvm/rpc.metamhd			\
861	lvm/md_monitord			\
862	lvm/metassist/sysfiles		\
863	lvm/util			\
864	picl/picld			\
865	print/gateway			\
866	print/lp			\
867	rcap/rcapd			\
868	rpcsvc/rpc.bootparamd		\
869	sendmail/lib			\
870	smartcard/daemon		\
871	ssh/etc				\
872	svc/milestone			\
873	ypcmd/yppasswd			\
874	ypcmd/ypupdated			\
875	xntpd/xntpd
876
877DTEST_SUBDIRS= \
878	dtrace/test/tst
879
880all :=		TARGET = all
881install :=	TARGET = install
882clean :=	TARGET = clean
883clobber :=	TARGET = clobber
884lint :=		TARGET = lint
885check :=	TARGET = check
886_msg :=		TARGET = _msg
887_dc :=		TARGET = _dc
888
889.KEEP_STATE:
890
891SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
892
893.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(BSMSUBDIRS) \
894		$(MANIFEST_SUBDIRS) $(DTEST_SUBDIRS)
895
896all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) $(BSMSUBDIRS)
897
898check: svccfg_check .WAIT $(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS) \
899	$(DTEST_SUBDIRS)
900
901svccfg_check:
902	@$(ECHO) "building requirements for svccfg check ..."; \
903	(cd $(SRC)/cmd/svc/svccfg && pwd && $(MAKE) $(MFLAGS) native)
904
905$(DTEST_SUBDIRS): FRC
906	@cd $@; pwd; $(MAKE) $(TARGET)
907
908#
909# The .WAIT directive works around an apparent bug in parallel make.
910# Evidently make was getting the target _msg vs. _dc confused under
911# some level of parallelization, causing some of the _dc objects
912# not to be built.
913#
914_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
915
916_dc: $(DCSUBDIRS)
917
918#
919# Dependencies
920#
921fs.d: fstyp
922
923$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(BSMSUBDIRS) $(MANIFEST_SUBDIRS): FRC
924	@if [ -f $@/Makefile  ]; then \
925		cd $@; pwd; $(MAKE) $(TARGET); \
926	else \
927		true; \
928	fi
929
930FRC:
931