xref: /illumos-gate/usr/src/cmd/Makefile (revision b52a336e0ccd9ef29cd11bb3c7e530788483ee04)
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	fmt		\
162	fmthard		\
163	fmtmsg		\
164	fold		\
165	format		\
166	fs.d		\
167	fstyp		\
168	fuser		\
169	fwflash		\
170	gcore		\
171	gencat		\
172	geniconvtbl	\
173	genmsg		\
174	getconf		\
175	getdevpolicy	\
176	getent		\
177	getfacl		\
178	getmajor	\
179	getopt		\
180	gettext		\
181	gettxt		\
182	grep		\
183	grep_xpg4	\
184	groups		\
185	grpck		\
186	gss		\
187	hal		\
188	halt		\
189	head		\
190	hostid		\
191	hostname	\
192	hotplug		\
193	hotplugd	\
194	hwdata		\
195	ibd_upgrade	\
196	id		\
197	idmap		\
198	infocmp		\
199	init		\
200	initpkg		\
201	install.d	\
202	intrd		\
203	intrstat	\
204	ipcrm		\
205	ipcs		\
206	ipf		\
207	isainfo		\
208	isalist		\
209	itutools	\
210	iscsiadm	\
211	iscsid		\
212	iscsitsvc	\
213	isns		\
214	itadm		\
215	java		\
216	kbd		\
217	keyserv		\
218	killall		\
219	krb5		\
220	ksh		\
221	kstat		\
222	last		\
223	lastcomm	\
224	latencytop	\
225	ldap		\
226	ldapcachemgr	\
227	lgrpinfo	\
228	line		\
229	link		\
230	dlmgmtd		\
231	listen		\
232	loadkeys	\
233	locale		\
234	lockstat	\
235	locator		\
236	lofiadm		\
237	logadm		\
238	logger		\
239	login		\
240	logins		\
241	look		\
242	ls		\
243	luxadm		\
244	lvm		\
245	mach		\
246	machid		\
247	mail		\
248	mailx		\
249	makekey		\
250	mdb		\
251	mesg		\
252	mkdir		\
253	mkfifo		\
254	mkfile		\
255	mkmsgs		\
256	mknod		\
257	mkpwdict	\
258	mktemp		\
259	modload		\
260	more		\
261	mpathadm	\
262	msgfmt		\
263	msgid		\
264	mt		\
265	mv		\
266	mvdir		\
267	ndmpadm		\
268	ndmpd		\
269	ndmpstat	\
270	netadm		\
271	netfiles	\
272	newform		\
273	newgrp		\
274	news		\
275	newtask		\
276	nice		\
277	nl		\
278	nlsadmin	\
279	nohup		\
280	nsadmin		\
281	nscd		\
282	oamuser		\
283	oawk		\
284	pack		\
285	pagesize	\
286	passmgmt	\
287	passwd		\
288	pathchk		\
289	pbind		\
290	pcidr		\
291	pcitool		\
292	pfexec		\
293	pfexecd		\
294	pgrep		\
295	picl		\
296	plimit		\
297	policykit	\
298	pools		\
299	power		\
300	powertop	\
301	ppgsz		\
302	pg		\
303	plockstat	\
304	pr		\
305	prctl		\
306	print		\
307	priocntl	\
308	profiles	\
309	projadd		\
310	projects	\
311	prstat		\
312	prtconf		\
313	prtdiag		\
314	prtvtoc		\
315	ps		\
316	psradm		\
317	psrinfo		\
318	psrset		\
319	ptools		\
320	pwck		\
321	pwconv		\
322	pwd		\
323	pyzfs		\
324	raidctl		\
325	ramdiskadm	\
326	rcap		\
327	rcm_daemon	\
328	rctladm		\
329	refer		\
330	regcmp		\
331	renice		\
332	rexd		\
333	rm		\
334	rmdir		\
335	rmformat	\
336	rmmount		\
337	rmt		\
338	rmvolmgr	\
339	roles		\
340	rpcbind		\
341	rpcgen		\
342	rpcinfo		\
343	rpcsvc		\
344	runat		\
345	sa		\
346	saf		\
347	sasinfo		\
348	savecore	\
349	sbdadm		\
350	script		\
351	scsi		\
352	sdiff		\
353	sdpadm		\
354	sendmail	\
355	setfacl		\
356	setmnt		\
357	setpgrp		\
358	setuname	\
359	sgs		\
360	sh		\
361	shcomp		\
362	smbios		\
363	smbsrv		\
364	smserverd	\
365	soelim		\
366	sort		\
367	spell		\
368	split		\
369	sqlite		\
370	srchtxt		\
371	srptadm		\
372	srptsvc		\
373	ssh		\
374	stat		\
375	stmfadm		\
376	stmfproxy	\
377	stmfsvc		\
378	stmsboot	\
379	streams		\
380	strings		\
381	su		\
382	sulogin		\
383	sunpc		\
384	svc		\
385	svr4pkg		\
386	swap		\
387	sync		\
388	sysdef		\
389	syseventadm	\
390	syslogd		\
391	tabs		\
392	tar		\
393	tbl		\
394	tcopy		\
395	tcpd		\
396	terminfo	\
397	th_tools	\
398	tic		\
399	time		\
400	tip		\
401	tnf		\
402	touch		\
403	tplot		\
404	tput		\
405	trapstat	\
406	troff		\
407	true		\
408	truss		\
409	tsol		\
410	tty		\
411	ttymon		\
412	tzreload	\
413	uadmin		\
414	ul		\
415	uname		\
416	units		\
417	unlink		\
418	unpack		\
419	userattr	\
420	users		\
421	utmp_update	\
422	utmpd		\
423	valtools	\
424	vgrind		\
425	vi		\
426	volcheck	\
427	volrmmount	\
428	vrrpadm		\
429	vscan		\
430	vt		\
431	w		\
432	wall		\
433	wbem		\
434	which		\
435	who		\
436	whodo		\
437	wracct		\
438	write		\
439	wusbadm		\
440	xargs		\
441	xstr		\
442	yes		\
443	ypcmd		\
444	yppasswd	\
445	zdb		\
446	zdump		\
447	zfs		\
448	zic		\
449	zinject		\
450	zlogin		\
451	zoneadm		\
452	zoneadmd	\
453	zonecfg		\
454	zonename	\
455	zpool		\
456	zlook		\
457	zstreamdump	\
458	ztest
459
460$(CLOSED_BUILD)COMMON_SUBDIRS += \
461	$(CLOSED)/cmd/iconv	\
462	$(CLOSED)/cmd/ksh	\
463	$(CLOSED)/cmd/llc2	\
464	$(CLOSED)/cmd/localedef	\
465	$(CLOSED)/cmd/more_xpg4	\
466	$(CLOSED)/cmd/mtst	\
467	$(CLOSED)/cmd/od	\
468	$(CLOSED)/cmd/patch	\
469	$(CLOSED)/cmd/pax	\
470	$(CLOSED)/cmd/printf	\
471	$(CLOSED)/cmd/sed	\
472	$(CLOSED)/cmd/sed_xpg4	\
473	$(CLOSED)/cmd/tail	\
474	$(CLOSED)/cmd/tr_xpg4
475
476i386_SUBDIRS=		\
477	acpihpd		\
478	addbadsec	\
479	biosdev		\
480	diskscan	\
481	lms		\
482	ntfsprogs	\
483	parted		\
484	rtc		\
485	ucodeadm	\
486	xvm
487
488sparc_SUBDIRS=		\
489	cvcd		\
490	dcs		\
491	device_remap	\
492	drd		\
493	fps		\
494	fruadm		\
495	ldmad		\
496	oplhpd		\
497	prtdscp		\
498	prtfru		\
499	scadm		\
500	sckmd		\
501	sf880drd	\
502	virtinfo	\
503	vntsd
504
505#
506# Commands that are messaged.  Note that 'lp' and 'man' come first
507# (see previous comment about 'lp' and 'man').
508#
509MSGSUBDIRS=		\
510	lp		\
511	man		\
512	abi		\
513	acctadm		\
514	allocate	\
515	asa		\
516	audio		\
517	audit		\
518	auditd		\
519	auditrecord	\
520	auths		\
521	autopush	\
522	avs		\
523	awk		\
524	awk_xpg4	\
525	backup		\
526	banner		\
527	bart		\
528	basename	\
529	bnu		\
530	bsmconv		\
531	bsmunconv	\
532	busstat		\
533	cal		\
534	cat		\
535	cdrw		\
536	cfgadm		\
537	checkeq		\
538	checknr		\
539	chgrp		\
540	chmod		\
541	chown		\
542	cmd-crypto	\
543	cmd-inet	\
544	col		\
545	compress	\
546	consadm		\
547	coreadm		\
548	cpio		\
549	cpc		\
550	cron		\
551	csh		\
552	csplit		\
553	ctrun		\
554	ctstat		\
555	ctwatch		\
556	datadm		\
557	date		\
558	dc		\
559	dcs		\
560	dd		\
561	deroff		\
562	devfsadm	\
563	dfs.cmds	\
564	diff		\
565	diffmk		\
566	dladm		\
567	dlstat		\
568	du		\
569	dumpcs		\
570	ed		\
571	eject		\
572	env		\
573	eqn		\
574	expand		\
575	expr		\
576	fcinfo		\
577	fgrep		\
578	file		\
579	filesync	\
580	find		\
581	flowadm		\
582	flowstat	\
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	hotplug		\
601	id		\
602	idmap		\
603	isaexec		\
604	iscsiadm	\
605	iscsid		\
606	isns		\
607	itadm		\
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	ls		\
622	luxadm		\
623	lvm		\
624	mailx		\
625	mesg		\
626	mkdir		\
627	mkpwdict	\
628	mktemp		\
629	more		\
630	mpathadm	\
631	msgfmt		\
632	mv		\
633	ndmpadm		\
634	ndmpstat	\
635	newgrp		\
636	newtask		\
637	nice		\
638	nohup		\
639	oawk		\
640	pack		\
641	passwd		\
642	passmgmt	\
643	pathchk		\
644	pfexec		\
645	pg		\
646	pgrep		\
647	picl            \
648	pools		\
649	power		\
650	pr		\
651	praudit		\
652	print		\
653	profiles	\
654	projadd		\
655	projects	\
656	prstat		\
657	prtdiag		\
658	ps		\
659	psrinfo		\
660	ptools		\
661	pwconv		\
662	pwd		\
663	pyzfs		\
664	raidctl		\
665	ramdiskadm	\
666	rcap		\
667	rcm_daemon	\
668	refer		\
669	regcmp		\
670	renice		\
671	roles		\
672	rm		\
673	rmdir		\
674	rmformat	\
675	rmmount		\
676	rmvolmgr	\
677	sasinfo		\
678	sbdadm		\
679	scadm		\
680	script		\
681	scsi		\
682	sdiff		\
683	sdpadm		\
684	sgs		\
685	sh		\
686	shcomp		\
687	smbsrv		\
688	sort		\
689	split		\
690	srptadm		\
691	ssh		\
692	stat		\
693	stmfadm		\
694	stmsboot	\
695	strings		\
696	su		\
697	svc		\
698	svr4pkg		\
699	swap		\
700	syseventadm	\
701	syseventd	\
702	tabs		\
703	tar		\
704	tbl		\
705	time		\
706	tnf		\
707	touch		\
708	tput		\
709	troff		\
710	tsol		\
711	tty		\
712	ttymon		\
713	tzreload	\
714	ul		\
715	uname		\
716	units		\
717	unlink		\
718	unpack		\
719	userattr	\
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