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