xref: /illumos-gate/usr/src/cmd/Makefile (revision e77c795bcbe51aebd7579fe13cbf2a6d56eca47f)
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	allocate	\
49	availdevs	\
50	lp		\
51	perl		\
52	man		\
53	Adm		\
54	abi		\
55	adbgen		\
56	acct		\
57	acctadm		\
58	arch		\
59	asa		\
60	ast		\
61	audio		\
62	auths		\
63	autopush	\
64	avs		\
65	awk		\
66	awk_xpg4	\
67	backup		\
68	banner		\
69	bart		\
70	basename	\
71	bc		\
72	bdiff		\
73	beadm		\
74	bfs		\
75	bnu		\
76	boot		\
77	busstat		\
78	cal		\
79	calendar	\
80	captoinfo	\
81	cat		\
82	cdrw		\
83	cfgadm		\
84	checkeq		\
85	checknr		\
86	chgrp		\
87	chmod		\
88	chown		\
89	chroot		\
90	clear		\
91	clinfo		\
92	cmd-crypto	\
93	cmd-inet	\
94	col		\
95	compress	\
96	consadm		\
97	coreadm		\
98	cpio		\
99	cpc		\
100	cron		\
101	crypt		\
102	csh		\
103	csplit		\
104	ctrun		\
105	ctstat		\
106	ctwatch		\
107	datadm		\
108	date		\
109	dc		\
110	dd		\
111	deroff		\
112	des		\
113	devfsadm	\
114	syseventd	\
115	devctl		\
116	devinfo		\
117	devmgmt		\
118	devprop		\
119	dfs.cmds	\
120	diff		\
121	diff3		\
122	diffmk		\
123	dircmp		\
124	dirname		\
125	dis		\
126	diskmgtd	\
127	dispadmin	\
128	dladm		\
129	dlstat		\
130	dmesg		\
131	dodatadm	\
132	dtrace		\
133	du		\
134	dumpadm		\
135	dumpcs		\
136	echo		\
137	ed		\
138	eeprom		\
139	egrep		\
140	eject		\
141	emul64ioctl	\
142	enhance		\
143	env		\
144	eqn		\
145	expand		\
146	expr		\
147	exstr		\
148	factor		\
149	false		\
150	fcinfo		\
151	fcoesvc		\
152	fdetach		\
153	fdformat	\
154	fdisk		\
155	filesync	\
156	fgrep		\
157	file		\
158	filebench	\
159	find		\
160	flowadm		\
161	flowstat	\
162	fm		\
163	fmt		\
164	fmthard		\
165	fmtmsg		\
166	fold		\
167	format		\
168	fs.d		\
169	fstyp		\
170	fuser		\
171	fwflash		\
172	gcore		\
173	gencat		\
174	geniconvtbl	\
175	genmsg		\
176	getconf		\
177	getdevpolicy	\
178	getent		\
179	getfacl		\
180	getmajor	\
181	getopt		\
182	gettext		\
183	gettxt		\
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	pfexecd		\
296	pginfo		\
297	pgstat		\
298	pgrep		\
299	picl		\
300	plimit		\
301	policykit	\
302	pools		\
303	power		\
304	powertop	\
305	ppgsz		\
306	pg		\
307	plockstat	\
308	pr		\
309	prctl		\
310	print		\
311	priocntl	\
312	profiles	\
313	projadd		\
314	projects	\
315	prstat		\
316	prtconf		\
317	prtdiag		\
318	prtvtoc		\
319	ps		\
320	psradm		\
321	psrinfo		\
322	psrset		\
323	ptools		\
324	pwck		\
325	pwconv		\
326	pwd		\
327	pyzfs		\
328	raidctl		\
329	ramdiskadm	\
330	rcap		\
331	rcm_daemon	\
332	rctladm		\
333	refer		\
334	regcmp		\
335	renice		\
336	rexd		\
337	rm		\
338	rmdir		\
339	rmformat	\
340	rmmount		\
341	rmt		\
342	rmvolmgr	\
343	roles		\
344	rpcbind		\
345	rpcgen		\
346	rpcinfo		\
347	rpcsvc		\
348	runat		\
349	sa		\
350	saf		\
351	sasinfo		\
352	savecore	\
353	sbdadm		\
354	script		\
355	scsi		\
356	sdiff		\
357	sdpadm		\
358	sendmail	\
359	setfacl		\
360	setmnt		\
361	setpgrp		\
362	setuname	\
363	sgs		\
364	sh		\
365	shcomp		\
366	smbios		\
367	smbsrv		\
368	smserverd	\
369	soelim		\
370	sort		\
371	spell		\
372	split		\
373	sqlite		\
374	srchtxt		\
375	srptadm		\
376	srptsvc		\
377	ssh		\
378	stat		\
379	stmfadm		\
380	stmfproxy	\
381	stmfsvc		\
382	stmsboot	\
383	streams		\
384	strings		\
385	su		\
386	sulogin		\
387	sunpc		\
388	svc		\
389	svr4pkg		\
390	swap		\
391	sync		\
392	sysdef		\
393	syseventadm	\
394	syslogd		\
395	tabs		\
396	tar		\
397	tbl		\
398	tcopy		\
399	tcpd		\
400	terminfo	\
401	th_tools	\
402	tic		\
403	time		\
404	tip		\
405	tnf		\
406	touch		\
407	tplot		\
408	tput		\
409	tr		\
410	trapstat	\
411	troff		\
412	true		\
413	truss		\
414	tsol		\
415	tty		\
416	ttymon		\
417	tzreload	\
418	uadmin		\
419	ul		\
420	uname		\
421	units		\
422	unlink		\
423	unpack		\
424	userattr	\
425	users		\
426	utmp_update	\
427	utmpd		\
428	valtools	\
429	vgrind		\
430	vi		\
431	volcheck	\
432	volrmmount	\
433	vrrpadm		\
434	vscan		\
435	vt		\
436	w		\
437	wall		\
438	which		\
439	who		\
440	whodo		\
441	wracct		\
442	write		\
443	wusbadm		\
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	zlook		\
461	zonestat	\
462	zstreamdump	\
463	ztest
464
465$(CLOSED_BUILD)COMMON_SUBDIRS += \
466	$(CLOSED)/cmd/iconv	\
467	$(CLOSED)/cmd/ksh	\
468	$(CLOSED)/cmd/localedef	\
469	$(CLOSED)/cmd/more_xpg4	\
470	$(CLOSED)/cmd/mtst	\
471	$(CLOSED)/cmd/od	\
472	$(CLOSED)/cmd/patch	\
473	$(CLOSED)/cmd/pax	\
474	$(CLOSED)/cmd/printf	\
475	$(CLOSED)/cmd/sed	\
476	$(CLOSED)/cmd/sed_xpg4	\
477	$(CLOSED)/cmd/tail
478
479i386_SUBDIRS=		\
480	acpihpd		\
481	addbadsec	\
482	biosdev		\
483	diskscan	\
484	lms		\
485	ntfsprogs	\
486	parted		\
487	rtc		\
488	ucodeadm	\
489	xvm
490
491sparc_SUBDIRS=		\
492	cvcd		\
493	dcs		\
494	device_remap	\
495	drd		\
496	fps		\
497	fruadm		\
498	ldmad		\
499	oplhpd		\
500	prtdscp		\
501	prtfru		\
502	scadm		\
503	sckmd		\
504	sf880drd	\
505	virtinfo	\
506	vntsd
507
508#
509# Commands that are messaged.  Note that 'lp' and 'man' come first
510# (see previous comment about 'lp' and 'man').
511#
512MSGSUBDIRS=		\
513	lp		\
514	man		\
515	abi		\
516	acctadm		\
517	allocate	\
518	asa		\
519	audio		\
520	audit		\
521	auditconfig	\
522	auditd		\
523	auditrecord	\
524	auditset	\
525	auths		\
526	autopush	\
527	avs		\
528	awk		\
529	awk_xpg4	\
530	backup		\
531	banner		\
532	bart		\
533	basename	\
534	beadm		\
535	bnu		\
536	busstat		\
537	cal		\
538	cat		\
539	cdrw		\
540	cfgadm		\
541	checkeq		\
542	checknr		\
543	chgrp		\
544	chmod		\
545	chown		\
546	cmd-crypto	\
547	cmd-inet	\
548	col		\
549	compress	\
550	consadm		\
551	coreadm		\
552	cpio		\
553	cpc		\
554	cron		\
555	csh		\
556	csplit		\
557	ctrun		\
558	ctstat		\
559	ctwatch		\
560	datadm		\
561	date		\
562	dc		\
563	dcs		\
564	dd		\
565	deroff		\
566	devfsadm	\
567	dfs.cmds	\
568	diff		\
569	diffmk		\
570	dladm		\
571	dlstat		\
572	du		\
573	dumpcs		\
574	ed		\
575	eject		\
576	env		\
577	eqn		\
578	expand		\
579	expr		\
580	fcinfo		\
581	fgrep		\
582	file		\
583	filesync	\
584	find		\
585	flowadm		\
586	flowstat	\
587	fm		\
588	fold		\
589	fs.d		\
590	fwflash		\
591	geniconvtbl	\
592	genmsg		\
593	getconf		\
594	getent		\
595	gettext		\
596	gettxt		\
597	grep		\
598	grep_xpg4	\
599	grpck		\
600	gss		\
601	halt		\
602	head		\
603	hostname	\
604	hotplug		\
605	id		\
606	idmap		\
607	isaexec		\
608	iscsiadm	\
609	iscsid		\
610	isns		\
611	itadm		\
612	kbd		\
613	krb5		\
614	ksh		\
615	kstat		\
616	last		\
617	ldap		\
618	ldapcachemgr	\
619	lgrpinfo	\
620	locale		\
621	lofiadm		\
622	logadm		\
623	logger		\
624	logins		\
625	ls		\
626	luxadm		\
627	lvm		\
628	mailx		\
629	mesg		\
630	mkdir		\
631	mkpwdict	\
632	mktemp		\
633	more		\
634	mpathadm	\
635	msgfmt		\
636	mv		\
637	ndmpadm		\
638	ndmpstat	\
639	newgrp		\
640	newtask		\
641	nice		\
642	nohup		\
643	oawk		\
644	pack		\
645	passwd		\
646	passmgmt	\
647	pathchk		\
648	pfexec		\
649	pg		\
650	pgrep		\
651	picl            \
652	pools		\
653	power		\
654	pr		\
655	praudit		\
656	print		\
657	profiles	\
658	projadd		\
659	projects	\
660	prstat		\
661	prtdiag		\
662	ps		\
663	psrinfo		\
664	ptools		\
665	pwconv		\
666	pwd		\
667	pyzfs		\
668	raidctl		\
669	ramdiskadm	\
670	rcap		\
671	rcm_daemon	\
672	refer		\
673	regcmp		\
674	renice		\
675	roles		\
676	rm		\
677	rmdir		\
678	rmformat	\
679	rmmount		\
680	rmvolmgr	\
681	sasinfo		\
682	sbdadm		\
683	scadm		\
684	script		\
685	scsi		\
686	sdiff		\
687	sdpadm		\
688	sgs		\
689	sh		\
690	shcomp		\
691	smbsrv		\
692	sort		\
693	split		\
694	srptadm		\
695	ssh		\
696	stat		\
697	stmfadm		\
698	stmsboot	\
699	strings		\
700	su		\
701	svc		\
702	svr4pkg		\
703	swap		\
704	syseventadm	\
705	syseventd	\
706	tabs		\
707	tar		\
708	tbl		\
709	time		\
710	tnf		\
711	touch		\
712	tput		\
713	troff		\
714	tsol		\
715	tty		\
716	ttymon		\
717	tzreload	\
718	ul		\
719	uname		\
720	units		\
721	unlink		\
722	unpack		\
723	userattr	\
724	valtools	\
725	vgrind		\
726	vi		\
727	volcheck	\
728	volrmmount	\
729	vrrpadm		\
730	vscan		\
731	w		\
732	who		\
733	whodo		\
734	wracct		\
735	write		\
736	wusbadm		\
737	xargs		\
738	yppasswd	\
739	zdump		\
740	zfs		\
741	zic		\
742	zlogin		\
743	zoneadm		\
744	zoneadmd	\
745	zonecfg		\
746	zonename	\
747	zpool		\
748	zonestat
749
750$(CLOSED_BUILD)MSGSUBDIRS += \
751	$(CLOSED)/cmd/iconv	\
752	$(CLOSED)/cmd/ksh	\
753	$(CLOSED)/cmd/localedef	\
754	$(CLOSED)/cmd/more_xpg4	\
755	$(CLOSED)/cmd/od	\
756	$(CLOSED)/cmd/patch	\
757	$(CLOSED)/cmd/pax	\
758	$(CLOSED)/cmd/printf	\
759	$(CLOSED)/cmd/sed	\
760	$(CLOSED)/cmd/sed_xpg4	\
761	$(CLOSED)/cmd/tail
762
763sparc_MSGSUBDIRS=	\
764	fruadm		\
765	prtdscp		\
766	prtfru		\
767	virtinfo	\
768	vntsd
769
770i386_MSGSUBDIRS=	\
771	ucodeadm
772
773#
774# commands that use dcgettext for localized time, LC_TIME
775#
776DCSUBDIRS=		\
777	cal		\
778	cfgadm		\
779	diff		\
780	ls		\
781	pr		\
782	ps		\
783	tar		\
784	w		\
785	who		\
786	whodo		\
787	write
788
789$(CLOSED_BUILD)DCSUBDIRS += \
790	$(CLOSED)/cmd/pax
791
792#
793# commands that belong only to audit.
794#
795AUDITSUBDIRS=		\
796	amt		\
797	audit		\
798	audit_warn	\
799	auditconfig	\
800	auditd		\
801	auditrecord	\
802	auditreduce	\
803	auditset	\
804	auditstat	\
805	praudit
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