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