xref: /titanic_41/usr/src/lib/libc/sparc/Makefile (revision 1daa57680c1c12da0548089a11b00a9d6d077bb5)
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 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28LIBCBASE=.
29
30LIBRARY= libc.a
31LIB_PIC= libc_pic.a
32VERS=	.1
33CPP=	/usr/lib/cpp
34TARGET_ARCH=	sparc
35
36# objects are grouped by source directory
37
38# local objects
39STRETS=				\
40	stret1.o		\
41	stret2.o		\
42	stret4.o
43
44CRTOBJS=			\
45	_ftou.o			\
46	cerror.o		\
47	cerror64.o		\
48	hwmuldiv.o
49
50DYNOBJS=
51
52FPOBJS=				\
53	_D_cplx_div.o		\
54	_D_cplx_div_ix.o	\
55	_D_cplx_div_rx.o	\
56	_D_cplx_mul.o		\
57	_F_cplx_div.o		\
58	_F_cplx_div_ix.o	\
59	_F_cplx_div_rx.o	\
60	_F_cplx_mul.o		\
61	_Q_add.o		\
62	_Q_cmp.o		\
63	_Q_cmpe.o		\
64	_Q_cplx_div.o		\
65	_Q_cplx_div_ix.o	\
66	_Q_cplx_div_rx.o	\
67	_Q_cplx_lr_div.o	\
68	_Q_cplx_lr_div_ix.o	\
69	_Q_cplx_lr_div_rx.o	\
70	_Q_cplx_lr_mul.o	\
71	_Q_cplx_mul.o		\
72	_Q_div.o		\
73	_Q_dtoq.o		\
74	_Q_fcc.o		\
75	_Q_itoq.o		\
76	_Q_lltoq.o		\
77	_Q_mul.o		\
78	_Q_neg.o		\
79	_Q_qtod.o		\
80	_Q_qtoi.o		\
81	_Q_qtos.o		\
82	_Q_qtou.o		\
83	_Q_scl.o		\
84	_Q_set_except.o		\
85	_Q_sqrt.o		\
86	_Q_stoq.o		\
87	_Q_sub.o		\
88	_Q_ulltoq.o		\
89	_Q_utoq.o		\
90	__quad_mag.o
91
92FPASMOBJS=			\
93	_Q_get_rp_rd.o		\
94	fpgetmask.o		\
95	fpgetrnd.o		\
96	fpgetsticky.o		\
97	fpsetmask.o		\
98	fpsetrnd.o		\
99	fpsetsticky.o		\
100	__quad.o
101
102ATOMICOBJS=			\
103	atomic.o
104
105COMOBJS=			\
106	bcmp.o			\
107	bcopy.o			\
108	bzero.o			\
109	bsearch.o		\
110	memccpy.o		\
111	qsort.o			\
112	strtol.o		\
113	strtoul.o
114
115GENOBJS=			\
116	_getsp.o		\
117	_xregs_clrptr.o		\
118	abs.o			\
119	alloca.o		\
120	cuexit.o		\
121	ecvt.o			\
122	errlst.o		\
123	getctxt.o		\
124	ladd.o			\
125	lexp10.o		\
126	llog10.o		\
127	lmul.o			\
128	lock.o			\
129	lshiftl.o		\
130	lsign.o			\
131	lsub.o			\
132	makectxt.o		\
133	memchr.o		\
134	memcmp.o		\
135	memcpy.o		\
136	memmove.o		\
137	memset.o		\
138	new_list.o		\
139	setjmp.o		\
140	siginfolst.o		\
141	siglongjmp.o		\
142	sparc_data.o		\
143	strcasecmp.o		\
144	strchr.o		\
145	strcmp.o		\
146	strcpy.o		\
147	strlcpy.o		\
148	strlen.o		\
149	strncmp.o		\
150	strncpy.o		\
151	swapctxt.o		\
152	sync_instruction_memory.o
153
154# sysobjs that contain large-file interfaces
155COMSYSOBJS64=			\
156	creat64.o		\
157	fstat64.o		\
158	fstatvfs64.o		\
159	getdents64.o		\
160	getrlimit64.o		\
161	lseek64.o		\
162	lstat64.o		\
163	open64.o		\
164	pread64.o		\
165	pwrite64.o		\
166	setrlimit64.o		\
167	stat64.o		\
168	statvfs64.o
169
170SYSOBJS64=			\
171	mmap64.o
172
173COMSYSOBJS=			\
174	__clock_timer.o		\
175	__fcntl.o		\
176	__getloadavg.o		\
177	__rusagesys.o		\
178	__signotify.o		\
179	__sigrt.o		\
180	__time.o		\
181	_lgrp_home_fast.o	\
182	_lgrpsys.o		\
183	_nfssys.o		\
184	_portfs.o		\
185	_pset.o			\
186	_rename.o		\
187	_rpcsys.o		\
188	_sigaction.o		\
189	_so_accept.o		\
190	_so_bind.o		\
191	_so_connect.o		\
192	_so_getpeername.o	\
193	_so_getsockname.o	\
194	_so_getsockopt.o	\
195	_so_listen.o		\
196	_so_recv.o		\
197	_so_recvfrom.o		\
198	_so_recvmsg.o		\
199	_so_send.o		\
200	_so_sendmsg.o		\
201	_so_sendto.o		\
202	_so_setsockopt.o	\
203	_so_shutdown.o		\
204	_so_socket.o		\
205	_so_socketpair.o	\
206	_sockconfig.o		\
207	access.o		\
208	acct.o			\
209	acl.o			\
210	adjtime.o		\
211	alarm.o			\
212	brk.o			\
213	chdir.o			\
214	chmod.o			\
215	chown.o			\
216	chroot.o		\
217	cladm.o			\
218	close.o			\
219	creat.o			\
220	dup.o			\
221	execve.o		\
222	exit.o			\
223	facl.o			\
224	fchdir.o		\
225	fchmod.o		\
226	fchown.o		\
227	fchroot.o		\
228	fdsync.o		\
229	fpathconf.o		\
230	fstat.o			\
231	fstatfs.o		\
232	fstatvfs.o		\
233	getcpuid.o		\
234	getdents.o		\
235	getegid.o		\
236	geteuid.o		\
237	getgid.o		\
238	getgroups.o		\
239	gethrtime.o		\
240	getitimer.o		\
241	getmsg.o		\
242	getpagesizes.o		\
243	getpid.o		\
244	getpmsg.o		\
245	getppid.o		\
246	getrlimit.o		\
247	getuid.o		\
248	gtty.o			\
249	install_utrap.o		\
250	ioctl.o			\
251	kaio.o			\
252	kill.o			\
253	lchown.o		\
254	link.o			\
255	llseek.o		\
256	lseek.o			\
257	lstat.o			\
258	memcntl.o		\
259	mincore.o		\
260	mkdir.o			\
261	mknod.o			\
262	mmap.o			\
263	modctl.o		\
264	mount.o			\
265	mprotect.o		\
266	munmap.o		\
267	nice.o			\
268	ntp_adjtime.o		\
269	ntp_gettime.o		\
270	open.o			\
271	p_online.o		\
272	pathconf.o		\
273	pause.o			\
274	pcsample.o		\
275	pollsys.o		\
276	pread.o			\
277	priocntlset.o		\
278	processor_bind.o	\
279	processor_info.o	\
280	profil.o		\
281	putmsg.o		\
282	putpmsg.o		\
283	pwrite.o		\
284	read.o			\
285	readlink.o		\
286	readv.o			\
287	resolvepath.o		\
288	rmdir.o			\
289	seteguid.o		\
290	setgid.o		\
291	setgroups.o		\
292	setitimer.o		\
293	setreid.o		\
294	setrlimit.o		\
295	setuid.o		\
296	sigaltstk.o		\
297	sigprocmsk.o		\
298	sigsendset.o		\
299	sigsuspend.o		\
300	stat.o			\
301	statfs.o		\
302	statvfs.o		\
303	stty.o			\
304	symlink.o		\
305	sync.o			\
306	sysconfig.o		\
307	sysfs.o			\
308	sysinfo.o		\
309	syslwp.o		\
310	times.o			\
311	ulimit.o		\
312	umask.o			\
313	umount2.o		\
314	unlink.o		\
315	utime.o			\
316	utimes.o		\
317	utssys.o		\
318	vhangup.o		\
319	waitid.o		\
320	write.o			\
321	writev.o		\
322	yield.o
323
324SYSOBJS=			\
325	__clock_gettime.o	\
326	__getcontext.o		\
327	_lwp_mutex_unlock.o	\
328	_stack_grow.o		\
329	door.o			\
330	fork1.o			\
331	forkall.o		\
332	gettimeofday.o		\
333	pipe.o			\
334	ptrace.o		\
335	syscall.o		\
336	syssun.o		\
337	tls_get_addr.o		\
338	uadmin.o		\
339	umount.o		\
340	uname.o			\
341	vfork.o
342
343# objects under ../port which contain transitional large file interfaces
344PORTGEN64=			\
345	_xftw64.o		\
346	attropen64.o		\
347	ftw64.o			\
348	mkstemp64.o		\
349	nftw64.o		\
350	tell64.o		\
351	truncate64.o
352
353# objects from source under ../port
354PORTFP=				\
355	__flt_decim.o		\
356	__flt_rounds.o		\
357	__tbl_10_b.o		\
358	__tbl_10_h.o		\
359	__tbl_10_s.o		\
360	__tbl_2_b.o		\
361	__tbl_2_h.o		\
362	__tbl_2_s.o		\
363	__tbl_fdq.o		\
364	__tbl_tens.o		\
365	__x_power.o		\
366	_base_sup.o		\
367	aconvert.o		\
368	decimal_bin.o		\
369	double_decim.o		\
370	econvert.o		\
371	fconvert.o		\
372	file_decim.o		\
373	finite.o		\
374	fp_data.o		\
375	func_decim.o		\
376	gconvert.o		\
377	hex_bin.o		\
378	ieee_globals.o		\
379	pack_float.o		\
380	sigfpe.o		\
381	string_decim.o		\
382	ashldi3.o		\
383	ashrdi3.o		\
384	cmpdi2.o		\
385	divdi3.o		\
386	floatdidf.o		\
387	floatdisf.o		\
388	lshrdi3.o		\
389	moddi3.o		\
390	muldi3.o		\
391	qdivrem.o		\
392	ucmpdi2.o  		\
393	udivdi3.o		\
394	umoddi3.o
395
396PORTGEN=			\
397	_env_data.o		\
398	_ftoll.o		\
399	_ftoull.o		\
400	_xftw.o			\
401	a64l.o			\
402	abort.o			\
403	addsev.o		\
404	assert.o		\
405	atof.o			\
406	atoi.o			\
407	atol.o			\
408	atoll.o			\
409	attropen.o		\
410	atexit.o		\
411	atfork.o		\
412	basename.o		\
413	calloc.o		\
414	catgets.o		\
415	catopen.o		\
416	cfgetispeed.o		\
417	cfgetospeed.o		\
418	cfree.o			\
419	cfsetispeed.o		\
420	cfsetospeed.o		\
421	cftime.o		\
422	clock.o			\
423	closedir.o		\
424	closefrom.o		\
425	confstr.o		\
426	crypt.o			\
427	csetlen.o		\
428	ctime.o			\
429	ctime_r.o		\
430	directio.o		\
431	dirname.o		\
432	div.o			\
433	drand48.o		\
434	dup2.o			\
435	env_data.o		\
436	errno.o			\
437	euclen.o		\
438	event_port.o		\
439	execvp.o		\
440	fattach.o		\
441	fdetach.o		\
442	fdopendir.o		\
443	ffs.o			\
444	fmtmsg.o		\
445	ftime.o			\
446	ftok.o			\
447	ftw.o			\
448	gcvt.o			\
449	getauxv.o		\
450	getcwd.o		\
451	getdate_err.o		\
452	getdtblsize.o		\
453	getenv.o		\
454	getexecname.o		\
455	getgrnam.o		\
456	getgrnam_r.o		\
457	gethostid.o		\
458	gethostname.o		\
459	gethz.o			\
460	getisax.o		\
461	getloadavg.o		\
462	getlogin.o		\
463	getmntent.o		\
464	getnetgrent.o		\
465	getopt.o		\
466	getopt_long.o		\
467	getpagesize.o		\
468	getpw.o			\
469	getpwnam.o		\
470	getpwnam_r.o		\
471	getrusage.o		\
472	getspent.o		\
473	getspent_r.o		\
474	getsubopt.o		\
475	gettxt.o		\
476	getusershell.o		\
477	getut.o			\
478	getutx.o		\
479	getvfsent.o		\
480	getwd.o			\
481	getwidth.o		\
482	getxby_door.o		\
483	gtxt.o			\
484	hsearch.o		\
485	iconv.o			\
486	imaxabs.o		\
487	imaxdiv.o		\
488	index.o			\
489	initgroups.o		\
490	insque.o		\
491	isaexec.o		\
492	isastream.o		\
493	isatty.o		\
494	killpg.o		\
495	l64a.o			\
496	lckpwdf.o		\
497	lconstants.o		\
498	ldivide.o		\
499	lfind.o			\
500	lfmt.o			\
501	lfmt_log.o		\
502	llabs.o			\
503	lldiv.o			\
504	lltostr.o		\
505	localtime.o		\
506	lsearch.o		\
507	madvise.o		\
508	malloc.o		\
509	memalign.o		\
510	mkdev.o			\
511	mkdtemp.o		\
512	mkfifo.o		\
513	mkstemp.o		\
514	mktemp.o		\
515	mlock.o			\
516	mlockall.o		\
517	mon.o			\
518	msync.o			\
519	munlock.o		\
520	munlockall.o		\
521	ndbm.o			\
522	nftw.o			\
523	nlspath_checks.o	\
524	nsparse.o		\
525	nss_common.o		\
526	nss_dbdefs.o		\
527	nss_deffinder.o		\
528	opendir.o		\
529	opt_data.o		\
530	perror.o		\
531	pfmt.o			\
532	pfmt_data.o		\
533	pfmt_print.o		\
534	plock.o			\
535	poll.o			\
536	priocntl.o		\
537	privlib.o		\
538	priv_str_xlate.o	\
539	psiginfo.o		\
540	psignal.o		\
541	pt.o			\
542	putpwent.o		\
543	putspent.o		\
544	raise.o			\
545	rand.o			\
546	random.o		\
547	rctlops.o		\
548	readdir.o		\
549	readdir_r.o		\
550	realpath.o		\
551	reboot.o		\
552	regexpr.o		\
553	rename.o		\
554	rewinddir.o		\
555	rindex.o		\
556	scandir.o		\
557	seekdir.o		\
558	select.o		\
559	select_large_fdset.o	\
560	setlabel.o		\
561	setpriority.o		\
562	settimeofday.o		\
563	sh_locks.o		\
564	sigflag.o		\
565	siglist.o		\
566	sigsend.o		\
567	sigsetops.o		\
568	ssignal.o		\
569	stack.o			\
570	str2sig.o		\
571	strcase_charmap.o	\
572	strcat.o		\
573	strcspn.o		\
574	strdup.o		\
575	strerror.o		\
576	strncat.o		\
577	strlcat.o		\
578	strncasecmp.o		\
579	strpbrk.o		\
580	strrchr.o		\
581	strsignal.o		\
582	strspn.o		\
583	strstr.o		\
584	strtod.o		\
585	strtoimax.o		\
586	strtok.o		\
587	strtok_r.o		\
588	strtoll.o		\
589	strtoull.o		\
590	strtoumax.o		\
591	swab.o			\
592	swapctl.o		\
593	sysconf.o		\
594	syslog.o		\
595	tcdrain.o		\
596	tcflow.o		\
597	tcflush.o		\
598	tcgetattr.o		\
599	tcgetpgrp.o		\
600	tcgetsid.o		\
601	tcsendbreak.o		\
602	tcsetattr.o		\
603	tcsetpgrp.o		\
604	tell.o			\
605	telldir.o		\
606	tfind.o			\
607	time_data.o		\
608	time_gdata.o		\
609	truncate.o		\
610	tsdalloc.o		\
611	tsearch.o		\
612	ttyname.o		\
613	ttyslot.o		\
614	ualarm.o		\
615	ucred.o			\
616	valloc.o		\
617	vlfmt.o			\
618	vpfmt.o			\
619	wait3.o			\
620	wait4.o			\
621	waitpid.o		\
622	walkstack.o		\
623	wdata.o			\
624	xgetwidth.o		\
625	xpg4.o			\
626	xpg6.o
627
628PORTPRINT_W=			\
629	doprnt_w.o
630
631PORTPRINT=			\
632	doprnt.o		\
633	fprintf.o		\
634	printf.o		\
635	snprintf.o		\
636	sprintf.o		\
637	vfprintf.o		\
638	vprintf.o		\
639	vsnprintf.o		\
640	vsprintf.o		\
641	vwprintf.o		\
642	wprintf.o
643
644# c89 variants to support 32-bit size of c89 u/intmax_t (32-bit libc only)
645PORTPRINT_C89=			\
646	vfprintf_c89.o		\
647	vprintf_c89.o		\
648	vsnprintf_c89.o		\
649	vsprintf_c89.o		\
650	vwprintf_c89.o
651
652PORTSTDIO_C89=			\
653	vscanf_c89.o		\
654	vwscanf_c89.o
655
656# portable stdio objects that contain large file interfaces.
657# Note: fopen64 is a special case, as we build it small.
658PORTSTDIO64=			\
659	fopen64.o		\
660	fpos64.o
661
662PORTSTDIO_W=			\
663	doscan_w.o
664
665PORTSTDIO=			\
666	__extensions.o		\
667	_endopen.o		\
668	_filbuf.o		\
669	_findbuf.o		\
670	_flsbuf.o		\
671	_wrtchk.o		\
672	clearerr.o		\
673	ctermid.o		\
674	ctermid_r.o		\
675	cuserid.o		\
676	data.o			\
677	doscan.o		\
678	fdopen.o		\
679	feof.o			\
680	ferror.o		\
681	fgetc.o			\
682	fgets.o			\
683	fileno.o		\
684	flockf.o		\
685	flush.o			\
686	fopen.o			\
687	fpos.o			\
688	fputc.o			\
689	fputs.o			\
690	fread.o			\
691	fseek.o			\
692	fseeko.o		\
693	ftell.o			\
694	ftello.o		\
695	fwrite.o		\
696	getc.o			\
697	getchar.o		\
698	getpass.o		\
699	gets.o			\
700	getw.o			\
701	popen.o			\
702	putc.o			\
703	putchar.o		\
704	puts.o			\
705	putw.o			\
706	rewind.o		\
707	scanf.o			\
708	setbuf.o		\
709	setbuffer.o		\
710	setvbuf.o		\
711	system.o		\
712	tempnam.o		\
713	tmpfile.o		\
714	tmpnam_r.o		\
715	ungetc.o		\
716	mse.o			\
717	vscanf.o		\
718	vwscanf.o		\
719	wscanf.o
720
721PORTI18N=			\
722	__fgetwc_xpg5.o		\
723	__fgetws_xpg5.o		\
724	__fputwc_xpg5.o		\
725	__fputws_xpg5.o		\
726	__ungetwc_xpg5.o	\
727	getwchar.o		\
728	putwchar.o		\
729	putws.o			\
730	strtows.o		\
731	wcstoimax.o		\
732	wcstol.o		\
733	wcstoul.o		\
734	wcswcs.o		\
735	wscasecmp.o		\
736	wscat.o			\
737	wschr.o			\
738	wscmp.o			\
739	wscpy.o			\
740	wscspn.o		\
741	wsdup.o			\
742	wslen.o			\
743	wsncasecmp.o		\
744	wsncat.o		\
745	wsncmp.o		\
746	wsncpy.o		\
747	wspbrk.o		\
748	wsprintf.o		\
749	wsrchr.o		\
750	wsscanf.o		\
751	wsspn.o			\
752	wstod.o			\
753	wstok.o			\
754	wstol.o			\
755	wstoll.o		\
756	wsxfrm.o		\
757	wmemchr.o		\
758	wmemcmp.o		\
759	wmemcpy.o		\
760	wmemmove.o		\
761	wmemset.o		\
762	wcsstr.o		\
763	gettext.o		\
764	gettext_real.o		\
765	gettext_util.o		\
766	gettext_gnu.o		\
767	plural_parser.o		\
768	wdresolve.o		\
769	_ctype.o		\
770	isascii.o		\
771	toascii.o
772
773PORTI18N_COND=			\
774	wcstol_longlong.o	\
775	wcstoul_longlong.o
776
777AIOOBJS=			\
778	aio.o			\
779	aio_alloc.o		\
780	posix_aio.o
781
782RTOBJS=				\
783	clock_timer.o		\
784	fallocate.o		\
785	mqueue.o		\
786	pos4obj.o		\
787	sched.o			\
788	sem.o			\
789	shm.o			\
790	sigev_thread.o
791
792TPOOLOBJS=			\
793	thread_pool.o
794
795THREADSOBJS=			\
796	alloc.o			\
797	assfail.o		\
798	cancel.o		\
799	door_calls.o		\
800	pthr_attr.o		\
801	pthr_barrier.o		\
802	pthr_cond.o		\
803	pthr_mutex.o		\
804	pthr_rwlock.o		\
805	pthread.o		\
806	rtsched.o		\
807	rwlock.o		\
808	scalls.o		\
809	sema.o			\
810	sigaction.o		\
811	spawn.o			\
812	synch.o			\
813	tdb_agent.o		\
814	thr.o			\
815	thread_interface.o	\
816	tls.o			\
817	tsd.o
818
819THREADSMACHOBJS=		\
820	machdep.o
821
822THREADSASMOBJS=			\
823	asm_subr.o
824
825UNWINDMACHOBJS=			\
826	unwind.o
827
828UNWINDASMOBJS=			\
829	unwind_frame.o
830
831# objects that implement the transitional large file API
832PORTSYS64=			\
833	fstatat64.o		\
834	lockf64.o		\
835	openat64.o
836
837PORTSYS=			\
838	_autofssys.o		\
839	acctctl.o		\
840	bsd_signal.o		\
841	corectl.o		\
842	exacctsys.o		\
843	execl.o			\
844	execle.o		\
845	execv.o			\
846	fcntl.o			\
847	fsmisc.o		\
848	fstatat.o		\
849	fsync.o			\
850	getpeerucred.o		\
851	inst_sync.o		\
852	issetugid.o		\
853	label.o			\
854	libc_link.o		\
855	libc_open.o		\
856	lockf.o			\
857	lwp.o			\
858	lwp_cond.o		\
859	lwp_rwlock.o		\
860	lwp_sigmask.o		\
861	meminfosys.o		\
862	msgsys.o		\
863	nfssys.o		\
864	openat.o		\
865	pgrpsys.o		\
866	posix_sigwait.o		\
867	ppriv.o			\
868	psetsys.o		\
869	rctlsys.o		\
870	sbrk.o			\
871	semsys.o		\
872	set_errno.o		\
873	shmsys.o		\
874	siginterrupt.o		\
875	signal.o		\
876	sigpending.o		\
877	sigstack.o		\
878	tasksys.o		\
879	time.o			\
880	time_util.o		\
881	ucontext.o		\
882	ustat.o			\
883	zone.o
884
885PORTREGEX=			\
886	glob.o			\
887	regcmp.o		\
888	regex.o			\
889	wordexp.o
890
891VALUES=	values-Xa.o
892
893MOSTOBJS=			\
894	$(STRETS)		\
895	$(CRTOBJS)		\
896	$(DYNOBJS)		\
897	$(FPOBJS)		\
898	$(FPASMOBJS)		\
899	$(ATOMICOBJS)		\
900	$(COMOBJS)		\
901	$(GENOBJS)		\
902	$(PORTFP)		\
903	$(PORTGEN)		\
904	$(PORTGEN64)		\
905	$(PORTI18N)		\
906	$(PORTI18N_COND)	\
907	$(PORTPRINT)		\
908	$(PORTPRINT_C89)	\
909	$(PORTPRINT_W)		\
910	$(PORTREGEX)		\
911	$(PORTSTDIO)		\
912	$(PORTSTDIO64)		\
913	$(PORTSTDIO_C89)	\
914	$(PORTSTDIO_W)		\
915	$(PORTSYS)		\
916	$(PORTSYS64)		\
917	$(AIOOBJS)		\
918	$(RTOBJS)		\
919	$(TPOOLOBJS)		\
920	$(THREADSOBJS)		\
921	$(THREADSMACHOBJS)	\
922	$(THREADSASMOBJS)	\
923	$(UNWINDMACHOBJS)	\
924	$(UNWINDASMOBJS)	\
925	$(COMSYSOBJS)		\
926	$(SYSOBJS)		\
927	$(COMSYSOBJS64)		\
928	$(SYSOBJS64)		\
929	$(VALUES)
930
931TRACEOBJS=			\
932	plockstat.o
933
934# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
935# modules whose source is provided in the $(SRC)/lib/common directory.
936# This must be done because otherwise the Sun C compiler would insert
937# its own versions of these modules and those versions contain code
938# to call out to C++ initialization functions.  Such C++ initialization
939# functions can call back into libc before thread initialization is
940# complete and this leads to segmentation violations and other problems.
941# Since libc contains no C++ code, linking with the minimal crti.o and
942# crtn.o modules is safe and avoids the problems described above.
943OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
944CRTSRCS= ../../common/sparc
945
946# include common library definitions
947include ../../Makefile.lib
948
949# NOTE: libc_i18n.a will be part of libc.so.1.  Therefore, the compilation
950# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
951# need to be compatible with the ones for the libc stuff.  Whenever the changes
952# that affect the compilation conditions of libc happened, those for libc_i18n
953# also need to be updated.
954
955CFLAGS += $(CCVERBOSE)
956
957# This is necessary to avoid problems with calling _ex_unwind().
958# We probably don't want any inlining anyway.
959CFLAGS += -xinline=
960
961# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
962# enables ASSERT() checking in the threads portion of the library.
963# This is automatically enabled for DEBUG builds, not for non-debug builds.
964THREAD_DEBUG =
965$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
966
967CFLAGS += $(THREAD_DEBUG)
968
969ALTPICS= $(TRACEOBJS:%=pics/%)
970
971$(DYNLIB) := PICS += $(ROOTFS_LIBDIR)/libc_i18n.a
972$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS)
973
974MAPFILES =	../port/mapfile-vers mapfile-vers
975
976CFLAGS +=	$(EXTN_CFLAGS)
977CPPFLAGS=	-D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) \
978		-I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master)
979ASFLAGS=	-K pic -P -D__STDC__ -D_ASM $(CPPFLAGS) $(sparc_AS_XARCH)
980
981# Inform the run-time linker about libc specialized initialization
982RTLDINFO =	-z rtldinfo=tls_rtldinfo
983DYNFLAGS +=	$(RTLDINFO)
984
985DYNFLAGS +=	-e __rtboot
986DYNFLAGS +=	$(EXTN_DYNFLAGS)
987
988BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
989
990# Override this top level flag so the compiler builds in its native
991# C99 mode.  This has been enabled to support the complex arithmetic
992# added to libc.
993C99MODE=	$(C99_ENABLE)
994
995# libc method of building an archive
996BUILD.AR= $(RM) $@ ; \
997	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
998
999# extra files for the clean target
1000CLEANFILES=			\
1001	../port/gen/errlst.c	\
1002	../port/gen/new_list.c	\
1003	assym.h			\
1004	genassym		\
1005	crt/_rtld.s		\
1006	crt/_rtbootld.s		\
1007	pics/_rtbootld.o	\
1008	pics/crti.o		\
1009	pics/crtn.o		\
1010	$(ALTPICS)
1011
1012CLOBBERFILES +=	$(LIB_PIC)
1013
1014# list of C source for lint
1015SRCS=							\
1016	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
1017	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
1018	$(PORTFP:%.o=../port/fp/%.c)			\
1019	$(PORTGEN:%.o=../port/gen/%.c)			\
1020	$(PORTI18N:%.o=../port/i18n/%.c)		\
1021	$(PORTPRINT:%.o=../port/print/%.c)		\
1022	$(PORTREGEX:%.o=../port/regex/%.c)		\
1023	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
1024	$(PORTSYS:%.o=../port/sys/%.c)			\
1025	$(AIOOBJS:%.o=../port/aio/%.c)			\
1026	$(RTOBJS:%.o=../port/rt/%.c)			\
1027	$(TPOOLOBJS:%.o=../port/tpool/%.c)		\
1028	$(THREADSOBJS:%.o=../port/threads/%.c)		\
1029	$(THREADSMACHOBJS:%.o=../$(MACH)/threads/%.c)	\
1030	$(UNWINDMACHOBJS:%.o=../port/unwind/%.c)	\
1031	$(FPOBJS:%.o=../$(MACH)/fp/%.c)			\
1032	$(LIBCBASE)/crt/_ftou.c				\
1033	$(LIBCBASE)/gen/_xregs_clrptr.c			\
1034	$(LIBCBASE)/gen/ecvt.c				\
1035	$(LIBCBASE)/gen/getctxt.c			\
1036	$(LIBCBASE)/gen/lexp10.c			\
1037	$(LIBCBASE)/gen/llog10.c			\
1038	$(LIBCBASE)/gen/lmul.c				\
1039	$(LIBCBASE)/gen/makectxt.c			\
1040	$(LIBCBASE)/gen/siginfolst.c			\
1041	$(LIBCBASE)/gen/siglongjmp.c			\
1042	$(LIBCBASE)/gen/swapctxt.c			\
1043	$(LIBCBASE)/sys/ptrace.c
1044
1045# conditional assignments
1046$(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
1047$(DYNLIB) := CRTI = crti.o
1048$(DYNLIB) := CRTN = crtn.o
1049
1050# Files which need the threads .il inline template
1051TIL=				\
1052	aio.o			\
1053	alloc.o			\
1054	assfail.o		\
1055	atexit.o		\
1056	atfork.o		\
1057	cancel.o		\
1058	door_calls.o		\
1059	errno.o			\
1060	getctxt.o		\
1061	lwp.o			\
1062	ma.o			\
1063	machdep.o		\
1064	posix_aio.o		\
1065	pthr_attr.o		\
1066	pthr_barrier.o		\
1067	pthr_cond.o		\
1068	pthr_mutex.o		\
1069	pthr_rwlock.o		\
1070	pthread.o		\
1071	rand.o			\
1072	rtsched.o		\
1073	rwlock.o		\
1074	scalls.o		\
1075	sema.o			\
1076	sigaction.o		\
1077	sigev_thread.o		\
1078	spawn.o			\
1079	stack.o			\
1080	swapctxt.o		\
1081	synch.o			\
1082	tdb_agent.o		\
1083	thr.o			\
1084	thread_interface.o	\
1085	thread_pool.o		\
1086	tls.o			\
1087	tsd.o			\
1088	unwind.o
1089
1090$(TIL:%=pics/%) := CFLAGS += $(LIBCBASE)/threads/sparc.il
1091
1092# special kludge for inlines with 'cas':
1093pics/synch.o pics/lwp.o := sparc_CFLAGS += -_gcc=-Wa,-xarch=v8plus
1094
1095# Files in port/fp subdirectory that need base.il inline template
1096IL=				\
1097	__flt_decim.o		\
1098	decimal_bin.o
1099
1100$(IL:%=pics/%) := CFLAGS += $(LIBCBASE)/fp/base.il
1101
1102# Files in fp subdirectory which need __quad.il inline template
1103QIL=				\
1104	_Q_add.o		\
1105	_Q_cmp.o		\
1106	_Q_cmpe.o		\
1107	_Q_div.o		\
1108	_Q_dtoq.o		\
1109	_Q_fcc.o		\
1110	_Q_mul.o		\
1111	_Q_qtod.o		\
1112	_Q_qtoi.o		\
1113	_Q_qtos.o		\
1114	_Q_qtou.o		\
1115	_Q_sqrt.o		\
1116	_Q_stoq.o		\
1117	_Q_sub.o
1118
1119$(QIL:%=pics/%) := CFLAGS += ../$(MACH)/fp/__quad.il
1120pics/_Q%.o := sparc_COPTFLAG = -xO4 -dalign
1121pics/__quad%.o := sparc_COPTFLAG = -xO4 -dalign
1122
1123# large-file-aware components that should be built large
1124
1125$(COMSYSOBJS64:%=pics/%) := \
1126	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1127
1128$(SYSOBJS64:%=pics/%) := \
1129	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1130
1131$(PORTGEN64:%=pics/%) := \
1132	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1133
1134$(PORTSTDIO64:%=pics/%) := \
1135	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1136
1137$(PORTSYS64:%=pics/%) := \
1138	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1139
1140$(PORTSTDIO_W:%=pics/%) := \
1141	CPPFLAGS += -D_WIDE
1142
1143$(PORTPRINT_W:%=pics/%) := \
1144	CPPFLAGS += -D_WIDE
1145
1146# printf/scanf functions to support c89-sized intmax_t variables
1147$(PORTPRINT_C89:%=pics/%) := \
1148	CPPFLAGS += -D_C89_INTMAX32
1149
1150$(PORTSTDIO_C89:%=pics/%) := \
1151	CPPFLAGS += -D_C89_INTMAX32
1152
1153$(PORTI18N_COND:%=pics/%) := \
1154	CPPFLAGS += -D_WCS_LONGLONG
1155
1156# Files which need extra optimization
1157pics/getenv.o := sparc_COPTFLAG = -xO4
1158
1159.KEEP_STATE:
1160
1161all: $(LIBS) $(LIB_PIC)
1162
1163lint	:=	CPPFLAGS += -I../$(MACH)/fp
1164lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1165lint	:=	LINTFLAGS += -mn
1166
1167lint:
1168	@echo $(LINT.c) ... $(LDLIBS)
1169	@$(LINT.c) $(SRCS) $(LDLIBS)
1170
1171$(LINTLIB):= SRCS=../port/llib-lc
1172$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1173$(LINTLIB):= LINTFLAGS=-nvx
1174
1175# object files that depend on inline template
1176$(TIL:%=pics/%): $(LIBCBASE)/threads/sparc.il
1177$(IL:%=pics/%): $(LIBCBASE)/fp/base.il
1178$(QIL:%=pics/%): ../$(MACH)/fp/__quad.il
1179
1180# include common libc targets
1181include ../Makefile.targ
1182
1183# We need to strip out all CTF and DOF data from the static library
1184$(LIB_PIC) := DIR = pics
1185$(LIB_PIC): pics $$(PICS)
1186	$(BUILD.AR)
1187	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1188	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1189	$(AR) -ts $@ > /dev/null
1190	$(POST_PROCESS_A)
1191
1192# special cases
1193$(STRETS:%=pics/%): crt/stret.s
1194	$(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) crt/stret.s -o $@
1195	$(POST_PROCESS_O)
1196
1197crt/_rtbootld.s:	crt/_rtboot.s crt/_rtld.c
1198	$(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S -K pic \
1199	    crt/_rtld.c -o crt/_rtld.s
1200	$(CAT) crt/_rtboot.s crt/_rtld.s > $@
1201	$(RM) crt/_rtld.s
1202
1203# partially built from C source
1204pics/_rtbootld.o: crt/_rtbootld.s
1205	$(AS) $(ASFLAGS) crt/_rtbootld.s -o $@
1206	$(CTFCONVERT_O)
1207
1208ASSYMDEP_OBJS=			\
1209	_lwp_mutex_unlock.o	\
1210	_stack_grow.o		\
1211	asm_subr.o		\
1212	tls_get_addr.o		\
1213	unwind_frame.o		\
1214	vfork.o
1215
1216$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1217
1218$(ASSYMDEP_OBJS:%=pics/%): assym.h
1219
1220# assym.h build rules
1221
1222GENASSYM_C = ../$(MACH)/genassym.c
1223
1224# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1225#	live in Makefile.master
1226
1227CPPFLAGS.genassym = \
1228	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1229
1230genassym: $(GENASSYM_C)
1231	$(NATIVECC) -I$(LIBCBASE)/inc -I../inc \
1232		$(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1233
1234OFFSETS = ../$(MACH)/offsets.in
1235
1236assym.h: $(OFFSETS) genassym
1237	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1238	./genassym >>$@
1239
1240# derived C source and related explicit dependencies
1241../port/gen/errlst.c + \
1242../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk
1243	cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist
1244
1245pics/errlst.o: ../port/gen/errlst.c
1246
1247pics/new_list.o: ../port/gen/new_list.c
1248