xref: /illumos-gate/usr/src/cmd/Makefile (revision 6c70e1f8)
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# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
23
24include ../Makefile.master
25
26#
27#	Note that the commands 'agents', 'lp', 'perl', and 'man' are first in
28#	the list, violating alphabetical order.  This is because they are very
29#	long-running and should be given the most wall-clock time for a
30#	parallel build.
31#
32#	Commands in the FIRST_SUBDIRS list are built before starting the build
33#	of other commands.  Currently this includes only 'isaexec' and
34#	'platexec'.  This is necessary because $(ROOT)/usr/lib/isaexec or
35#	$(ROOT)/usr/lib/platexec must exist when some other commands are built
36#	because their 'make install' creates a hard link to one of them.
37#
38#	Commands are listed one per line so that TeamWare can auto-merge most
39#	changes.
40#
41
42FIRST_SUBDIRS=		\
43	isaexec		\
44	platexec
45
46COMMON_SUBDIRS=		\
47	agents		\
48	availdevs	\
49	lp		\
50	perl		\
51	man		\
52	Adm		\
53	abi		\
54	adbgen		\
55	acct		\
56	acctadm		\
57	arch		\
58	asa		\
59	ast		\
60	audio		\
61	auths		\
62	autopush	\
63	avs		\
64	awk		\
65	awk_xpg4	\
66	backup		\
67	banner		\
68	bart		\
69	basename	\
70	bc		\
71	bdiff		\
72	bfs		\
73	bnu		\
74	boot		\
75	busstat		\
76	cal		\
77	calendar	\
78	captoinfo	\
79	cat		\
80	cdrw		\
81	cfgadm		\
82	checkeq		\
83	checknr		\
84	chgrp		\
85	chmod		\
86	chown		\
87	chroot		\
88	clear		\
89	clinfo		\
90	cmd-crypto	\
91	cmd-inet	\
92	col		\
93	compress	\
94	consadm		\
95	coreadm		\
96	cpio		\
97	cpc		\
98	cron		\
99	crypt		\
100	csh		\
101	csplit		\
102	ctrun		\
103	ctstat		\
104	ctwatch		\
105	datadm		\
106	date		\
107	dc		\
108	dd		\
109	deroff		\
110	des		\
111	devfsadm	\
112	syseventd	\
113	devctl		\
114	devinfo		\
115	devmgmt		\
116	devprop		\
117	dfs.cmds	\
118	diff		\
119	diff3		\
120	diffmk		\
121	dircmp		\
122	dirname		\
123	dis		\
124	diskmgtd	\
125	dispadmin	\
126	dladm		\
127	dlstat		\
128	dmesg		\
129	dodatadm	\
130	dtrace		\
131	du		\
132	dumpadm		\
133	dumpcs		\
134	echo		\
135	ed		\
136	eeprom		\
137	egrep		\
138	eject		\
139	emul64ioctl	\
140	enhance		\
141	env		\
142	eqn		\
143	expand		\
144	expr		\
145	exstr		\
146	factor		\
147	false		\
148	fcinfo		\
149	fcoesvc		\
150	fdetach		\
151	fdformat	\
152	fdisk		\
153	filesync	\
154	fgrep		\
155	file		\
156	filebench	\
157	find		\
158	flowadm		\
159	flowstat	\
160	fm		\
161	fmli		\
162	fmt		\
163	fmthard		\
164	fmtmsg		\
165	fold		\
166	format		\
167	fs.d		\
168	fstyp		\
169	fuser		\
170	fwflash		\
171	gcore		\
172	gencat		\
173	geniconvtbl	\
174	genmsg		\
175	getconf		\
176	getdevpolicy	\
177	getent		\
178	getfacl		\
179	getmajor	\
180	getopt		\
181	gettext		\
182	gettxt		\
183	graph		\
184	grep		\
185	grep_xpg4	\
186	groups		\
187	grpck		\
188	gss		\
189	hal		\
190	halt		\
191	head		\
192	hostid		\
193	hostname	\
194	hotplug		\
195	hotplugd	\
196	hwdata		\
197	ibd_upgrade	\
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	itutools	\
212	iscsiadm	\
213	iscsid		\
214	iscsitsvc	\
215	isns		\
216	itadm		\
217	java		\
218	kbd		\
219	keyserv		\
220	killall		\
221	krb5		\
222	ksh		\
223	kstat		\
224	last		\
225	lastcomm	\
226	latencytop	\
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	look		\
244	ls		\
245	luxadm		\
246	lvm		\
247	mach		\
248	machid		\
249	mail		\
250	mailx		\
251	makekey		\
252	mdb		\
253	mesg		\
254	mkdir		\
255	mkfifo		\
256	mkfile		\
257	mkmsgs		\
258	mknod		\
259	mkpwdict	\
260	mktemp		\
261	modload		\
262	more		\
263	mpathadm	\
264	msgfmt		\
265	msgid		\
266	mt		\
267	mv		\
268	mvdir		\
269	ndmpadm		\
270	ndmpd		\
271	ndmpstat	\
272	netadm		\
273	netfiles	\
274	newform		\
275	newgrp		\
276	news		\
277	newtask		\
278	nice		\
279	nl		\
280	nlsadmin	\
281	nohup		\
282	nsadmin		\
283	nscd		\
284	oamuser		\
285	oawk		\
286	pack		\
287	pagesize	\
288	passmgmt	\
289	passwd		\
290	pathchk		\
291	pbind		\
292	pcidr		\
293	pcitool		\
294	pfexec		\
295	pgrep		\
296	picl		\
297	plimit		\
298	policykit	\
299	pools		\
300	power		\
301	powertop	\
302	ppgsz		\
303	pg		\
304	plockstat	\
305	pr		\
306	prctl		\
307	print		\
308	priocntl	\
309	profiles	\
310	projadd		\
311	projects	\
312	prstat		\
313	prtconf		\
314	prtdiag		\
315	prtvtoc		\
316	ps		\
317	psradm		\
318	psrinfo		\
319	psrset		\
320	ptools		\
321	pwck		\
322	pwconv		\
323	pwd		\
324	pyzfs		\
325	raidctl		\
326	ramdiskadm	\
327	rcap		\
328	rcm_daemon	\
329	rctladm		\
330	refer		\
331	regcmp		\
332	renice		\
333	rexd		\
334	rm		\
335	rmdir		\
336	rmformat	\
337	rmmount		\
338	rmt		\
339	rmvolmgr	\
340	roles		\
341	rpcbind		\
342	rpcgen		\
343	rpcinfo		\
344	rpcsvc		\
345	runat		\
346	sa		\
347	saf		\
348	sasinfo		\
349	savecore	\
350	sbdadm		\
351	script		\
352	scsi		\
353	sdiff		\
354	sdpadm		\
355	sendmail	\
356	setfacl		\
357	setmnt		\
358	setpgrp		\
359	setuname	\
360	sgs		\
361	sh		\
362	shcomp		\
363	smbios		\
364	smbsrv		\
365	smserverd	\
366	soelim		\
367	sort		\
368	spell		\
369	spline		\
370	split		\
371	sqlite		\
372	srchtxt		\
373	srptadm		\
374	srptsvc		\
375	ssh		\
376	stat		\
377	stmfadm		\
378	stmfproxy	\
379	stmfsvc		\
380	stmsboot	\
381	streams		\
382	strings		\
383	su		\
384	sulogin		\
385	sunpc		\
386	svc		\
387	svr4pkg		\
388	swap		\
389	sync		\
390	sysdef		\
391	syseventadm	\
392	syslogd		\
393	tabs		\
394	tar		\
395	tbl		\
396	tcopy		\
397	tcpd		\
398	terminfo	\
399	th_tools	\
400	tic		\
401	time		\
402	tip		\
403	tnf		\
404	touch		\
405	tplot		\
406	tput		\
407	trapstat	\
408	troff		\
409	true		\
410	truss		\
411	tsol		\
412	tty		\
413	ttymon		\
414	tzreload	\
415	uadmin		\
416	ul		\
417	uname		\
418	units		\
419	unlink		\
420	unpack		\
421	users		\
422	utmp_update	\
423	utmpd		\
424	valtools	\
425	vgrind		\
426	vi		\
427	volcheck	\
428	volrmmount	\
429	vrrpadm		\
430	vscan		\
431	vt		\
432	w		\
433	wall		\
434	wbem		\
435	which		\
436	who		\
437	whodo		\
438	wracct		\
439	write		\
440	wusbadm		\
441	xargs		\
442	xstr		\
443	yes		\
444	ypcmd		\
445	yppasswd	\
446	zdb		\
447	zdump		\
448	zfs		\
449	zic		\
450	zinject		\
451	zlogin		\
452	zoneadm		\
453	zoneadmd	\
454	zonecfg		\
455	zonename	\
456	zpool		\
457	zlook		\
458	zstreamdump	\
459	ztest
460
461$(CLOSED_BUILD)COMMON_SUBDIRS += \
462	$(CLOSED)/cmd/iconv	\
463	$(CLOSED)/cmd/ksh	\
464	$(CLOSED)/cmd/llc2	\
465	$(CLOSED)/cmd/localedef	\
466	$(CLOSED)/cmd/more_xpg4	\
467	$(CLOSED)/cmd/mtst	\
468	$(CLOSED)/cmd/od	\
469	$(CLOSED)/cmd/patch	\
470	$(CLOSED)/cmd/pax	\
471	$(CLOSED)/cmd/printf	\
472	$(CLOSED)/cmd/sed	\
473	$(CLOSED)/cmd/sed_xpg4	\
474ODE	$(CLOSED)/cmd/tail	\
475	$(CLOSED)/cmd/tr_xpg4
476
477i386_SUBDIRS=		\
478	acpihpd		\
479	addbadsec	\
480	biosdev		\
481	diskscan	\
482	lms		\
483	ntfsprogs	\
484	parted		\
485	rtc		\
486	ucodeadm	\
487	xvm
488
489sparc_SUBDIRS=		\
490	cvcd		\
491	dcs		\
492	device_remap	\
493	drd		\
494	fps		\
495	fruadm		\
496	ldmad		\
497	oplhpd		\
498	prtdscp		\
499	prtfru		\
500	scadm		\
501	sckmd		\
502	sf880drd	\
503	virtinfo	\
504	vntsd
505
506#
507# Commands that are messaged.  Note that 'lp' and 'man' come first
508# (see previous comment about 'lp' and 'man').
509#
510MSGSUBDIRS=		\
511	lp		\
512	man		\
513	abi		\
514	acctadm		\
515	allocate	\
516	asa		\
517	audio		\
518	audit		\
519	auditd		\
520	auditrecord	\
521	auths		\
522	autopush	\
523	avs		\
524	awk		\
525	awk_xpg4	\
526	backup		\
527	banner		\
528	bart		\
529	basename	\
530	bnu		\
531	bsmconv		\
532	bsmunconv	\
533	busstat		\
534	cal		\
535	cat		\
536	cdrw		\
537	cfgadm		\
538	checkeq		\
539	checknr		\
540	chgrp		\
541	chmod		\
542	chown		\
543	cmd-crypto	\
544	cmd-inet	\
545	col		\
546	compress	\
547	consadm		\
548	coreadm		\
549	cpio		\
550	cpc		\
551	cron		\
552	csh		\
553	csplit		\
554	ctrun		\
555	ctstat		\
556	ctwatch		\
557	datadm		\
558	date		\
559	dc		\
560	dcs		\
561	dd		\
562	deroff		\
563	devfsadm	\
564	dfs.cmds	\
565	diff		\
566	diffmk		\
567	dladm		\
568	dlstat		\
569	du		\
570	dumpcs		\
571	ed		\
572	eject		\
573	env		\
574	eqn		\
575	expand		\
576	expr		\
577	fcinfo		\
578	fgrep		\
579	file		\
580	filesync	\
581	find		\
582	flowadm		\
583	flowstat	\
584	fm		\
585	fold		\
586	fs.d		\
587	fwflash		\
588	geniconvtbl	\
589	genmsg		\
590	getconf		\
591	getent		\
592	gettext		\
593	gettxt		\
594	grep		\
595	grep_xpg4	\
596	grpck		\
597	gss		\
598	halt		\
599	head		\
600	hostname	\
601	hotplug		\
602	id		\
603	idmap		\
604	isaexec		\
605	iscsiadm	\
606	iscsid		\
607	isns		\
608	itadm		\
609	kbd		\
610	krb5		\
611	ksh		\
612	kstat		\
613	last		\
614	ldap		\
615	ldapcachemgr	\
616	lgrpinfo	\
617	locale		\
618	lofiadm		\
619	logadm		\
620	logger		\
621	logins		\
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	nohup		\
640	oawk		\
641	pack		\
642	passwd		\
643	passmgmt	\
644	pathchk		\
645	pfexec		\
646	pg		\
647	pgrep		\
648	picl            \
649	pools		\
650	power		\
651	pr		\
652	praudit		\
653	print		\
654	profiles	\
655	projadd		\
656	projects	\
657	prstat		\
658	prtdiag		\
659	ps		\
660	psrinfo		\
661	ptools		\
662	pwconv		\
663	pwd		\
664	pyzfs		\
665	raidctl		\
666	ramdiskadm	\
667	rcap		\
668	rcm_daemon	\
669	refer		\
670	regcmp		\
671	renice		\
672	roles		\
673	rm		\
674	rmdir		\
675	rmformat	\
676	rmmount		\
677	rmvolmgr	\
678	sasinfo		\
679	sbdadm		\
680	scadm		\
681	script		\
682	scsi		\
683	sdiff		\
684	sdpadm		\
685	sgs		\
686	sh		\
687	shcomp		\
688	smbsrv		\
689	sort		\
690	split		\
691	srptadm		\
692	ssh		\
693	stat		\
694	stmfadm		\
695	stmsboot	\
696	strings		\
697	su		\
698	svc		\
699	svr4pkg		\
700	swap		\
701	syseventadm	\
702	syseventd	\
703	tabs		\
704	tar		\
705	tbl		\
706	time		\
707	tnf		\
708	touch		\
709	tput		\
710	troff		\
711	tsol		\
712	tty		\
713	ttymon		\
714	tzreload	\
715	ul		\
716	uname		\
717	units		\
718	unlink		\
719	unpack		\
720	valtools	\
721	vgrind		\
722	vi		\
723	volcheck	\
724	volrmmount	\
725	vrrpadm		\
726	vscan		\
727	w		\
728	wbem		\
729	who		\
730	whodo		\
731	wracct		\
732	write		\
733	wusbadm		\
734	xargs		\
735	yppasswd	\
736	zdump		\
737	zfs		\
738	zic		\
739	zlogin		\
740	zoneadm		\
741	zoneadmd	\
742	zonecfg		\
743	zonename	\
744	zpool
745
746$(CLOSED_BUILD)MSGSUBDIRS += \
747	$(CLOSED)/cmd/iconv	\
748	$(CLOSED)/cmd/ksh	\
749	$(CLOSED)/cmd/llc2	\
750	$(CLOSED)/cmd/localedef	\
751	$(CLOSED)/cmd/more_xpg4	\
752	$(CLOSED)/cmd/od	\
753	$(CLOSED)/cmd/patch	\
754	$(CLOSED)/cmd/pax	\
755	$(CLOSED)/cmd/printf	\
756	$(CLOSED)/cmd/sed	\
757	$(CLOSED)/cmd/sed_xpg4	\
758	$(CLOSED)/cmd/tail	\
759	$(CLOSED)/cmd/tr_xpg4
760
761sparc_MSGSUBDIRS=	\
762	fruadm		\
763	prtdscp		\
764	prtfru		\
765	virtinfo	\
766	vntsd
767
768i386_MSGSUBDIRS=	\
769	ucodeadm
770
771#
772# commands that use dcgettext for localized time, LC_TIME
773#
774DCSUBDIRS=		\
775	cal		\
776	cfgadm		\
777	diff		\
778	ls		\
779	pr		\
780	ps		\
781	tar		\
782	w		\
783	who		\
784	whodo		\
785	write
786
787$(CLOSED_BUILD)DCSUBDIRS += \
788	$(CLOSED)/cmd/pax
789
790#
791# commands that belong only to audit and device allocation
792#
793AUDITSUBDIRS=		\
794	allocate	\
795	amt		\
796	audit		\
797	audit_warn	\
798	auditconfig	\
799	auditd		\
800	auditrecord	\
801	auditreduce	\
802	auditstat	\
803	praudit		\
804	bsmconv		\
805	bsmunconv
806
807#
808# commands not owned by the systems group
809#
810BWOSDIRS=
811
812
813all :=		TARGET = all
814install :=	TARGET = install
815clean :=	TARGET = clean
816clobber :=	TARGET = clobber
817lint :=		TARGET = lint
818_msg :=		TARGET = _msg
819_dc :=		TARGET = _dc
820
821.KEEP_STATE:
822
823SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
824
825.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
826
827all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
828	$(AUDITSUBDIRS)
829
830#
831# Manifests cannot be checked in parallel, because we are using
832# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
833# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
834# we spawn off a sub-make to perform the non-parallel 'make check'
835#
836check:
837	$(MAKE) -f Makefile.check check
838
839#
840# The .WAIT directive works around an apparent bug in parallel make.
841# Evidently make was getting the target _msg vs. _dc confused under
842# some level of parallelization, causing some of the _dc objects
843# not to be built.
844#
845_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
846
847_dc: $(DCSUBDIRS)
848
849#
850# Dependencies
851#
852fs.d: fstyp
853ksh:	shcomp isaexec
854print:	lp
855
856$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
857	@if [ -f $@/Makefile  ]; then \
858		cd $@; pwd; $(MAKE) $(TARGET); \
859	else \
860		true; \
861	fi
862
863FRC:
864