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