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