xref: /titanic_51/usr/src/lib/libc/sparc/Makefile (revision 00d0963faf2e861a4aef6b1bf28f99a5b2b20755)
1
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21
22#
23# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28# lib/libc/sparc/Makefile
29#
30
31LIBCBASE=.
32
33LIBRARY= libc.a
34LIB_PIC= libc_pic.a
35VERS=	.1
36CPP=	/usr/lib/cpp
37TARGET_ARCH=	sparc
38
39# objects are grouped by source directory
40
41# local objects
42STRETS=				\
43	stret1.o		\
44	stret2.o		\
45	stret4.o
46
47CRTOBJS=			\
48	_ftou.o			\
49	cerror.o		\
50	cerror64.o		\
51	hwmuldiv.o
52
53DYNOBJS=
54
55FPOBJS=				\
56	_D_cplx_div.o		\
57	_D_cplx_div_ix.o	\
58	_D_cplx_div_rx.o	\
59	_D_cplx_mul.o		\
60	_F_cplx_div.o		\
61	_F_cplx_div_ix.o	\
62	_F_cplx_div_rx.o	\
63	_F_cplx_mul.o		\
64	_Q_add.o		\
65	_Q_cmp.o		\
66	_Q_cmpe.o		\
67	_Q_cplx_div.o		\
68	_Q_cplx_div_ix.o	\
69	_Q_cplx_div_rx.o	\
70	_Q_cplx_lr_div.o	\
71	_Q_cplx_lr_div_ix.o	\
72	_Q_cplx_lr_div_rx.o	\
73	_Q_cplx_lr_mul.o	\
74	_Q_cplx_mul.o		\
75	_Q_div.o		\
76	_Q_dtoq.o		\
77	_Q_fcc.o		\
78	_Q_itoq.o		\
79	_Q_lltoq.o		\
80	_Q_mul.o		\
81	_Q_neg.o		\
82	_Q_qtod.o		\
83	_Q_qtoi.o		\
84	_Q_qtos.o		\
85	_Q_qtou.o		\
86	_Q_scl.o		\
87	_Q_set_except.o		\
88	_Q_sqrt.o		\
89	_Q_stoq.o		\
90	_Q_sub.o		\
91	_Q_ulltoq.o		\
92	_Q_utoq.o		\
93	__quad_mag.o
94
95FPASMOBJS=			\
96	_Q_get_rp_rd.o		\
97	fpgetmask.o		\
98	fpgetrnd.o		\
99	fpgetsticky.o		\
100	fpsetmask.o		\
101	fpsetrnd.o		\
102	fpsetsticky.o		\
103	__quad.o
104
105ATOMICOBJS=			\
106	atomic.o
107
108COMOBJS=			\
109	bcmp.o			\
110	bcopy.o			\
111	bzero.o			\
112	bsearch.o		\
113	memccpy.o		\
114	qsort.o			\
115	strtol.o		\
116	strtoul.o
117
118GENOBJS=			\
119	_getsp.o		\
120	_xregs_clrptr.o		\
121	abs.o			\
122	alloca.o		\
123	cuexit.o		\
124	ecvt.o			\
125	errlst.o		\
126	getctxt.o		\
127	ladd.o			\
128	lexp10.o		\
129	llog10.o		\
130	lmul.o			\
131	lock.o			\
132	lshiftl.o		\
133	lsign.o			\
134	lsub.o			\
135	makectxt.o		\
136	memchr.o		\
137	memcmp.o		\
138	memcpy.o		\
139	memmove.o		\
140	memset.o		\
141	new_list.o		\
142	setjmp.o		\
143	siginfolst.o		\
144	siglongjmp.o		\
145	sparc_data.o		\
146	strcasecmp.o		\
147	strchr.o		\
148	strcmp.o		\
149	strcpy.o		\
150	strlcpy.o		\
151	strlen.o		\
152	strncmp.o		\
153	strncpy.o		\
154	swapctxt.o		\
155	sync_instruction_memory.o
156
157# sysobjs that contain large-file interfaces
158COMSYSOBJS64=			\
159	creat64.o		\
160	fstat64.o		\
161	fstatvfs64.o		\
162	getdents64.o		\
163	getrlimit64.o		\
164	lseek64.o		\
165	lstat64.o		\
166	open64.o		\
167	pread64.o		\
168	pwrite64.o		\
169	setrlimit64.o		\
170	stat64.o		\
171	statvfs64.o
172
173SYSOBJS64=			\
174	mmap64.o
175
176COMSYSOBJS=			\
177	__clock_timer.o		\
178	__fcntl.o		\
179	__getloadavg.o		\
180	__rusagesys.o		\
181	__signotify.o		\
182	__sigrt.o		\
183	__time.o		\
184	_lgrp_home_fast.o	\
185	_lgrpsys.o		\
186	_nfssys.o		\
187	_portfs.o		\
188	_pset.o			\
189	_rename.o		\
190	_rpcsys.o		\
191	_sigaction.o		\
192	_so_accept.o		\
193	_so_bind.o		\
194	_so_connect.o		\
195	_so_getpeername.o	\
196	_so_getsockname.o	\
197	_so_getsockopt.o	\
198	_so_listen.o		\
199	_so_recv.o		\
200	_so_recvfrom.o		\
201	_so_recvmsg.o		\
202	_so_send.o		\
203	_so_sendmsg.o		\
204	_so_sendto.o		\
205	_so_setsockopt.o	\
206	_so_shutdown.o		\
207	_so_socket.o		\
208	_so_socketpair.o	\
209	_sockconfig.o		\
210	access.o		\
211	acct.o			\
212	acl.o			\
213	adjtime.o		\
214	alarm.o			\
215	brk.o			\
216	chdir.o			\
217	chmod.o			\
218	chown.o			\
219	chroot.o		\
220	cladm.o			\
221	close.o			\
222	creat.o			\
223	dup.o			\
224	execve.o		\
225	exit.o			\
226	facl.o			\
227	fchdir.o		\
228	fchmod.o		\
229	fchown.o		\
230	fchroot.o		\
231	fdsync.o		\
232	fpathconf.o		\
233	fstat.o			\
234	fstatfs.o		\
235	fstatvfs.o		\
236	getcpuid.o		\
237	getdents.o		\
238	getegid.o		\
239	geteuid.o		\
240	getgid.o		\
241	getgroups.o		\
242	gethrtime.o		\
243	getitimer.o		\
244	getmsg.o		\
245	getpagesizes.o		\
246	getpid.o		\
247	getpmsg.o		\
248	getppid.o		\
249	getrlimit.o		\
250	getuid.o		\
251	gtty.o			\
252	install_utrap.o		\
253	ioctl.o			\
254	kaio.o			\
255	kill.o			\
256	lchown.o		\
257	link.o			\
258	llseek.o		\
259	lseek.o			\
260	lstat.o			\
261	memcntl.o		\
262	mincore.o		\
263	mkdir.o			\
264	mknod.o			\
265	mmap.o			\
266	modctl.o		\
267	mount.o			\
268	mprotect.o		\
269	munmap.o		\
270	nice.o			\
271	ntp_adjtime.o		\
272	ntp_gettime.o		\
273	open.o			\
274	p_online.o		\
275	pathconf.o		\
276	pause.o			\
277	pcsample.o		\
278	pollsys.o		\
279	pread.o			\
280	priocntlset.o		\
281	processor_bind.o	\
282	processor_info.o	\
283	profil.o		\
284	putmsg.o		\
285	putpmsg.o		\
286	pwrite.o		\
287	read.o			\
288	readlink.o		\
289	readv.o			\
290	resolvepath.o		\
291	rmdir.o			\
292	seteguid.o		\
293	setgid.o		\
294	setgroups.o		\
295	setitimer.o		\
296	setreid.o		\
297	setrlimit.o		\
298	setuid.o		\
299	sigaltstk.o		\
300	sigprocmsk.o		\
301	sigsendset.o		\
302	sigsuspend.o		\
303	stat.o			\
304	statfs.o		\
305	statvfs.o		\
306	stty.o			\
307	symlink.o		\
308	sync.o			\
309	sysconfig.o		\
310	sysfs.o			\
311	sysinfo.o		\
312	syslwp.o		\
313	times.o			\
314	ulimit.o		\
315	umask.o			\
316	umount2.o		\
317	unlink.o		\
318	utime.o			\
319	utimes.o		\
320	utssys.o		\
321	vhangup.o		\
322	waitid.o		\
323	write.o			\
324	writev.o		\
325	yield.o
326
327SYSOBJS=			\
328	__clock_gettime.o	\
329	__getcontext.o		\
330	_lwp_mutex_unlock.o	\
331	_stack_grow.o		\
332	door.o			\
333	fork1.o			\
334	forkall.o		\
335	gettimeofday.o		\
336	pipe.o			\
337	ptrace.o		\
338	syscall.o		\
339	syssun.o		\
340	tls_get_addr.o		\
341	uadmin.o		\
342	umount.o		\
343	uname.o			\
344	vfork.o
345
346# objects under ../port which contain transitional large file interfaces
347PORTGEN64=			\
348	_xftw64.o		\
349	attropen64.o		\
350	ftw64.o			\
351	mkstemp64.o		\
352	nftw64.o		\
353	tell64.o		\
354	truncate64.o
355
356# objects from source under ../port
357PORTFP=				\
358	__flt_decim.o		\
359	__flt_rounds.o		\
360	__tbl_10_b.o		\
361	__tbl_10_h.o		\
362	__tbl_10_s.o		\
363	__tbl_2_b.o		\
364	__tbl_2_h.o		\
365	__tbl_2_s.o		\
366	__tbl_fdq.o		\
367	__tbl_tens.o		\
368	__x_power.o		\
369	_base_sup.o		\
370	aconvert.o		\
371	decimal_bin.o		\
372	double_decim.o		\
373	econvert.o		\
374	fconvert.o		\
375	file_decim.o		\
376	finite.o		\
377	fp_data.o		\
378	func_decim.o		\
379	gconvert.o		\
380	hex_bin.o		\
381	ieee_globals.o		\
382	pack_float.o		\
383	sigfpe.o		\
384	string_decim.o		\
385	ashldi3.o		\
386	ashrdi3.o		\
387	cmpdi2.o		\
388	divdi3.o		\
389	floatdidf.o		\
390	floatdisf.o		\
391	lshrdi3.o		\
392	moddi3.o		\
393	muldi3.o		\
394	qdivrem.o		\
395	ucmpdi2.o  		\
396	udivdi3.o		\
397	umoddi3.o
398
399PORTGEN=			\
400	_env_data.o		\
401	_ftoll.o		\
402	_ftoull.o		\
403	_xftw.o			\
404	a64l.o			\
405	abort.o			\
406	addsev.o		\
407	assert.o		\
408	atof.o			\
409	atoi.o			\
410	atol.o			\
411	atoll.o			\
412	attropen.o		\
413	atexit.o		\
414	atfork.o		\
415	basename.o		\
416	calloc.o		\
417	catgets.o		\
418	catopen.o		\
419	cfgetispeed.o		\
420	cfgetospeed.o		\
421	cfree.o			\
422	cfsetispeed.o		\
423	cfsetospeed.o		\
424	cftime.o		\
425	clock.o			\
426	closedir.o		\
427	closefrom.o		\
428	confstr.o		\
429	crypt.o			\
430	csetlen.o		\
431	ctime.o			\
432	ctime_r.o		\
433	directio.o		\
434	dirname.o		\
435	div.o			\
436	drand48.o		\
437	dup2.o			\
438	env_data.o		\
439	errno.o			\
440	euclen.o		\
441	event_port.o		\
442	execvp.o		\
443	fattach.o		\
444	fdetach.o		\
445	fdopendir.o		\
446	ffs.o			\
447	fmtmsg.o		\
448	ftime.o			\
449	ftok.o			\
450	ftw.o			\
451	gcvt.o			\
452	getauxv.o		\
453	getcwd.o		\
454	getdate_err.o		\
455	getdtblsize.o		\
456	getenv.o		\
457	getexecname.o		\
458	getgrnam.o		\
459	getgrnam_r.o		\
460	gethostid.o		\
461	gethostname.o		\
462	gethz.o			\
463	getisax.o		\
464	getloadavg.o		\
465	getlogin.o		\
466	getmntent.o		\
467	getnetgrent.o		\
468	getopt.o		\
469	getopt_long.o		\
470	getpagesize.o		\
471	getpw.o			\
472	getpwnam.o		\
473	getpwnam_r.o		\
474	getrusage.o		\
475	getspent.o		\
476	getspent_r.o		\
477	getsubopt.o		\
478	gettxt.o		\
479	getusershell.o		\
480	getut.o			\
481	getutx.o		\
482	getvfsent.o		\
483	getwd.o			\
484	getwidth.o		\
485	getxby_door.o		\
486	gtxt.o			\
487	hsearch.o		\
488	iconv.o			\
489	imaxabs.o		\
490	imaxdiv.o		\
491	index.o			\
492	initgroups.o		\
493	insque.o		\
494	isaexec.o		\
495	isastream.o		\
496	isatty.o		\
497	killpg.o		\
498	l64a.o			\
499	lckpwdf.o		\
500	lconstants.o		\
501	ldivide.o		\
502	lfind.o			\
503	lfmt.o			\
504	lfmt_log.o		\
505	llabs.o			\
506	lldiv.o			\
507	lltostr.o		\
508	localtime.o		\
509	lsearch.o		\
510	madvise.o		\
511	malloc.o		\
512	memalign.o		\
513	mkdev.o			\
514	mkdtemp.o		\
515	mkfifo.o		\
516	mkstemp.o		\
517	mktemp.o		\
518	mlock.o			\
519	mlockall.o		\
520	mon.o			\
521	msync.o			\
522	munlock.o		\
523	munlockall.o		\
524	ndbm.o			\
525	nftw.o			\
526	nlspath_checks.o	\
527	nsparse.o		\
528	nss_common.o		\
529	nss_dbdefs.o		\
530	nss_deffinder.o		\
531	opendir.o		\
532	opt_data.o		\
533	perror.o		\
534	pfmt.o			\
535	pfmt_data.o		\
536	pfmt_print.o		\
537	plock.o			\
538	poll.o			\
539	priocntl.o		\
540	privlib.o		\
541	priv_str_xlate.o	\
542	psiginfo.o		\
543	psignal.o		\
544	pt.o			\
545	putpwent.o		\
546	putspent.o		\
547	raise.o			\
548	rand.o			\
549	random.o		\
550	rctlops.o		\
551	readdir.o		\
552	readdir_r.o		\
553	realpath.o		\
554	reboot.o		\
555	regexpr.o		\
556	rename.o		\
557	rewinddir.o		\
558	rindex.o		\
559	scandir.o		\
560	seekdir.o		\
561	select.o		\
562	select_large_fdset.o	\
563	setlabel.o		\
564	setpriority.o		\
565	settimeofday.o		\
566	sh_locks.o		\
567	sigflag.o		\
568	siglist.o		\
569	sigsend.o		\
570	sigsetops.o		\
571	ssignal.o		\
572	stack.o			\
573	str2sig.o		\
574	strcase_charmap.o	\
575	strcat.o		\
576	strcspn.o		\
577	strdup.o		\
578	strerror.o		\
579	strncat.o		\
580	strlcat.o		\
581	strncasecmp.o		\
582	strpbrk.o		\
583	strrchr.o		\
584	strsignal.o		\
585	strspn.o		\
586	strstr.o		\
587	strtod.o		\
588	strtoimax.o		\
589	strtok.o		\
590	strtok_r.o		\
591	strtoll.o		\
592	strtoull.o		\
593	strtoumax.o		\
594	swab.o			\
595	swapctl.o		\
596	sysconf.o		\
597	syslog.o		\
598	tcdrain.o		\
599	tcflow.o		\
600	tcflush.o		\
601	tcgetattr.o		\
602	tcgetpgrp.o		\
603	tcgetsid.o		\
604	tcsendbreak.o		\
605	tcsetattr.o		\
606	tcsetpgrp.o		\
607	tell.o			\
608	telldir.o		\
609	tfind.o			\
610	time_data.o		\
611	time_gdata.o		\
612	truncate.o		\
613	tsdalloc.o		\
614	tsearch.o		\
615	ttyname.o		\
616	ttyslot.o		\
617	ualarm.o		\
618	ucred.o			\
619	valloc.o		\
620	vlfmt.o			\
621	vpfmt.o			\
622	wait3.o			\
623	wait4.o			\
624	waitpid.o		\
625	walkstack.o		\
626	wdata.o			\
627	xgetwidth.o		\
628	xpg4.o			\
629	xpg6.o
630
631PORTPRINT_W=			\
632	doprnt_w.o
633
634PORTPRINT=			\
635	doprnt.o		\
636	fprintf.o		\
637	printf.o		\
638	snprintf.o		\
639	sprintf.o		\
640	vfprintf.o		\
641	vprintf.o		\
642	vsnprintf.o		\
643	vsprintf.o		\
644	vwprintf.o		\
645	wprintf.o
646
647# c89 variants to support 32-bit size of c89 u/intmax_t (32-bit libc only)
648PORTPRINT_C89=			\
649	vfprintf_c89.o		\
650	vprintf_c89.o		\
651	vsnprintf_c89.o		\
652	vsprintf_c89.o		\
653	vwprintf_c89.o
654
655PORTSTDIO_C89=			\
656	vscanf_c89.o		\
657	vwscanf_c89.o
658
659# portable stdio objects that contain large file interfaces.
660# Note: fopen64 is a special case, as we build it small.
661PORTSTDIO64=			\
662	fopen64.o		\
663	fpos64.o
664
665PORTSTDIO_W=			\
666	doscan_w.o
667
668PORTSTDIO=			\
669	__extensions.o		\
670	_endopen.o		\
671	_filbuf.o		\
672	_findbuf.o		\
673	_flsbuf.o		\
674	_wrtchk.o		\
675	clearerr.o		\
676	ctermid.o		\
677	ctermid_r.o		\
678	cuserid.o		\
679	data.o			\
680	doscan.o		\
681	fdopen.o		\
682	feof.o			\
683	ferror.o		\
684	fgetc.o			\
685	fgets.o			\
686	fileno.o		\
687	flockf.o		\
688	flush.o			\
689	fopen.o			\
690	fpos.o			\
691	fputc.o			\
692	fputs.o			\
693	fread.o			\
694	fseek.o			\
695	fseeko.o		\
696	ftell.o			\
697	ftello.o		\
698	fwrite.o		\
699	getc.o			\
700	getchar.o		\
701	getpass.o		\
702	gets.o			\
703	getw.o			\
704	popen.o			\
705	putc.o			\
706	putchar.o		\
707	puts.o			\
708	putw.o			\
709	rewind.o		\
710	scanf.o			\
711	setbuf.o		\
712	setbuffer.o		\
713	setvbuf.o		\
714	system.o		\
715	tempnam.o		\
716	tmpfile.o		\
717	tmpnam_r.o		\
718	ungetc.o		\
719	mse.o			\
720	vscanf.o		\
721	vwscanf.o		\
722	wscanf.o
723
724PORTI18N=			\
725	__fgetwc_xpg5.o		\
726	__fgetws_xpg5.o		\
727	__fputwc_xpg5.o		\
728	__fputws_xpg5.o		\
729	__ungetwc_xpg5.o	\
730	getwchar.o		\
731	putwchar.o		\
732	putws.o			\
733	strtows.o		\
734	wcstoimax.o		\
735	wcstol.o		\
736	wcstoul.o		\
737	wcswcs.o		\
738	wscasecmp.o		\
739	wscat.o			\
740	wschr.o			\
741	wscmp.o			\
742	wscpy.o			\
743	wscspn.o		\
744	wsdup.o			\
745	wslen.o			\
746	wsncasecmp.o		\
747	wsncat.o		\
748	wsncmp.o		\
749	wsncpy.o		\
750	wspbrk.o		\
751	wsprintf.o		\
752	wsrchr.o		\
753	wsscanf.o		\
754	wsspn.o			\
755	wstod.o			\
756	wstok.o			\
757	wstol.o			\
758	wstoll.o		\
759	wsxfrm.o		\
760	wmemchr.o		\
761	wmemcmp.o		\
762	wmemcpy.o		\
763	wmemmove.o		\
764	wmemset.o		\
765	wcsstr.o		\
766	gettext.o		\
767	gettext_real.o		\
768	gettext_util.o		\
769	gettext_gnu.o		\
770	plural_parser.o		\
771	wdresolve.o		\
772	_ctype.o		\
773	isascii.o		\
774	toascii.o
775
776PORTI18N_COND=			\
777	wcstol_longlong.o	\
778	wcstoul_longlong.o
779
780THREADSOBJS=			\
781	alloc.o			\
782	assfail.o		\
783	cancel.o		\
784	door_calls.o		\
785	pthr_attr.o		\
786	pthr_barrier.o		\
787	pthr_cond.o		\
788	pthr_mutex.o		\
789	pthr_rwlock.o		\
790	pthread.o		\
791	rtsched.o		\
792	rwlock.o		\
793	scalls.o		\
794	sema.o			\
795	sigaction.o		\
796	spawn.o			\
797	synch.o			\
798	tdb_agent.o		\
799	thr.o			\
800	thread_interface.o	\
801	tls.o			\
802	tsd.o
803
804THREADSMACHOBJS=		\
805	machdep.o
806
807THREADSASMOBJS=			\
808	asm_subr.o
809
810UNWINDMACHOBJS=			\
811	unwind.o
812
813UNWINDASMOBJS=			\
814	unwind_frame.o
815
816# objects that implement the transitional large file API
817PORTSYS64=			\
818	fstatat64.o		\
819	lockf64.o		\
820	openat64.o
821
822PORTSYS=			\
823	_autofssys.o		\
824	acctctl.o		\
825	bsd_signal.o		\
826	corectl.o		\
827	exacctsys.o		\
828	execl.o			\
829	execle.o		\
830	execv.o			\
831	fcntl.o			\
832	fsmisc.o		\
833	fstatat.o		\
834	fsync.o			\
835	getpeerucred.o		\
836	inst_sync.o		\
837	issetugid.o		\
838	label.o			\
839	libc_link.o		\
840	libc_open.o		\
841	lockf.o			\
842	lwp.o			\
843	lwp_cond.o		\
844	lwp_rwlock.o		\
845	lwp_sigmask.o		\
846	meminfosys.o		\
847	msgsys.o		\
848	nfssys.o		\
849	openat.o		\
850	pgrpsys.o		\
851	posix_sigwait.o		\
852	ppriv.o			\
853	psetsys.o		\
854	rctlsys.o		\
855	sbrk.o			\
856	semsys.o		\
857	set_errno.o		\
858	shmsys.o		\
859	siginterrupt.o		\
860	signal.o		\
861	sigpending.o		\
862	sigstack.o		\
863	tasksys.o		\
864	time.o			\
865	time_util.o		\
866	ucontext.o		\
867	ustat.o			\
868	zone.o
869
870PORTREGEX=			\
871	glob.o			\
872	regcmp.o		\
873	regex.o			\
874	wordexp.o
875
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 inlines with 'cas':
1070pics/synch.o pics/lwp.o := sparc_CFLAGS += -_gcc=-Wa,-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