Makefile revision 019c3c436f78111e4ecf8382da622143f7b45c6d
#
# 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 2008 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
CRTOBJS= \
_ftou.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 \
FPOBJS64= \
FPASMOBJS= \
ATOMICOBJS= \
XATTROBJS= \
COMOBJS= \
bcmp.o \
bcopy.o \
bzero.o \
ffs.o \
qsort.o \
strtol.o \
GENOBJS= \
_getsp.o \
abs.o \
alloca.o \
cuexit.o \
ecvt.o \
lock.o \
memchr.o \
memcmp.o \
memcpy.o \
memset.o \
setjmp.o \
strchr.o \
strcmp.o \
strcpy.o \
strlen.o \
# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
# This macro should ALWAYS be empty; native APIs are already 'large file'.
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 \
fcntl.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 \
rename.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 \
uucopy.o \
waitid.o \
write.o \
writev.o \
SYSOBJS= \
door.o \
forkx.o \
pipe.o \
uadmin.o \
umount.o \
uname.o \
# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
# This macro should ALWAYS be empty; native APIs are already 'large file'.
# objects from source under ../port
PORTFP= \
finite.o \
sigfpe.o \
PORTGEN= \
_xftw.o \
a64l.o \
abort.o \
addsev.o \
assert.o \
attrat.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 \
deflt.o \
div.o \
dup2.o \
err.o \
errno.o \
euclen.o \
execvp.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 \
lexp10.o \
lfind.o \
lfmt.o \
lldiv.o \
llog10.o \
lmath.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 \
remove.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 \
wdata.o \
xpg4.o \
PORTPRINT_W= \
PORTPRINT= \
doprnt.o \
printf.o \
# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
# This macro should ALWAYS be empty; native APIs are already 'large file'.
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 \
UNICODEOBJS= \
# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
# This macro should ALWAYS be empty; native APIs are already 'large file'.
PORTSYS= \
execl.o \
execle.o \
execv.o \
fsmisc.o \
label.o \
lockf.o \
lwp.o \
msgsys.o \
nfssys.o \
openat.o \
ppriv.o \
sbrk.o \
semsys.o \
shmsys.o \
sidsys.o \
signal.o \
time.o \
ustat.o \
PORTREGEX= \
glob.o \
regcmp.o \
regex.o \
MOSTOBJS= \
$(STRETS) \
$(CRTOBJS) \
$(DYNOBJS) \
$(FPOBJS) \
$(FPOBJS64) \
$(FPASMOBJS) \
$(ATOMICOBJS) \
$(XATTROBJS) \
$(COMOBJS) \
$(GENOBJS) \
$(PORTFP) \
$(PORTGEN) \
$(PORTGEN64) \
$(PORTI18N) \
$(PORTI18N_COND) \
$(PORTPRINT) \
$(PORTPRINT_W) \
$(PORTREGEX) \
$(PORTSTDIO) \
$(PORTSTDIO64) \
$(PORTSTDIO_W) \
$(PORTSYS) \
$(PORTSYS64) \
$(AIOOBJS) \
$(RTOBJS) \
$(TPOOLOBJS) \
$(THREADSOBJS) \
$(THREADSMACHOBJS) \
$(THREADSASMOBJS) \
$(UNICODEOBJS) \
$(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.
CFLAGS64 += $(EXTN_CFLAGS)
# Conditionally add support for making |wordexp()| check whether
# 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)
CLOBBERFILES += $(LIB_PIC)
# list of C source for lint
SRCS= \
$(THREADSOBJS:%.o=../port/threads/%.c) \
$(UNWINDMACHOBJS:%.o=../port/unwind/%.c) \
# conditional assignments
# 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 \
sched.o \
sema.o \
spawn.o \
stack.o \
synch.o \
thr.o \
tls.o \
tsd.o \
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 \
_Q_sub.o \
# Files in crt subdirectory which need muldiv64.il inline template
#CIL= mul64.o divrem64.o
# large-file-aware components that should be built large
#$(COMSYSOBJS64:%=pics/%) := \
# CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
#$(SYSOBJS64:%=pics/%) := \
# CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
#$(PORTGEN64:%=pics/%) := \
# CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
#$(PORTSTDIO64:%=pics/%) := \
# CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
#$(PORTSYS64:%=pics/%) := \
# CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
$(PORTSTDIO_W:%=pics/%) := \
$(PORTPRINT_W:%=pics/%) := \
$(PORTI18N_COND:%=pics/%) := \
# Files which need extra optimization
lint:
# object files that depend on inline template
#$(CIL:%=pics/%): $(LIBCBASE)/crt/muldiv64.il
# include common libc targets
# We need to strip out all CTF and DOF data from the static library
$(BUILD.AR)
# special cases
# $(POST_PROCESS_O)
#crt/_rtbootld.s: crt/_rtboot.s crt/_rtld.c
# $(RM) crt/_rtld.s
$(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