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