xref: /illumos-gate/usr/src/cmd/Makefile (revision 8d0c3d29bb99f6521f2dc5058a7e4debebad7899)
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	users		\
420	utmp_update	\
421	utmpd		\
422	valtools	\
423	vgrind		\
424	vi		\
425	volcheck	\
426	volrmmount	\
427	vrrpadm		\
428	vscan		\
429	vt		\
430	w		\
431	wall		\
432	which		\
433	who		\
434	whodo		\
435	wracct		\
436	write		\
437	wusbadm		\
438	xargs		\
439	xstr		\
440	yes		\
441	ypcmd		\
442	yppasswd	\
443	zdb		\
444	zdump		\
445	zfs		\
446	zic		\
447	zinject		\
448	zlogin		\
449	zoneadm		\
450	zoneadmd	\
451	zonecfg		\
452	zonename	\
453	zpool		\
454	zlook		\
455	zstreamdump	\
456	ztest
457
458$(CLOSED_BUILD)COMMON_SUBDIRS += \
459	$(CLOSED)/cmd/iconv	\
460	$(CLOSED)/cmd/ksh	\
461	$(CLOSED)/cmd/llc2	\
462	$(CLOSED)/cmd/localedef	\
463	$(CLOSED)/cmd/more_xpg4	\
464	$(CLOSED)/cmd/mtst	\
465	$(CLOSED)/cmd/od	\
466	$(CLOSED)/cmd/patch	\
467	$(CLOSED)/cmd/pax	\
468	$(CLOSED)/cmd/printf	\
469	$(CLOSED)/cmd/sed	\
470	$(CLOSED)/cmd/sed_xpg4	\
471	$(CLOSED)/cmd/tail	\
472	$(CLOSED)/cmd/tr_xpg4
473
474i386_SUBDIRS=		\
475	acpihpd		\
476	addbadsec	\
477	biosdev		\
478	diskscan	\
479	lms		\
480	ntfsprogs	\
481	parted		\
482	rtc		\
483	ucodeadm	\
484	xvm
485
486sparc_SUBDIRS=		\
487	cvcd		\
488	dcs		\
489	device_remap	\
490	drd		\
491	fps		\
492	fruadm		\
493	ldmad		\
494	oplhpd		\
495	prtdscp		\
496	prtfru		\
497	scadm		\
498	sckmd		\
499	sf880drd	\
500	virtinfo	\
501	vntsd
502
503#
504# Commands that are messaged.  Note that 'lp' and 'man' come first
505# (see previous comment about 'lp' and 'man').
506#
507MSGSUBDIRS=		\
508	lp		\
509	man		\
510	abi		\
511	acctadm		\
512	allocate	\
513	asa		\
514	audio		\
515	audit		\
516	auditd		\
517	auditrecord	\
518	auths		\
519	autopush	\
520	avs		\
521	awk		\
522	awk_xpg4	\
523	backup		\
524	banner		\
525	bart		\
526	basename	\
527	bnu		\
528	bsmconv		\
529	bsmunconv	\
530	busstat		\
531	cal		\
532	cat		\
533	cdrw		\
534	cfgadm		\
535	checkeq		\
536	checknr		\
537	chgrp		\
538	chmod		\
539	chown		\
540	cmd-crypto	\
541	cmd-inet	\
542	col		\
543	compress	\
544	consadm		\
545	coreadm		\
546	cpio		\
547	cpc		\
548	cron		\
549	csh		\
550	csplit		\
551	ctrun		\
552	ctstat		\
553	ctwatch		\
554	datadm		\
555	date		\
556	dc		\
557	dcs		\
558	dd		\
559	deroff		\
560	devfsadm	\
561	dfs.cmds	\
562	diff		\
563	diffmk		\
564	dladm		\
565	dlstat		\
566	du		\
567	dumpcs		\
568	ed		\
569	eject		\
570	env		\
571	eqn		\
572	expand		\
573	expr		\
574	fcinfo		\
575	fgrep		\
576	file		\
577	filesync	\
578	find		\
579	flowadm		\
580	flowstat	\
581	fm		\
582	fold		\
583	fs.d		\
584	fwflash		\
585	geniconvtbl	\
586	genmsg		\
587	getconf		\
588	getent		\
589	gettext		\
590	gettxt		\
591	grep		\
592	grep_xpg4	\
593	grpck		\
594	gss		\
595	halt		\
596	head		\
597	hostname	\
598	hotplug		\
599	id		\
600	idmap		\
601	isaexec		\
602	iscsiadm	\
603	iscsid		\
604	isns		\
605	itadm		\
606	kbd		\
607	krb5		\
608	ksh		\
609	kstat		\
610	last		\
611	ldap		\
612	ldapcachemgr	\
613	lgrpinfo	\
614	locale		\
615	lofiadm		\
616	logadm		\
617	logger		\
618	logins		\
619	ls		\
620	luxadm		\
621	lvm		\
622	mailx		\
623	mesg		\
624	mkdir		\
625	mkpwdict	\
626	mktemp		\
627	more		\
628	mpathadm	\
629	msgfmt		\
630	mv		\
631	ndmpadm		\
632	ndmpstat	\
633	newgrp		\
634	newtask		\
635	nice		\
636	nohup		\
637	oawk		\
638	pack		\
639	passwd		\
640	passmgmt	\
641	pathchk		\
642	pfexec		\
643	pg		\
644	pgrep		\
645	picl            \
646	pools		\
647	power		\
648	pr		\
649	praudit		\
650	print		\
651	profiles	\
652	projadd		\
653	projects	\
654	prstat		\
655	prtdiag		\
656	ps		\
657	psrinfo		\
658	ptools		\
659	pwconv		\
660	pwd		\
661	pyzfs		\
662	raidctl		\
663	ramdiskadm	\
664	rcap		\
665	rcm_daemon	\
666	refer		\
667	regcmp		\
668	renice		\
669	roles		\
670	rm		\
671	rmdir		\
672	rmformat	\
673	rmmount		\
674	rmvolmgr	\
675	sasinfo		\
676	sbdadm		\
677	scadm		\
678	script		\
679	scsi		\
680	sdiff		\
681	sdpadm		\
682	sgs		\
683	sh		\
684	shcomp		\
685	smbsrv		\
686	sort		\
687	split		\
688	srptadm		\
689	ssh		\
690	stat		\
691	stmfadm		\
692	stmsboot	\
693	strings		\
694	su		\
695	svc		\
696	svr4pkg		\
697	swap		\
698	syseventadm	\
699	syseventd	\
700	tabs		\
701	tar		\
702	tbl		\
703	time		\
704	tnf		\
705	touch		\
706	tput		\
707	troff		\
708	tsol		\
709	tty		\
710	ttymon		\
711	tzreload	\
712	ul		\
713	uname		\
714	units		\
715	unlink		\
716	unpack		\
717	valtools	\
718	vgrind		\
719	vi		\
720	volcheck	\
721	volrmmount	\
722	vrrpadm		\
723	vscan		\
724	w		\
725	who		\
726	whodo		\
727	wracct		\
728	write		\
729	wusbadm		\
730	xargs		\
731	yppasswd	\
732	zdump		\
733	zfs		\
734	zic		\
735	zlogin		\
736	zoneadm		\
737	zoneadmd	\
738	zonecfg		\
739	zonename	\
740	zpool
741
742$(CLOSED_BUILD)MSGSUBDIRS += \
743	$(CLOSED)/cmd/iconv	\
744	$(CLOSED)/cmd/ksh	\
745	$(CLOSED)/cmd/llc2	\
746	$(CLOSED)/cmd/localedef	\
747	$(CLOSED)/cmd/more_xpg4	\
748	$(CLOSED)/cmd/od	\
749	$(CLOSED)/cmd/patch	\
750	$(CLOSED)/cmd/pax	\
751	$(CLOSED)/cmd/printf	\
752	$(CLOSED)/cmd/sed	\
753	$(CLOSED)/cmd/sed_xpg4	\
754	$(CLOSED)/cmd/tail	\
755	$(CLOSED)/cmd/tr_xpg4
756
757sparc_MSGSUBDIRS=	\
758	fruadm		\
759	prtdscp		\
760	prtfru		\
761	virtinfo	\
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 audit and device allocation
788#
789AUDITSUBDIRS=		\
790	allocate	\
791	amt		\
792	audit		\
793	audit_warn	\
794	auditconfig	\
795	auditd		\
796	auditrecord	\
797	auditreduce	\
798	auditstat	\
799	praudit		\
800	bsmconv		\
801	bsmunconv
802
803#
804# commands not owned by the systems group
805#
806BWOSDIRS=
807
808
809all :=		TARGET = all
810install :=	TARGET = install
811clean :=	TARGET = clean
812clobber :=	TARGET = clobber
813lint :=		TARGET = lint
814_msg :=		TARGET = _msg
815_dc :=		TARGET = _dc
816
817.KEEP_STATE:
818
819SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
820
821.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
822
823all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
824	$(AUDITSUBDIRS)
825
826#
827# Manifests cannot be checked in parallel, because we are using
828# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
829# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
830# we spawn off a sub-make to perform the non-parallel 'make check'
831#
832check:
833	$(MAKE) -f Makefile.check check
834
835#
836# The .WAIT directive works around an apparent bug in parallel make.
837# Evidently make was getting the target _msg vs. _dc confused under
838# some level of parallelization, causing some of the _dc objects
839# not to be built.
840#
841_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
842
843_dc: $(DCSUBDIRS)
844
845#
846# Dependencies
847#
848fs.d: fstyp
849ksh:	shcomp isaexec
850print:	lp
851
852$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
853	@if [ -f $@/Makefile  ]; then \
854		cd $@; pwd; $(MAKE) $(TARGET); \
855	else \
856		true; \
857	fi
858
859FRC:
860