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