Makefile revision dab53f9907c56d61cc82bf0ba356b741b92aec63
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
#
#
LIBCBASE=.
VERS= .1
# objects are grouped by source directory
# local objects
STRETS= \
stret1.o \
stret2.o \
CRTOBJS= \
_ftou.o \
cerror.o \
FPOBJS= \
_Q_add.o \
_Q_cmp.o \
_Q_div.o \
_Q_fcc.o \
_Q_mul.o \
_Q_neg.o \
_Q_scl.o \
_Q_sub.o \
FPASMOBJS= \
ATOMICOBJS= \
COMOBJS= \
bcmp.o \
bcopy.o \
bzero.o \
qsort.o \
strtol.o \
GENOBJS= \
_getsp.o \
abs.o \
alloca.o \
cuexit.o \
ecvt.o \
errlst.o \
ladd.o \
lexp10.o \
llog10.o \
lmul.o \
lock.o \
lsign.o \
lsub.o \
memchr.o \
memcmp.o \
memcpy.o \
memset.o \
setjmp.o \
strchr.o \
strcmp.o \
strcpy.o \
strlen.o \
# sysobjs that contain large-file interfaces
COMSYSOBJS64= \
open64.o \
stat64.o \
SYSOBJS64= \
COMSYSOBJS= \
__time.o \
_pset.o \
access.o \
acct.o \
acl.o \
alarm.o \
brk.o \
chdir.o \
chmod.o \
chown.o \
chroot.o \
cladm.o \
close.o \
creat.o \
dup.o \
execve.o \
exit.o \
facl.o \
fchdir.o \
fchmod.o \
fchown.o \
fdsync.o \
fstat.o \
getgid.o \
getmsg.o \
getpid.o \
getuid.o \
gtty.o \
ioctl.o \
kaio.o \
kill.o \
lchown.o \
link.o \
llseek.o \
lseek.o \
lstat.o \
mkdir.o \
mknod.o \
mmap.o \
modctl.o \
mount.o \
munmap.o \
nice.o \
open.o \
pause.o \
pread.o \
profil.o \
putmsg.o \
pwrite.o \
read.o \
readv.o \
rmdir.o \
setgid.o \
setuid.o \
stat.o \
statfs.o \
stty.o \
sync.o \
sysfs.o \
syslwp.o \
times.o \
ulimit.o \
umask.o \
unlink.o \
utime.o \
utimes.o \
utssys.o \
waitid.o \
write.o \
writev.o \
SYSOBJS= \
door.o \
fork1.o \
pipe.o \
ptrace.o \
syssun.o \
uadmin.o \
umount.o \
uname.o \
# objects under ../port which contain transitional large file interfaces
PORTGEN64= \
ftw64.o \
nftw64.o \
tell64.o \
# objects from source under ../port
PORTFP= \
finite.o \
sigfpe.o \
cmpdi2.o \
divdi3.o \
moddi3.o \
muldi3.o \
PORTGEN= \
_ftoll.o \
_xftw.o \
a64l.o \
abort.o \
addsev.o \
assert.o \
atof.o \
atoi.o \
atol.o \
atoll.o \
atexit.o \
atfork.o \
calloc.o \
cfree.o \
cftime.o \
clock.o \
crypt.o \
ctime.o \
div.o \
dup2.o \
errno.o \
euclen.o \
execvp.o \
ffs.o \
fmtmsg.o \
ftime.o \
ftok.o \
ftw.o \
gcvt.o \
getcwd.o \
getenv.o \
gethz.o \
getopt.o \
getpw.o \
gettxt.o \
getut.o \
getutx.o \
getwd.o \
gtxt.o \
iconv.o \
index.o \
insque.o \
isatty.o \
killpg.o \
l64a.o \
lfind.o \
lfmt.o \
llabs.o \
lldiv.o \
malloc.o \
mkdev.o \
mkfifo.o \
mktemp.o \
mlock.o \
mon.o \
msync.o \
ndbm.o \
nftw.o \
perror.o \
pfmt.o \
plock.o \
poll.o \
pt.o \
raise.o \
rand.o \
random.o \
reboot.o \
rename.o \
rindex.o \
select.o \
stack.o \
strcat.o \
strdup.o \
strspn.o \
strstr.o \
strtod.o \
strtok.o \
swab.o \
syslog.o \
tcflow.o \
tell.o \
tfind.o \
ualarm.o \
ucred.o \
valloc.o \
vlfmt.o \
vpfmt.o \
wait3.o \
wait4.o \
wdata.o \
xpg4.o \
PORTPRINT_W= \
PORTPRINT= \
doprnt.o \
printf.o \
# portable stdio objects that contain large file interfaces.
# Note: fopen64 is a special case, as we build it small.
PORTSTDIO64= \
PORTSTDIO_W= \
PORTSTDIO= \
data.o \
doscan.o \
fdopen.o \
feof.o \
ferror.o \
fgetc.o \
fgets.o \
fileno.o \
flockf.o \
flush.o \
fopen.o \
fpos.o \
fputc.o \
fputs.o \
fread.o \
fseek.o \
fseeko.o \
ftell.o \
ftello.o \
fwrite.o \
getc.o \
gets.o \
getw.o \
popen.o \
putc.o \
puts.o \
putw.o \
rewind.o \
scanf.o \
setbuf.o \
system.o \
ungetc.o \
mse.o \
vscanf.o \
PORTI18N= \
putws.o \
wcstol.o \
wcswcs.o \
wscat.o \
wschr.o \
wscmp.o \
wscpy.o \
wscspn.o \
wsdup.o \
wslen.o \
wsncat.o \
wsncmp.o \
wsncpy.o \
wspbrk.o \
wsrchr.o \
wsspn.o \
wstod.o \
wstok.o \
wstol.o \
wstoll.o \
wsxfrm.o \
wcsstr.o \
_ctype.o \
AIOOBJS= \
aio.o \
RTOBJS= \
mqueue.o \
sched.o \
sem.o \
shm.o \
TPOOLOBJS= \
THREADSOBJS= \
alloc.o \
cancel.o \
rwlock.o \
scalls.o \
sema.o \
spawn.o \
synch.o \
thr.o \
tls.o \
# objects that implement the transitional large file API
PORTSYS64= \
PORTSYS= \
execl.o \
execle.o \
execv.o \
fcntl.o \
fsmisc.o \
fsync.o \
label.o \
lockf.o \
lwp.o \
msgsys.o \
nfssys.o \
openat.o \
ppriv.o \
sbrk.o \
semsys.o \
shmsys.o \
signal.o \
time.o \
ustat.o \
PORTREGEX= \
glob.o \
regcmp.o \
regex.o \
MOSTOBJS= \
$(STRETS) \
$(CRTOBJS) \
$(DYNOBJS) \
$(FPOBJS) \
$(FPASMOBJS) \
$(ATOMICOBJS) \
$(COMOBJS) \
$(GENOBJS) \
$(PORTFP) \
$(PORTGEN) \
$(PORTGEN64) \
$(PORTI18N) \
$(PORTI18N_COND) \
$(PORTPRINT) \
$(PORTPRINT_C89) \
$(PORTPRINT_W) \
$(PORTREGEX) \
$(PORTSTDIO) \
$(PORTSTDIO64) \
$(PORTSTDIO_C89) \
$(PORTSTDIO_W) \
$(PORTSYS) \
$(PORTSYS64) \
$(AIOOBJS) \
$(RTOBJS) \
$(TPOOLOBJS) \
$(THREADSOBJS) \
$(THREADSMACHOBJS) \
$(THREADSASMOBJS) \
$(UNWINDMACHOBJS) \
$(UNWINDASMOBJS) \
$(COMSYSOBJS) \
$(SYSOBJS) \
$(COMSYSOBJS64) \
$(SYSOBJS64) \
$(VALUES)
TRACEOBJS= \
# This must be done because otherwise the Sun C compiler would insert
# its own versions of these modules and those versions contain code
# to call out to C++ initialization functions. Such C++ initialization
# functions can call back into libc before thread initialization is
# complete and this leads to segmentation violations and other problems.
# Since libc contains no C++ code, linking with the minimal crti.o and
# crtn.o modules is safe and avoids the problems described above.
# include common library definitions
include ../../Makefile.lib
# NOTE: libc_i18n.a will be part of libc.so.1. Therefore, the compilation
# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
# need to be compatible with the ones for the libc stuff. Whenever the changes
# that affect the compilation conditions of libc happened, those for libc_i18n
# also need to be updated.
# This is necessary to avoid problems with calling _ex_unwind().
# We probably don't want any inlining anyway.
# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
# enables ASSERT() checking in the threads portion of the library.
# This is automatically enabled for DEBUG builds, not for non-debug builds.
CFLAGS += $(THREAD_DEBUG)
CFLAGS += $(EXTN_CFLAGS)
# Inform the run-time linker about libc specialized initialization
DYNFLAGS += $(EXTN_DYNFLAGS)
# Override this top level flag so the compiler builds in its native
# C99 mode. This has been enabled to support the complex arithmetic
# added to libc.
C99MODE= $(C99_ENABLE)
# libc method of building an archive
# extra files for the clean target
CLEANFILES= \
assym.h \
genassym \
$(ALTPICS)
# list of C source for lint
SRCS= \
$(THREADSOBJS:%.o=../port/threads/%.c) \
$(UNWINDMACHOBJS:%.o=../port/unwind/%.c) \
# conditional assignments
$(MAPFILE):
# Files which need the threads .il inline template
TIL= \
aio.o \
alloc.o \
atexit.o \
atfork.o \
cancel.o \
errno.o \
lwp.o \
ma.o \
rand.o \
rwlock.o \
scalls.o \
sema.o \
spawn.o \
stack.o \
synch.o \
thr.o \
tls.o \
tsd.o \
# special kludge for inlines with 'cas':
IL= \
# Files in fp subdirectory which need __quad.il inline template
QIL= \
_Q_add.o \
_Q_cmp.o \
_Q_div.o \
_Q_fcc.o \
_Q_mul.o \
# large-file-aware components that should be built large
$(COMSYSOBJS64:%=pics/%) := \
$(PORTSTDIO64:%=pics/%) := \
$(PORTSTDIO_W:%=pics/%) := \
$(PORTPRINT_W:%=pics/%) := \
$(PORTPRINT_C89:%=pics/%) := \
$(PORTSTDIO_C89:%=pics/%) := \
$(PORTI18N_COND:%=pics/%) := \
# Files which need extra optimization
lint:
# object files that depend on inline template
# include common libc targets
# We need to strip out all CTF and DOF data from the static library
$(BUILD.AR)
# special cases
# partially built from C source
$(CTFCONVERT_O)
$(ASSYMDEP_OBJS:%=pics/%) := CPPFLAGS += -I.
$(ASSYMDEP_OBJS:%=pics/%): assym.h
# assym.h build rules
# XXX A hack. Perhaps this should be 'CPPFLAGS.native' and
# live in Makefile.master
genassym: $(GENASSYM_C)
$(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
$(OFFSETS_CREATE) <$(OFFSETS) >$@
./genassym >>$@
# derived C source and related explicit dependencies