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