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