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