xref: /illumos-gate/usr/src/cmd/Makefile (revision 410cfc1c29e3c504b79366ddfd3584e9e69a33d5)
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	mklocale	\
258	mkmsgs		\
259	mknod		\
260	mkpwdict	\
261	mktemp		\
262	modload		\
263	more		\
264	mpathadm	\
265	msgfmt		\
266	msgid		\
267	mt		\
268	mv		\
269	mvdir		\
270	ndmpadm		\
271	ndmpd		\
272	ndmpstat	\
273	netadm		\
274	netfiles	\
275	newform		\
276	newgrp		\
277	news		\
278	newtask		\
279	nice		\
280	nl		\
281	nlsadmin	\
282	nohup		\
283	nsadmin		\
284	nscd		\
285	oamuser		\
286	oawk		\
287	pack		\
288	pagesize	\
289	passmgmt	\
290	passwd		\
291	pathchk		\
292	pbind		\
293	pcidr		\
294	pcitool		\
295	pfexec		\
296	pfexecd		\
297	pginfo		\
298	pgstat		\
299	pgrep		\
300	picl		\
301	plimit		\
302	policykit	\
303	pools		\
304	power		\
305	powertop	\
306	ppgsz		\
307	pg		\
308	plockstat	\
309	pr		\
310	prctl		\
311	print		\
312	priocntl	\
313	profiles	\
314	projadd		\
315	projects	\
316	prstat		\
317	prtconf		\
318	prtdiag		\
319	prtvtoc		\
320	ps		\
321	psradm		\
322	psrinfo		\
323	psrset		\
324	ptools		\
325	pwck		\
326	pwconv		\
327	pwd		\
328	pyzfs		\
329	raidctl		\
330	ramdiskadm	\
331	rcap		\
332	rcm_daemon	\
333	rctladm		\
334	refer		\
335	regcmp		\
336	renice		\
337	rexd		\
338	rm		\
339	rmdir		\
340	rmformat	\
341	rmmount		\
342	rmt		\
343	rmvolmgr	\
344	roles		\
345	rpcbind		\
346	rpcgen		\
347	rpcinfo		\
348	rpcsvc		\
349	runat		\
350	sa		\
351	saf		\
352	sasinfo		\
353	savecore	\
354	sbdadm		\
355	script		\
356	scsi		\
357	sdiff		\
358	sdpadm		\
359	sendmail	\
360	setfacl		\
361	setmnt		\
362	setpgrp		\
363	setuname	\
364	sgs		\
365	sh		\
366	shcomp		\
367	smbios		\
368	smbsrv		\
369	smserverd	\
370	soelim		\
371	sort		\
372	spell		\
373	split		\
374	sqlite		\
375	srchtxt		\
376	srptadm		\
377	srptsvc		\
378	ssh		\
379	stat		\
380	stmfadm		\
381	stmfproxy	\
382	stmfsvc		\
383	stmsboot	\
384	streams		\
385	strings		\
386	su		\
387	sulogin		\
388	sunpc		\
389	svc		\
390	svr4pkg		\
391	swap		\
392	sync		\
393	sysdef		\
394	syseventadm	\
395	syslogd		\
396	tabs		\
397	tar		\
398	tbl		\
399	tcopy		\
400	tcpd		\
401	terminfo	\
402	th_tools	\
403	tic		\
404	time		\
405	tip		\
406	tnf		\
407	touch		\
408	tplot		\
409	tput		\
410	tr		\
411	trapstat	\
412	troff		\
413	true		\
414	truss		\
415	tsol		\
416	tty		\
417	ttymon		\
418	tzreload	\
419	uadmin		\
420	ul		\
421	uname		\
422	units		\
423	unlink		\
424	unpack		\
425	userattr	\
426	users		\
427	utmp_update	\
428	utmpd		\
429	valtools	\
430	vgrind		\
431	vi		\
432	volcheck	\
433	volrmmount	\
434	vrrpadm		\
435	vscan		\
436	vt		\
437	w		\
438	wall		\
439	which		\
440	who		\
441	whodo		\
442	wracct		\
443	write		\
444	wusbadm		\
445	xargs		\
446	xstr		\
447	yes		\
448	ypcmd		\
449	yppasswd	\
450	zdb		\
451	zdump		\
452	zfs		\
453	zic		\
454	zinject		\
455	zlogin		\
456	zoneadm		\
457	zoneadmd	\
458	zonecfg		\
459	zonename	\
460	zpool		\
461	zlook		\
462	zonestat	\
463	zstreamdump	\
464	ztest
465
466$(CLOSED_BUILD)COMMON_SUBDIRS += \
467	$(CLOSED)/cmd/iconv	\
468	$(CLOSED)/cmd/ksh	\
469	$(CLOSED)/cmd/localedef	\
470	$(CLOSED)/cmd/more_xpg4	\
471	$(CLOSED)/cmd/mtst	\
472	$(CLOSED)/cmd/od	\
473	$(CLOSED)/cmd/patch	\
474	$(CLOSED)/cmd/pax	\
475	$(CLOSED)/cmd/printf	\
476	$(CLOSED)/cmd/sed	\
477	$(CLOSED)/cmd/sed_xpg4	\
478	$(CLOSED)/cmd/tail
479
480i386_SUBDIRS=		\
481	acpihpd		\
482	addbadsec	\
483	biosdev		\
484	diskscan	\
485	lms		\
486	ntfsprogs	\
487	parted		\
488	rtc		\
489	ucodeadm	\
490	xvm
491
492sparc_SUBDIRS=		\
493	cvcd		\
494	dcs		\
495	device_remap	\
496	drd		\
497	fps		\
498	fruadm		\
499	ldmad		\
500	oplhpd		\
501	prtdscp		\
502	prtfru		\
503	scadm		\
504	sckmd		\
505	sf880drd	\
506	virtinfo	\
507	vntsd
508
509#
510# Commands that are messaged.  Note that 'lp' and 'man' come first
511# (see previous comment about 'lp' and 'man').
512#
513MSGSUBDIRS=		\
514	lp		\
515	man		\
516	abi		\
517	acctadm		\
518	allocate	\
519	asa		\
520	audio		\
521	audit		\
522	auditconfig	\
523	auditd		\
524	auditrecord	\
525	auditset	\
526	auths		\
527	autopush	\
528	avs		\
529	awk		\
530	awk_xpg4	\
531	backup		\
532	banner		\
533	bart		\
534	basename	\
535	beadm		\
536	bnu		\
537	busstat		\
538	cal		\
539	cat		\
540	cdrw		\
541	cfgadm		\
542	checkeq		\
543	checknr		\
544	chgrp		\
545	chmod		\
546	chown		\
547	cmd-crypto	\
548	cmd-inet	\
549	col		\
550	compress	\
551	consadm		\
552	coreadm		\
553	cpio		\
554	cpc		\
555	cron		\
556	csh		\
557	csplit		\
558	ctrun		\
559	ctstat		\
560	ctwatch		\
561	datadm		\
562	date		\
563	dc		\
564	dcs		\
565	dd		\
566	deroff		\
567	devfsadm	\
568	dfs.cmds	\
569	diff		\
570	diffmk		\
571	dladm		\
572	dlstat		\
573	du		\
574	dumpcs		\
575	ed		\
576	eject		\
577	env		\
578	eqn		\
579	expand		\
580	expr		\
581	fcinfo		\
582	fgrep		\
583	file		\
584	filesync	\
585	find		\
586	flowadm		\
587	flowstat	\
588	fm		\
589	fold		\
590	fs.d		\
591	fwflash		\
592	geniconvtbl	\
593	genmsg		\
594	getconf		\
595	getent		\
596	gettext		\
597	gettxt		\
598	grep		\
599	grep_xpg4	\
600	grpck		\
601	gss		\
602	halt		\
603	head		\
604	hostname	\
605	hotplug		\
606	id		\
607	idmap		\
608	isaexec		\
609	iscsiadm	\
610	iscsid		\
611	isns		\
612	itadm		\
613	kbd		\
614	krb5		\
615	ksh		\
616	kstat		\
617	last		\
618	ldap		\
619	ldapcachemgr	\
620	lgrpinfo	\
621	locale		\
622	lofiadm		\
623	logadm		\
624	logger		\
625	logins		\
626	ls		\
627	luxadm		\
628	lvm		\
629	mailx		\
630	mesg		\
631	mkdir		\
632	mkpwdict	\
633	mktemp		\
634	more		\
635	mpathadm	\
636	msgfmt		\
637	mv		\
638	ndmpadm		\
639	ndmpstat	\
640	newgrp		\
641	newtask		\
642	nice		\
643	nohup		\
644	oawk		\
645	pack		\
646	passwd		\
647	passmgmt	\
648	pathchk		\
649	pfexec		\
650	pg		\
651	pgrep		\
652	picl            \
653	pools		\
654	power		\
655	pr		\
656	praudit		\
657	print		\
658	profiles	\
659	projadd		\
660	projects	\
661	prstat		\
662	prtdiag		\
663	ps		\
664	psrinfo		\
665	ptools		\
666	pwconv		\
667	pwd		\
668	pyzfs		\
669	raidctl		\
670	ramdiskadm	\
671	rcap		\
672	rcm_daemon	\
673	refer		\
674	regcmp		\
675	renice		\
676	roles		\
677	rm		\
678	rmdir		\
679	rmformat	\
680	rmmount		\
681	rmvolmgr	\
682	sasinfo		\
683	sbdadm		\
684	scadm		\
685	script		\
686	scsi		\
687	sdiff		\
688	sdpadm		\
689	sgs		\
690	sh		\
691	shcomp		\
692	smbsrv		\
693	sort		\
694	split		\
695	srptadm		\
696	ssh		\
697	stat		\
698	stmfadm		\
699	stmsboot	\
700	strings		\
701	su		\
702	svc		\
703	svr4pkg		\
704	swap		\
705	syseventadm	\
706	syseventd	\
707	tabs		\
708	tar		\
709	tbl		\
710	time		\
711	tnf		\
712	touch		\
713	tput		\
714	troff		\
715	tsol		\
716	tty		\
717	ttymon		\
718	tzreload	\
719	ul		\
720	uname		\
721	units		\
722	unlink		\
723	unpack		\
724	userattr	\
725	valtools	\
726	vgrind		\
727	vi		\
728	volcheck	\
729	volrmmount	\
730	vrrpadm		\
731	vscan		\
732	w		\
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	zonestat
750
751$(CLOSED_BUILD)MSGSUBDIRS += \
752	$(CLOSED)/cmd/iconv	\
753	$(CLOSED)/cmd/ksh	\
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
764sparc_MSGSUBDIRS=	\
765	fruadm		\
766	prtdscp		\
767	prtfru		\
768	virtinfo	\
769	vntsd
770
771i386_MSGSUBDIRS=	\
772	ucodeadm
773
774#
775# commands that use dcgettext for localized time, LC_TIME
776#
777DCSUBDIRS=		\
778	cal		\
779	cfgadm		\
780	diff		\
781	ls		\
782	pr		\
783	ps		\
784	tar		\
785	w		\
786	who		\
787	whodo		\
788	write
789
790$(CLOSED_BUILD)DCSUBDIRS += \
791	$(CLOSED)/cmd/pax
792
793#
794# commands that belong only to audit.
795#
796AUDITSUBDIRS=		\
797	amt		\
798	audit		\
799	audit_warn	\
800	auditconfig	\
801	auditd		\
802	auditrecord	\
803	auditreduce	\
804	auditset	\
805	auditstat	\
806	praudit
807
808#
809# commands not owned by the systems group
810#
811BWOSDIRS=
812
813
814all :=		TARGET = all
815install :=	TARGET = install
816clean :=	TARGET = clean
817clobber :=	TARGET = clobber
818lint :=		TARGET = lint
819_msg :=		TARGET = _msg
820_dc :=		TARGET = _dc
821
822.KEEP_STATE:
823
824SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
825
826.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
827
828all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
829	$(AUDITSUBDIRS)
830
831#
832# Manifests cannot be checked in parallel, because we are using
833# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
834# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
835# we spawn off a sub-make to perform the non-parallel 'make check'
836#
837check:
838	$(MAKE) -f Makefile.check check
839
840#
841# The .WAIT directive works around an apparent bug in parallel make.
842# Evidently make was getting the target _msg vs. _dc confused under
843# some level of parallelization, causing some of the _dc objects
844# not to be built.
845#
846_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
847
848_dc: $(DCSUBDIRS)
849
850#
851# Dependencies
852#
853fs.d: fstyp
854ksh:	shcomp isaexec
855print:	lp
856
857$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
858	@if [ -f $@/Makefile  ]; then \
859		cd $@; pwd; $(MAKE) $(TARGET); \
860	else \
861		true; \
862	fi
863
864FRC:
865