xref: /illumos-gate/usr/src/cmd/Makefile (revision 588541fbf64fffe619698198cef04af1900f1f86)
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	beadm 		\
73	bfs		\
74	bnu		\
75	boot		\
76	busstat		\
77	cal		\
78	calendar	\
79	captoinfo	\
80	cat		\
81	cdrw		\
82	cfgadm		\
83	checkeq		\
84	checknr		\
85	chgrp		\
86	chmod		\
87	chown		\
88	chroot		\
89	clear		\
90	clinfo		\
91	cmd-crypto	\
92	cmd-inet	\
93	col		\
94	compress	\
95	consadm		\
96	coreadm		\
97	cpio		\
98	cpc		\
99	cron		\
100	crypt		\
101	csh		\
102	csplit		\
103	ctrun		\
104	ctstat		\
105	ctwatch		\
106	datadm		\
107	date		\
108	dc		\
109	dd		\
110	deroff		\
111	des		\
112	devfsadm	\
113	syseventd	\
114	devctl		\
115	devinfo		\
116	devmgmt		\
117	devprop		\
118	dfs.cmds	\
119	diff		\
120	diff3		\
121	diffmk		\
122	dircmp		\
123	dirname		\
124	dis		\
125	diskmgtd	\
126	dispadmin	\
127	dladm		\
128	dlstat		\
129	dmesg		\
130	dodatadm	\
131	dtrace		\
132	du		\
133	dumpadm		\
134	dumpcs		\
135	echo		\
136	ed		\
137	eeprom		\
138	egrep		\
139	eject		\
140	emul64ioctl	\
141	enhance		\
142	env		\
143	eqn		\
144	expand		\
145	expr		\
146	exstr		\
147	factor		\
148	false		\
149	fcinfo		\
150	fcoesvc		\
151	fdetach		\
152	fdformat	\
153	fdisk		\
154	filesync	\
155	fgrep		\
156	file		\
157	filebench	\
158	find		\
159	flowadm		\
160	flowstat	\
161	fm		\
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	grep		\
184	grep_xpg4	\
185	groups		\
186	grpck		\
187	gss		\
188	hal		\
189	halt		\
190	head		\
191	hostid		\
192	hostname	\
193	hotplug		\
194	hotplugd	\
195	hwdata		\
196	ibd_upgrade	\
197	id		\
198	idmap		\
199	infocmp		\
200	init		\
201	initpkg		\
202	install.d	\
203	intrd		\
204	intrstat	\
205	ipcrm		\
206	ipcs		\
207	ipf		\
208	isainfo		\
209	isalist		\
210	itutools	\
211	iscsiadm	\
212	iscsid		\
213	iscsitsvc	\
214	isns		\
215	itadm		\
216	java		\
217	kbd		\
218	keyserv		\
219	killall		\
220	krb5		\
221	ksh		\
222	kstat		\
223	last		\
224	lastcomm	\
225	latencytop	\
226	ldap		\
227	ldapcachemgr	\
228	lgrpinfo	\
229	line		\
230	link		\
231	dlmgmtd		\
232	listen		\
233	loadkeys	\
234	locale		\
235	lockstat	\
236	locator		\
237	lofiadm		\
238	logadm		\
239	logger		\
240	login		\
241	logins		\
242	look		\
243	ls		\
244	luxadm		\
245	lvm		\
246	mach		\
247	machid		\
248	mail		\
249	mailx		\
250	makekey		\
251	mdb		\
252	mesg		\
253	mkdir		\
254	mkfifo		\
255	mkfile		\
256	mkmsgs		\
257	mknod		\
258	mkpwdict	\
259	mktemp		\
260	modload		\
261	more		\
262	mpathadm	\
263	msgfmt		\
264	msgid		\
265	mt		\
266	mv		\
267	mvdir		\
268	ndmpadm		\
269	ndmpd		\
270	ndmpstat	\
271	netadm		\
272	netfiles	\
273	newform		\
274	newgrp		\
275	news		\
276	newtask		\
277	nice		\
278	nl		\
279	nlsadmin	\
280	nohup		\
281	nsadmin		\
282	nscd		\
283	oamuser		\
284	oawk		\
285	pack		\
286	pagesize	\
287	passmgmt	\
288	passwd		\
289	pathchk		\
290	pbind		\
291	pcidr		\
292	pcitool		\
293	pfexec		\
294	pfexecd		\
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	split		\
370	sqlite		\
371	srchtxt		\
372	srptadm		\
373	srptsvc		\
374	ssh		\
375	stat		\
376	stmfadm		\
377	stmfproxy	\
378	stmfsvc		\
379	stmsboot	\
380	streams		\
381	strings		\
382	su		\
383	sulogin		\
384	sunpc		\
385	svc		\
386	svr4pkg		\
387	swap		\
388	sync		\
389	sysdef		\
390	syseventadm	\
391	syslogd		\
392	tabs		\
393	tar		\
394	tbl		\
395	tcopy		\
396	tcpd		\
397	terminfo	\
398	th_tools	\
399	tic		\
400	time		\
401	tip		\
402	tnf		\
403	touch		\
404	tplot		\
405	tput		\
406	trapstat	\
407	troff		\
408	true		\
409	truss		\
410	tsol		\
411	tty		\
412	ttymon		\
413	tzreload	\
414	uadmin		\
415	ul		\
416	uname		\
417	units		\
418	unlink		\
419	unpack		\
420	userattr	\
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	\
474	$(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	auditconfig	\
520	auditd		\
521	auditrecord	\
522	auditset	\
523	auths		\
524	autopush	\
525	avs		\
526	awk		\
527	awk_xpg4	\
528	backup		\
529	banner		\
530	bart		\
531	basename	\
532	beadm 		\
533	bnu		\
534	bsmconv		\
535	bsmunconv	\
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	wbem		\
733	who		\
734	whodo		\
735	wracct		\
736	write		\
737	wusbadm		\
738	xargs		\
739	yppasswd	\
740	zdump		\
741	zfs		\
742	zic		\
743	zlogin		\
744	zoneadm		\
745	zoneadmd	\
746	zonecfg		\
747	zonename	\
748	zpool
749
750$(CLOSED_BUILD)MSGSUBDIRS += \
751	$(CLOSED)/cmd/iconv	\
752	$(CLOSED)/cmd/ksh	\
753	$(CLOSED)/cmd/llc2	\
754	$(CLOSED)/cmd/localedef	\
755	$(CLOSED)/cmd/more_xpg4	\
756	$(CLOSED)/cmd/od	\
757	$(CLOSED)/cmd/patch	\
758	$(CLOSED)/cmd/pax	\
759	$(CLOSED)/cmd/printf	\
760	$(CLOSED)/cmd/sed	\
761	$(CLOSED)/cmd/sed_xpg4	\
762	$(CLOSED)/cmd/tail	\
763	$(CLOSED)/cmd/tr_xpg4
764
765sparc_MSGSUBDIRS=	\
766	fruadm		\
767	prtdscp		\
768	prtfru		\
769	virtinfo	\
770	vntsd
771
772i386_MSGSUBDIRS=	\
773	ucodeadm
774
775#
776# commands that use dcgettext for localized time, LC_TIME
777#
778DCSUBDIRS=		\
779	cal		\
780	cfgadm		\
781	diff		\
782	ls		\
783	pr		\
784	ps		\
785	tar		\
786	w		\
787	who		\
788	whodo		\
789	write
790
791$(CLOSED_BUILD)DCSUBDIRS += \
792	$(CLOSED)/cmd/pax
793
794#
795# commands that belong only to audit and device allocation
796#
797AUDITSUBDIRS=		\
798	allocate	\
799	amt		\
800	audit		\
801	audit_warn	\
802	auditconfig	\
803	auditd		\
804	auditrecord	\
805	auditreduce	\
806	auditset	\
807	auditstat	\
808	praudit		\
809	bsmconv		\
810	bsmunconv
811
812#
813# commands not owned by the systems group
814#
815BWOSDIRS=
816
817
818all :=		TARGET = all
819install :=	TARGET = install
820clean :=	TARGET = clean
821clobber :=	TARGET = clobber
822lint :=		TARGET = lint
823_msg :=		TARGET = _msg
824_dc :=		TARGET = _dc
825
826.KEEP_STATE:
827
828SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
829
830.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
831
832all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
833	$(AUDITSUBDIRS)
834
835#
836# Manifests cannot be checked in parallel, because we are using
837# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
838# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
839# we spawn off a sub-make to perform the non-parallel 'make check'
840#
841check:
842	$(MAKE) -f Makefile.check check
843
844#
845# The .WAIT directive works around an apparent bug in parallel make.
846# Evidently make was getting the target _msg vs. _dc confused under
847# some level of parallelization, causing some of the _dc objects
848# not to be built.
849#
850_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
851
852_dc: $(DCSUBDIRS)
853
854#
855# Dependencies
856#
857fs.d: fstyp
858ksh:	shcomp isaexec
859print:	lp
860
861$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
862	@if [ -f $@/Makefile  ]; then \
863		cd $@; pwd; $(MAKE) $(TARGET); \
864	else \
865		true; \
866	fi
867
868FRC:
869