Makefile revision 11833:3b3fe296598b
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 2010 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26include ../Makefile.master
27include ../Makefile.ksh93switch
28
29#
30#	Note that the commands 'agents', 'lp', 'perl', and 'man' are first in
31#	the list, violating alphabetical order.  This is because they are very
32#	long-running and should be given the most wall-clock time for a
33#	parallel build.
34#
35#	Commands in the FIRST_SUBDIRS list are built before starting the build
36#	of other commands.  Currently this includes only 'isaexec' and
37#	'platexec'.  This is necessary because $(ROOT)/usr/lib/isaexec or
38#	$(ROOT)/usr/lib/platexec must exist when some other commands are built
39#	because their 'make install' creates a hard link to one of them.
40#
41#	Commands are listed one per line so that TeamWare can auto-merge most
42#	changes.
43#
44
45FIRST_SUBDIRS=		\
46	isaexec		\
47	platexec
48
49COMMON_SUBDIRS=		\
50	agents		\
51	availdevs	\
52	lp		\
53	perl		\
54	man		\
55	Adm		\
56	abi		\
57	adbgen		\
58	acct		\
59	acctadm		\
60	arch		\
61	asa		\
62	ast		\
63	audio		\
64	auths		\
65	autopush	\
66	avs		\
67	awk		\
68	awk_xpg4	\
69	backup		\
70	banner		\
71	bart		\
72	basename	\
73	bc		\
74	bdiff		\
75	bfs		\
76	bnu		\
77	boot		\
78	busstat		\
79	cal		\
80	calendar	\
81	captoinfo	\
82	cat		\
83	cdrw		\
84	cfgadm		\
85	checkeq		\
86	checknr		\
87	chgrp		\
88	chmod		\
89	chown		\
90	chroot		\
91	clear		\
92	clinfo		\
93	cmd-crypto	\
94	cmd-inet	\
95	col		\
96	compress	\
97	consadm		\
98	coreadm		\
99	cpio		\
100	cpc		\
101	cron		\
102	crypt		\
103	csh		\
104	csplit		\
105	ctrun		\
106	ctstat		\
107	ctwatch		\
108	datadm		\
109	date		\
110	dc		\
111	dd		\
112	deroff		\
113	des		\
114	devfsadm	\
115	syseventd	\
116	devctl		\
117	devinfo		\
118	devmgmt		\
119	devprop		\
120	dfs.cmds	\
121	diff		\
122	diff3		\
123	diffmk		\
124	dircmp		\
125	dirname		\
126	dis		\
127	diskmgtd	\
128	dispadmin	\
129	dladm		\
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	fm		\
162	fmli		\
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	graph		\
185	grep		\
186	grep_xpg4	\
187	groups		\
188	grpck		\
189	gss		\
190	hal		\
191	halt		\
192	head		\
193	hostid		\
194	hostname	\
195	hotplug		\
196	hotplugd	\
197	hwdata		\
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	iscsi		\
212	itutools	\
213	iscsiadm	\
214	iscsid		\
215	iscsitsvc	\
216	isns		\
217	itadm		\
218	java		\
219	kbd		\
220	keyserv		\
221	killall		\
222	krb5		\
223	ksh		\
224	kstat		\
225	last		\
226	lastcomm	\
227	latencytop	\
228	ldap		\
229	ldapcachemgr	\
230	lgrpinfo	\
231	line		\
232	link		\
233	dlmgmtd		\
234	listen		\
235	loadkeys	\
236	locale		\
237	lockstat	\
238	locator		\
239	lofiadm		\
240	logadm		\
241	logger		\
242	login		\
243	logins		\
244	look		\
245	ls		\
246	luxadm		\
247	lvm		\
248	mach		\
249	machid		\
250	mail		\
251	mailx		\
252	makekey		\
253	mdb		\
254	mesg		\
255	mkdir		\
256	mkfifo		\
257	mkfile		\
258	mkmsgs		\
259	mknod		\
260	mkpwdict	\
261	mktemp		\
262	mms		\
263	modload		\
264	more		\
265	mpathadm	\
266	msgfmt		\
267	msgid		\
268	mt		\
269	mv		\
270	mvdir		\
271	ndmpadm		\
272	ndmpd		\
273	ndmpstat	\
274	netadm		\
275	netfiles	\
276	newform		\
277	newgrp		\
278	news		\
279	newtask		\
280	nice		\
281	nl		\
282	nlsadmin	\
283	nohup		\
284	nsadmin		\
285	nscd		\
286	oamuser		\
287	oawk		\
288	pack		\
289	pagesize	\
290	passmgmt	\
291	passwd		\
292	pathchk		\
293	pbind		\
294	pcidr		\
295	pcitool		\
296	pfexec		\
297	pgrep		\
298	picl		\
299	plimit		\
300	policykit	\
301	pools		\
302	power		\
303	powertop	\
304	ppgsz		\
305	pg		\
306	plockstat	\
307	pr		\
308	prctl		\
309	print		\
310	priocntl	\
311	profiles	\
312	projadd		\
313	projects	\
314	prstat		\
315	prtconf		\
316	prtdiag		\
317	prtvtoc		\
318	ps		\
319	psradm		\
320	psrinfo		\
321	psrset		\
322	ptools		\
323	pwck		\
324	pwconv		\
325	pwd		\
326	pyzfs		\
327	raidctl		\
328	ramdiskadm	\
329	rcap		\
330	rcm_daemon	\
331	rctladm		\
332	refer		\
333	regcmp		\
334	renice		\
335	rexd		\
336	rm		\
337	rmdir		\
338	rmformat	\
339	rmmount		\
340	rmt		\
341	rmvolmgr	\
342	roles		\
343	rpcbind		\
344	rpcgen		\
345	rpcinfo		\
346	rpcsvc		\
347	runat		\
348	sa		\
349	saf		\
350	sasinfo		\
351	savecore	\
352	sbdadm		\
353	script		\
354	scsi		\
355	sdiff		\
356	sdpadm		\
357	sendmail	\
358	setfacl		\
359	setmnt		\
360	setpgrp		\
361	setuname	\
362	sgs		\
363	sh		\
364	shcomp		\
365	smbios		\
366	smbsrv		\
367	smserverd	\
368	soelim		\
369	sort		\
370	spell		\
371	spline		\
372	split		\
373	sqlite		\
374	srchtxt		\
375	srptsvc		\
376	ssh		\
377	stat		\
378	stmfadm		\
379	stmfproxy	\
380	stmfsvc		\
381	stmsboot	\
382	streams		\
383	strings		\
384	su		\
385	sulogin		\
386	sunpc		\
387	svc		\
388	svr4pkg		\
389	swap		\
390	sync		\
391	sysdef		\
392	syseventadm	\
393	syslogd		\
394	tabs		\
395	tar		\
396	tbl		\
397	tcopy		\
398	tcpd		\
399	terminfo	\
400	th_tools	\
401	tic		\
402	time		\
403	tip		\
404	tnf		\
405	touch		\
406	tplot		\
407	tput		\
408	trapstat	\
409	troff		\
410	true		\
411	truss		\
412	tsol		\
413	tty		\
414	ttymon		\
415	tzreload	\
416	uadmin		\
417	ul		\
418	uname		\
419	units		\
420	unlink		\
421	unpack		\
422	users		\
423	utmp_update	\
424	utmpd		\
425	valtools	\
426	vgrind		\
427	vi		\
428	volcheck	\
429	volrmmount	\
430	vrrpadm		\
431	vscan		\
432	vt		\
433	w		\
434	wall		\
435	wbem		\
436	which		\
437	who		\
438	whodo		\
439	wracct		\
440	write		\
441	wusbadm		\
442	xargs		\
443	xstr		\
444	yes		\
445	ypcmd		\
446	yppasswd	\
447	zdb		\
448	zdump		\
449	zfs		\
450	zic		\
451	zinject		\
452	zlogin		\
453	zoneadm		\
454	zoneadmd	\
455	zonecfg		\
456	zonename	\
457	zpool		\
458	zlook		\
459	zstreamdump	\
460	ztest
461
462$(CLOSED_BUILD)COMMON_SUBDIRS += \
463	$(CLOSED)/cmd/iconv	\
464	$(CLOSED)/cmd/ksh	\
465	$(CLOSED)/cmd/llc2	\
466	$(CLOSED)/cmd/localedef	\
467	$(CLOSED)/cmd/more_xpg4	\
468	$(CLOSED)/cmd/mtst	\
469	$(CLOSED)/cmd/od	\
470	$(CLOSED)/cmd/patch	\
471	$(CLOSED)/cmd/pax	\
472	$(CLOSED)/cmd/printf	\
473	$(CLOSED)/cmd/sed	\
474	$(CLOSED)/cmd/sed_xpg4	\
475ODE	$(CLOSED)/cmd/tail	\
476	$(CLOSED)/cmd/tr_xpg4
477
478i386_SUBDIRS=		\
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	auditd		\
520	auditrecord	\
521	auths		\
522	autopush	\
523	avs		\
524	awk		\
525	awk_xpg4	\
526	backup		\
527	banner		\
528	bart		\
529	basename	\
530	bnu		\
531	bsmconv		\
532	bsmunconv	\
533	busstat		\
534	cal		\
535	cat		\
536	cdrw		\
537	cfgadm		\
538	checkeq		\
539	checknr		\
540	chgrp		\
541	chmod		\
542	chown		\
543	cmd-crypto	\
544	cmd-inet	\
545	col		\
546	compress	\
547	consadm		\
548	coreadm		\
549	cpio		\
550	cpc		\
551	cron		\
552	csh		\
553	csplit		\
554	ctrun		\
555	ctstat		\
556	ctwatch		\
557	datadm		\
558	date		\
559	dc		\
560	dcs		\
561	dd		\
562	deroff		\
563	devfsadm	\
564	dfs.cmds	\
565	diff		\
566	diffmk		\
567	dladm		\
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	fm		\
583	fold		\
584	fs.d		\
585	fwflash		\
586	geniconvtbl	\
587	genmsg		\
588	getconf		\
589	getent		\
590	gettext		\
591	gettxt		\
592	grep		\
593	grep_xpg4	\
594	grpck		\
595	gss		\
596	halt		\
597	head		\
598	hostname	\
599	hotplug		\
600	id		\
601	idmap		\
602	isaexec		\
603	iscsi		\
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	ssh		\
691	stat		\
692	stmfadm		\
693	stmsboot	\
694	strings		\
695	su		\
696	svc		\
697	svr4pkg		\
698	swap		\
699	syseventadm	\
700	syseventd	\
701	tabs		\
702	tar		\
703	tbl		\
704	time		\
705	tnf		\
706	touch		\
707	tput		\
708	troff		\
709	tsol		\
710	tty		\
711	ttymon		\
712	tzreload	\
713	ul		\
714	uname		\
715	units		\
716	unlink		\
717	unpack		\
718	valtools	\
719	vgrind		\
720	vi		\
721	volcheck	\
722	volrmmount	\
723	vrrpadm		\
724	vscan		\
725	w		\
726	wbem		\
727	who		\
728	whodo		\
729	wracct		\
730	write		\
731	wusbadm		\
732	xargs		\
733	yppasswd	\
734	zdump		\
735	zfs		\
736	zic		\
737	zlogin		\
738	zoneadm		\
739	zoneadmd	\
740	zonecfg		\
741	zonename	\
742	zpool
743
744$(CLOSED_BUILD)MSGSUBDIRS += \
745	$(CLOSED)/cmd/iconv	\
746	$(CLOSED)/cmd/ksh	\
747	$(CLOSED)/cmd/llc2	\
748	$(CLOSED)/cmd/localedef	\
749	$(CLOSED)/cmd/more_xpg4	\
750	$(CLOSED)/cmd/od	\
751	$(CLOSED)/cmd/patch	\
752	$(CLOSED)/cmd/pax	\
753	$(CLOSED)/cmd/printf	\
754	$(CLOSED)/cmd/sed	\
755	$(CLOSED)/cmd/sed_xpg4	\
756	$(CLOSED)/cmd/tail	\
757	$(CLOSED)/cmd/tr_xpg4
758
759sparc_MSGSUBDIRS=	\
760	fruadm		\
761	prtdscp		\
762	prtfru		\
763	virtinfo	\
764	vntsd
765
766i386_MSGSUBDIRS=	\
767	ucodeadm
768
769#
770# commands that use dcgettext for localized time, LC_TIME
771#
772DCSUBDIRS=		\
773	cal		\
774	cfgadm		\
775	diff		\
776	ls		\
777	pr		\
778	ps		\
779	tar		\
780	w		\
781	who		\
782	whodo		\
783	write
784
785$(CLOSED_BUILD)DCSUBDIRS += \
786	$(CLOSED)/cmd/pax
787
788#
789# commands that belong only to audit and device allocation
790#
791AUDITSUBDIRS=		\
792	allocate	\
793	amt		\
794	audit		\
795	audit_warn	\
796	auditconfig	\
797	auditd		\
798	auditrecord	\
799	auditreduce	\
800	auditstat	\
801	praudit		\
802	bsmconv		\
803	bsmunconv
804
805#
806# commands not owned by the systems group
807#
808BWOSDIRS=
809
810
811all :=		TARGET = all
812install :=	TARGET = install
813clean :=	TARGET = clean
814clobber :=	TARGET = clobber
815lint :=		TARGET = lint
816_msg :=		TARGET = _msg
817_dc :=		TARGET = _dc
818
819.KEEP_STATE:
820
821SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
822
823.PARALLEL:	$(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
824
825all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
826	$(AUDITSUBDIRS)
827
828#
829# Manifests cannot be checked in parallel, because we are using
830# the global repository that is in $(SRC)/cmd/svc/seed/global.db.
831# For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
832# we spawn off a sub-make to perform the non-parallel 'make check'
833#
834check:
835	$(MAKE) -f Makefile.check check
836
837#
838# The .WAIT directive works around an apparent bug in parallel make.
839# Evidently make was getting the target _msg vs. _dc confused under
840# some level of parallelization, causing some of the _dc objects
841# not to be built.
842#
843_msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
844
845_dc: $(DCSUBDIRS)
846
847#
848# Dependencies
849#
850fs.d: fstyp
851ksh:	shcomp isaexec
852print:	lp
853
854$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
855	@if [ -f $@/Makefile  ]; then \
856		cd $@; pwd; $(MAKE) $(TARGET); \
857	else \
858		true; \
859	fi
860
861FRC:
862