xref: /titanic_51/usr/src/lib/libc/sparc/Makefile (revision 7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fe)
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 2005 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
104$(__GNUC)FPASMOBJS +=		\
105	__quad.o
106
107ATOMICOBJS=			\
108	atomic.o
109
110COMOBJS=			\
111	bcmp.o			\
112	bcopy.o			\
113	bzero.o			\
114	bsearch.o		\
115	memccpy.o		\
116	qsort.o			\
117	strtol.o		\
118	strtoul.o
119
120GENOBJS=			\
121	_getsp.o		\
122	_xregs_clrptr.o		\
123	abs.o			\
124	alloca.o		\
125	cuexit.o		\
126	ecvt.o			\
127	errlst.o		\
128	getctxt.o		\
129	ladd.o			\
130	lexp10.o		\
131	llog10.o		\
132	lmul.o			\
133	lock.o			\
134	lshiftl.o		\
135	lsign.o			\
136	lsub.o			\
137	makectxt.o		\
138	memchr.o		\
139	memcmp.o		\
140	memcpy.o		\
141	memmove.o		\
142	memset.o		\
143	new_list.o		\
144	setjmp.o		\
145	siginfolst.o		\
146	siglongjmp.o		\
147	sparc_data.o		\
148	strcasecmp.o		\
149	strchr.o		\
150	strcmp.o		\
151	strcpy.o		\
152	strlcpy.o		\
153	strlen.o		\
154	strncmp.o		\
155	strncpy.o		\
156	swapctxt.o		\
157	sync_instruction_memory.o
158
159# sysobjs that contain large-file interfaces
160COMSYSOBJS64=			\
161	creat64.o		\
162	fstat64.o		\
163	fstatvfs64.o		\
164	getdents64.o		\
165	getrlimit64.o		\
166	lseek64.o		\
167	lstat64.o		\
168	open64.o		\
169	pread64.o		\
170	pwrite64.o		\
171	setrlimit64.o		\
172	stat64.o		\
173	statvfs64.o
174
175SYSOBJS64=			\
176	mmap64.o
177
178COMSYSOBJS=			\
179	__clock_timer.o		\
180	__fcntl.o		\
181	__getloadavg.o		\
182	__rusagesys.o		\
183	__signotify.o		\
184	__sigrt.o		\
185	__time.o		\
186	_lgrp_home_fast.o	\
187	_lgrpsys.o		\
188	_nfssys.o		\
189	_portfs.o		\
190	_pset.o			\
191	_rename.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	fdsync.o		\
234	fpathconf.o		\
235	fstat.o			\
236	fstatfs.o		\
237	fstatvfs.o		\
238	getcpuid.o		\
239	getdents.o		\
240	getegid.o		\
241	geteuid.o		\
242	getgid.o		\
243	getgroups.o		\
244	gethrtime.o		\
245	getitimer.o		\
246	getmsg.o		\
247	getpagesizes.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	modctl.o		\
269	mount.o			\
270	mprotect.o		\
271	munmap.o		\
272	nice.o			\
273	ntp_adjtime.o		\
274	ntp_gettime.o		\
275	open.o			\
276	p_online.o		\
277	pathconf.o		\
278	pause.o			\
279	pcsample.o		\
280	pollsys.o		\
281	pread.o			\
282	priocntlset.o		\
283	processor_bind.o	\
284	processor_info.o	\
285	profil.o		\
286	putmsg.o		\
287	putpmsg.o		\
288	pwrite.o		\
289	read.o			\
290	readlink.o		\
291	readv.o			\
292	resolvepath.o		\
293	rmdir.o			\
294	seteguid.o		\
295	setgid.o		\
296	setgroups.o		\
297	setitimer.o		\
298	setreid.o		\
299	setrlimit.o		\
300	setuid.o		\
301	sigaltstk.o		\
302	sigprocmsk.o		\
303	sigsendset.o		\
304	sigsuspend.o		\
305	stat.o			\
306	statfs.o		\
307	statvfs.o		\
308	stty.o			\
309	symlink.o		\
310	sync.o			\
311	sysconfig.o		\
312	sysfs.o			\
313	sysinfo.o		\
314	syslwp.o		\
315	times.o			\
316	ulimit.o		\
317	umask.o			\
318	umount2.o		\
319	unlink.o		\
320	utime.o			\
321	utimes.o		\
322	utssys.o		\
323	vhangup.o		\
324	waitid.o		\
325	write.o			\
326	writev.o		\
327	yield.o
328
329SYSOBJS=			\
330	__clock_gettime.o	\
331	__getcontext.o		\
332	_lwp_mutex_unlock.o	\
333	_stack_grow.o		\
334	door.o			\
335	fork1.o			\
336	forkall.o		\
337	gettimeofday.o		\
338	pipe.o			\
339	ptrace.o		\
340	syscall.o		\
341	syssun.o		\
342	tls_get_addr.o		\
343	uadmin.o		\
344	umount.o		\
345	uname.o			\
346	vfork.o
347
348# objects under ../port which contain transitional large file interfaces
349PORTGEN64=			\
350	_xftw64.o		\
351	attropen64.o		\
352	ftw64.o			\
353	mkstemp64.o		\
354	nftw64.o		\
355	tell64.o		\
356	truncate64.o
357
358# objects from source under ../port
359PORTFP=				\
360	__flt_decim.o		\
361	__flt_rounds.o		\
362	__tbl_10_b.o		\
363	__tbl_10_h.o		\
364	__tbl_10_s.o		\
365	__tbl_2_b.o		\
366	__tbl_2_h.o		\
367	__tbl_2_s.o		\
368	__tbl_fdq.o		\
369	__tbl_tens.o		\
370	__x_power.o		\
371	_base_sup.o		\
372	aconvert.o		\
373	decimal_bin.o		\
374	double_decim.o		\
375	econvert.o		\
376	fconvert.o		\
377	file_decim.o		\
378	finite.o		\
379	fp_data.o		\
380	func_decim.o		\
381	gconvert.o		\
382	hex_bin.o		\
383	ieee_globals.o		\
384	pack_float.o		\
385	sigfpe.o		\
386	string_decim.o		\
387	ashldi3.o		\
388	ashrdi3.o		\
389	cmpdi2.o		\
390	divdi3.o		\
391	floatdidf.o		\
392	floatdisf.o		\
393	lshrdi3.o		\
394	moddi3.o		\
395	muldi3.o		\
396	qdivrem.o		\
397	ucmpdi2.o  		\
398	udivdi3.o		\
399	umoddi3.o
400
401PORTGEN=			\
402	_env_data.o		\
403	_ftoll.o		\
404	_ftoull.o		\
405	_xftw.o			\
406	a64l.o			\
407	abort.o			\
408	addsev.o		\
409	assert.o		\
410	atof.o			\
411	atoi.o			\
412	atol.o			\
413	atoll.o			\
414	attropen.o		\
415	atexit.o		\
416	atfork.o		\
417	basename.o		\
418	calloc.o		\
419	catgets.o		\
420	catopen.o		\
421	cfgetispeed.o		\
422	cfgetospeed.o		\
423	cfree.o			\
424	cfsetispeed.o		\
425	cfsetospeed.o		\
426	cftime.o		\
427	clock.o			\
428	closedir.o		\
429	closefrom.o		\
430	confstr.o		\
431	crypt.o			\
432	csetlen.o		\
433	ctime.o			\
434	ctime_r.o		\
435	directio.o		\
436	dirname.o		\
437	div.o			\
438	drand48.o		\
439	dup2.o			\
440	env_data.o		\
441	errno.o			\
442	euclen.o		\
443	event_port.o		\
444	execvp.o		\
445	fattach.o		\
446	fdetach.o		\
447	fdopendir.o		\
448	ffs.o			\
449	fmtmsg.o		\
450	ftime.o			\
451	ftok.o			\
452	ftw.o			\
453	gcvt.o			\
454	getauxv.o		\
455	getcwd.o		\
456	getdate_err.o		\
457	getdtblsize.o		\
458	getenv.o		\
459	getexecname.o		\
460	getgrnam.o		\
461	getgrnam_r.o		\
462	gethostid.o		\
463	gethostname.o		\
464	gethz.o			\
465	getisax.o		\
466	getloadavg.o		\
467	getlogin.o		\
468	getmntent.o		\
469	getnetgrent.o		\
470	getopt.o		\
471	getopt_long.o		\
472	getpagesize.o		\
473	getpw.o			\
474	getpwnam.o		\
475	getpwnam_r.o		\
476	getrusage.o		\
477	getspent.o		\
478	getspent_r.o		\
479	getsubopt.o		\
480	gettxt.o		\
481	getusershell.o		\
482	getut.o			\
483	getutx.o		\
484	getvfsent.o		\
485	getwd.o			\
486	getwidth.o		\
487	getxby_door.o		\
488	gtxt.o			\
489	hsearch.o		\
490	iconv.o			\
491	imaxabs.o		\
492	imaxdiv.o		\
493	index.o			\
494	initgroups.o		\
495	insque.o		\
496	isaexec.o		\
497	isastream.o		\
498	isatty.o		\
499	killpg.o		\
500	l64a.o			\
501	lckpwdf.o		\
502	lconstants.o		\
503	ldivide.o		\
504	lfind.o			\
505	lfmt.o			\
506	lfmt_log.o		\
507	llabs.o			\
508	lldiv.o			\
509	lltostr.o		\
510	localtime.o		\
511	lsearch.o		\
512	madvise.o		\
513	malloc.o		\
514	memalign.o		\
515	mkdev.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	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
876MOSTOBJS=			\
877	$(STRETS)		\
878	$(CRTOBJS)		\
879	$(DYNOBJS)		\
880	$(FPOBJS)		\
881	$(FPASMOBJS)		\
882	$(ATOMICOBJS)		\
883	$(COMOBJS)		\
884	$(GENOBJS)		\
885	$(PORTFP)		\
886	$(PORTGEN)		\
887	$(PORTGEN64)		\
888	$(PORTI18N)		\
889	$(PORTI18N_COND)	\
890	$(PORTPRINT)		\
891	$(PORTPRINT_C89)	\
892	$(PORTPRINT_W)		\
893	$(PORTREGEX)		\
894	$(PORTSTDIO)		\
895	$(PORTSTDIO64)		\
896	$(PORTSTDIO_C89)	\
897	$(PORTSTDIO_W)		\
898	$(PORTSYS)		\
899	$(PORTSYS64)		\
900	$(THREADSOBJS)		\
901	$(THREADSMACHOBJS)	\
902	$(THREADSASMOBJS)	\
903	$(UNWINDMACHOBJS)	\
904	$(UNWINDASMOBJS)	\
905	$(COMSYSOBJS)		\
906	$(SYSOBJS)		\
907	$(COMSYSOBJS64)		\
908	$(SYSOBJS64)
909
910TRACEOBJS=			\
911	plockstat.o
912
913# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
914# modules whose source is provided in the $(SRC)/lib/common directory.
915# This must be done because otherwise the Sun C compiler would insert
916# its own versions of these modules and those versions contain code
917# to call out to C++ initialization functions.  Such C++ initialization
918# functions can call back into libc before thread initialization is
919# complete and this leads to segmentation violations and other problems.
920# Since libc contains no C++ code, linking with the minimal crti.o and
921# crtn.o modules is safe and avoids the problems described above.
922OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
923CRTSRCS= ../../common/sparc
924
925# include common library definitions
926include ../../Makefile.lib
927
928# NOTE: libc_i18n.a will be part of libc.so.1.  Therefore, the compilation
929# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
930# need to be compatible with the ones for the libc stuff.  Whenever the changes
931# that affect the compilation conditions of libc happened, those for libc_i18n
932# also need to be updated.
933
934CFLAGS += $(CCVERBOSE)
935
936# This is necessary to avoid problems with calling _ex_unwind().
937# We probably don't want any inlining anyway.
938CFLAGS += -xinline=
939
940# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
941# enables ASSERT() checking in the threads portion of the library.
942# This is automatically enabled for DEBUG builds, not for non-debug builds.
943THREAD_DEBUG =
944$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
945
946CFLAGS += $(THREAD_DEBUG)
947
948ALTPICS= $(TRACEOBJS:%=pics/%)
949
950$(DYNLIB) := PICS += $(ROOTFS_LIBDIR)/libc_i18n.a
951$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS)
952
953MAPDIR=		../spec/sparc
954MAPFILE=	$(MAPDIR)/mapfile
955
956CFLAGS +=	$(EXTN_CFLAGS)
957CPPFLAGS=	-D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) \
958		-I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master)
959ASFLAGS=	-K pic -P -D__STDC__ -D_ASM $(CPPFLAGS) -xarch=v8plus
960
961# Inform the run-time linker about libc specialized initialization
962RTLDINFO =	-z rtldinfo=tls_rtldinfo
963
964DYNFLAGS +=	-e __rtboot -M $(MAPFILE) $(RTLDINFO)
965DYNFLAGS +=	$(EXTN_DYNFLAGS)
966
967BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
968
969# Override this top level flag so the compiler builds in its native
970# C99 mode.  This has been enabled to support the complex arithmetic
971# added to libc.
972C99MODE=	$(C99_ENABLE)
973
974# libc method of building an archive
975BUILD.AR= $(RM) $@ ; \
976	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
977
978# extra files for the clean target
979CLEANFILES=			\
980	../port/gen/errlst.c	\
981	../port/gen/new_list.c	\
982	assym.h			\
983	genassym		\
984	crt/_rtld.s		\
985	crt/_rtbootld.s		\
986	pics/_rtbootld.o	\
987	pics/crti.o		\
988	pics/crtn.o		\
989	pics/values-Xa.o	\
990	$(ALTPICS)
991
992CLOBBERFILES +=	$(MAPFILE) $(LIB_PIC)
993
994# list of C source for lint
995SRCS=							\
996	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
997	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
998	$(PORTFP:%.o=../port/fp/%.c)			\
999	$(PORTGEN:%.o=../port/gen/%.c)			\
1000	$(PORTI18N:%.o=../port/i18n/%.c)		\
1001	$(PORTPRINT:%.o=../port/print/%.c)		\
1002	$(PORTREGEX:%.o=../port/regex/%.c)		\
1003	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
1004	$(PORTSYS:%.o=../port/sys/%.c)			\
1005	$(THREADSOBJS:%.o=../port/threads/%.c)		\
1006	$(THREADSMACHOBJS:%.o=../$(MACH)/threads/%.c)	\
1007	$(UNWINDMACHOBJS:%.o=../port/unwind/%.c)	\
1008	$(FPOBJS:%.o=../$(MACH)/fp/%.c)			\
1009	$(LIBCBASE)/crt/_ftou.c				\
1010	$(LIBCBASE)/gen/_xregs_clrptr.c			\
1011	$(LIBCBASE)/gen/ecvt.c				\
1012	$(LIBCBASE)/gen/getctxt.c			\
1013	$(LIBCBASE)/gen/lexp10.c			\
1014	$(LIBCBASE)/gen/llog10.c			\
1015	$(LIBCBASE)/gen/lmul.c				\
1016	$(LIBCBASE)/gen/makectxt.c			\
1017	$(LIBCBASE)/gen/siginfolst.c			\
1018	$(LIBCBASE)/gen/siglongjmp.c			\
1019	$(LIBCBASE)/gen/swapctxt.c			\
1020	$(LIBCBASE)/sys/ptrace.c
1021
1022# conditional assignments
1023$(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
1024$(DYNLIB) := CRTI = crti.o values-Xa.o
1025$(DYNLIB) := CRTN = crtn.o
1026
1027$(DYNLIB):	$(MAPFILE)
1028
1029$(MAPFILE):
1030	@cd $(MAPDIR); $(MAKE) mapfile
1031
1032# Files which need the threads .il inline template
1033TIL=				\
1034	alloc.o			\
1035	assfail.o		\
1036	atexit.o		\
1037	atfork.o		\
1038	cancel.o		\
1039	door_calls.o		\
1040	errno.o			\
1041	getctxt.o		\
1042	lwp.o			\
1043	machdep.o		\
1044	pthr_attr.o		\
1045	pthr_barrier.o		\
1046	pthr_cond.o		\
1047	pthr_mutex.o		\
1048	pthr_rwlock.o		\
1049	pthread.o		\
1050	rand.o			\
1051	rtsched.o		\
1052	rwlock.o		\
1053	scalls.o		\
1054	sema.o			\
1055	sigaction.o		\
1056	spawn.o			\
1057	stack.o			\
1058	swapctxt.o		\
1059	synch.o			\
1060	tdb_agent.o		\
1061	thr.o			\
1062	thread_interface.o	\
1063	tls.o			\
1064	tsd.o			\
1065	unwind.o
1066
1067$(TIL:%=pics/%) := CFLAGS += $(LIBCBASE)/threads/sparc.il
1068
1069# special kludge for gcc inlines with 'cas':
1070$(__GNUC)pics/synch.o pics/lwp.o := sparc_XARCH = -xarch=v8plus
1071
1072# Files in port/fp subdirectory that need base.il inline template
1073IL=				\
1074	__flt_decim.o		\
1075	decimal_bin.o
1076
1077$(IL:%=pics/%) := CFLAGS += $(LIBCBASE)/fp/base.il
1078
1079# Files in fp subdirectory which need __quad.il inline template
1080QIL=				\
1081	_Q_add.o		\
1082	_Q_cmp.o		\
1083	_Q_cmpe.o		\
1084	_Q_div.o		\
1085	_Q_dtoq.o		\
1086	_Q_fcc.o		\
1087	_Q_mul.o		\
1088	_Q_qtod.o		\
1089	_Q_qtoi.o		\
1090	_Q_qtos.o		\
1091	_Q_qtou.o		\
1092	_Q_sqrt.o		\
1093	_Q_stoq.o		\
1094	_Q_sub.o
1095
1096$(QIL:%=pics/%) := CFLAGS += ../$(MACH)/fp/__quad.il
1097pics/_Q%.o := sparc_COPTFLAG = -xO4 -dalign
1098pics/__quad%.o := sparc_COPTFLAG = -xO4 -dalign
1099
1100# large-file-aware components that should be built large
1101
1102$(COMSYSOBJS64:%=pics/%) := \
1103	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1104
1105$(SYSOBJS64:%=pics/%) := \
1106	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1107
1108$(PORTGEN64:%=pics/%) := \
1109	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1110
1111$(PORTSTDIO64:%=pics/%) := \
1112	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1113
1114$(PORTSYS64:%=pics/%) := \
1115	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1116
1117$(PORTSTDIO_W:%=pics/%) := \
1118	CPPFLAGS += -D_WIDE
1119
1120$(PORTPRINT_W:%=pics/%) := \
1121	CPPFLAGS += -D_WIDE
1122
1123# printf/scanf functions to support c89-sized intmax_t variables
1124$(PORTPRINT_C89:%=pics/%) := \
1125	CPPFLAGS += -D_C89_INTMAX32
1126
1127$(PORTSTDIO_C89:%=pics/%) := \
1128	CPPFLAGS += -D_C89_INTMAX32
1129
1130$(PORTI18N_COND:%=pics/%) := \
1131	CPPFLAGS += -D_WCS_LONGLONG
1132
1133# Files which need extra optimization
1134pics/getenv.o := sparc_COPTFLAG = -xO4
1135
1136.KEEP_STATE:
1137
1138all: $(LIBS) $(LIB_PIC)
1139
1140lint	:=	CPPFLAGS += -I../$(MACH)/fp
1141lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1142lint	:=	LINTFLAGS += -mn
1143
1144lint:
1145	@echo $(LINT.c) ... $(LDLIBS)
1146	@$(LINT.c) $(SRCS) $(LDLIBS)
1147
1148# these aren't listed as $(PICS), so we need to force CTF
1149pics/values-Xa.o := CFLAGS += $(CTF_FLAGS)
1150pics/values-Xa.o := CTFCONVERT_POST = $(CTFCONVERT_O)
1151
1152$(LINTLIB):= SRCS=../port/llib-lc
1153$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1154$(LINTLIB):= LINTFLAGS=-nvx
1155
1156# object files that depend on inline template
1157$(TIL:%=pics/%): $(LIBCBASE)/threads/sparc.il
1158$(IL:%=pics/%): $(LIBCBASE)/fp/base.il
1159$(QIL:%=pics/%): ../$(MACH)/fp/__quad.il
1160
1161# include common libc targets
1162include ../Makefile.targ
1163
1164# We need to strip out all CTF and DOF data from the static library
1165$(LIB_PIC) := DIR = pics
1166$(LIB_PIC): pics $$(PICS)
1167	$(BUILD.AR)
1168	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1169	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1170	$(AR) -ts $@ > /dev/null
1171	$(POST_PROCESS_A)
1172
1173# special cases
1174$(STRETS:%=pics/%): crt/stret.s
1175	$(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) crt/stret.s -o $@
1176	$(POST_PROCESS_O)
1177
1178crt/_rtbootld.s:	crt/_rtboot.s crt/_rtld.c
1179	$(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S -K pic \
1180	    crt/_rtld.c -o crt/_rtld.s
1181	$(CAT) crt/_rtboot.s crt/_rtld.s > $@
1182	$(RM) crt/_rtld.s
1183
1184# partially built from C source
1185pics/_rtbootld.o: crt/_rtbootld.s
1186	$(AS) $(ASFLAGS) crt/_rtbootld.s -o $@
1187	$(CTFCONVERT_O)
1188
1189ASSYMDEP_OBJS=			\
1190	_lwp_mutex_unlock.o	\
1191	_stack_grow.o		\
1192	asm_subr.o		\
1193	tls_get_addr.o		\
1194	unwind_frame.o		\
1195	vfork.o
1196
1197$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1198
1199$(ASSYMDEP_OBJS:%=pics/%): assym.h
1200
1201# assym.h build rules
1202
1203GENASSYM_C = ../$(MACH)/genassym.c
1204
1205# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1206#	live in Makefile.master
1207
1208CPPFLAGS.genassym = \
1209	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1210
1211genassym: $(GENASSYM_C)
1212	$(NATIVECC) -I$(LIBCBASE)/inc -I../inc \
1213		$(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1214
1215OFFSETS = ../$(MACH)/offsets.in
1216
1217assym.h: $(OFFSETS) genassym
1218	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1219	./genassym >>$@
1220
1221# derived C source and related explicit dependencies
1222../port/gen/errlst.c + \
1223../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk
1224	cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist
1225
1226pics/errlst.o: ../port/gen/errlst.c
1227
1228pics/new_list.o: ../port/gen/new_list.c
1229