#
# 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 2016 Joyent, Inc.
#
# Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
# Copyright 2013 Garrett D'Amore <garrett@damore.org>
# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
# Use is subject to license terms.
#
LIBCBASE= .
# objects are grouped by source directory
# local objects
CRTOBJS= \
FPOBJS= \
I386FPOBJS= \
FPASMOBJS= \
_xtoll.o \
fpcw.o \
ATOMICOBJS= \
CHACHAOBJS= \
XATTROBJS= \
COMOBJS= \
bcmp.o \
bcopy.o \
bzero.o \
qsort.o \
strtol.o \
GENOBJS= \
_getsp.o \
abs.o \
alloca.o \
attrat.o \
cuexit.o \
ecvt.o \
endian.o \
errlst.o \
lock.o \
memchr.o \
memcmp.o \
memcpy.o \
memset.o \
setjmp.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 \
acct.o \
acl.o \
alarm.o \
brk.o \
chdir.o \
chroot.o \
cladm.o \
close.o \
execve.o \
exit.o \
facl.o \
fchdir.o \
fdsync.o \
getgid.o \
getmsg.o \
getpid.o \
getuid.o \
gtty.o \
ioctl.o \
kaio.o \
kill.o \
llseek.o \
lseek.o \
mmap.o \
modctl.o \
mount.o \
munmap.o \
nice.o \
pause.o \
pipe2.o \
pread.o \
preadv.o \
profil.o \
putmsg.o \
pwrite.o \
read.o \
readv.o \
setgid.o \
setuid.o \
statfs.o \
stty.o \
sync.o \
sysfs.o \
syslwp.o \
times.o \
ulimit.o \
umask.o \
utssys.o \
uucopy.o \
waitid.o \
write.o \
writev.o \
SYSOBJS= \
door.o \
forkx.o \
nuname.o \
sysi86.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 $(LIBCDIR)/port
PORTFP= \
finite.o \
sigfpe.o \
PORTGEN= \
_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 \
daemon.o \
deflt.o \
div.o \
dup.o \
err.o \
errno.o \
euclen.o \
execvp.o \
ffs.o \
flock.o \
fls.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 \
memmem.o \
mkdev.o \
mkfifo.o \
mktemp.o \
mlock.o \
mon.o \
msync.o \
ndbm.o \
nftw.o \
perror.o \
pfmt.o \
pipe.o \
plock.o \
poll.o \
pt.o \
raise.o \
rand.o \
random.o \
reboot.o \
remove.o \
rindex.o \
select.o \
stack.o \
stpcpy.o \
strcat.o \
strchr.o \
strdup.o \
strsep.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 \
mse.o \
popen.o \
putc.o \
puts.o \
putw.o \
rewind.o \
scanf.o \
setbuf.o \
system.o \
ungetc.o \
vscanf.o \
PORTI18N= \
putws.o \
wcsstr.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 \
_ctype.o \
PORTLOCALE= \
big5.o \
btowc.o \
euc.o \
fgetwc.o \
fgetws.o \
fputwc.o \
fputws.o \
fwide.o \
gb2312.o \
gbk.o \
ldpart.o \
mblen.o \
mbrlen.o \
mbtowc.o \
none.o \
rune.o \
table.o \
utf8.o \
wctob.o \
wctomb.o \
wctype.o \
AIOOBJS= \
aio.o \
RTOBJS= \
mqueue.o \
sched.o \
sem.o \
shm.o \
SECFLAGSOBJS= \
TPOOLOBJS= \
THREADSOBJS= \
alloc.o \
cancel.o \
tmem.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= \
access.o \
chmod.o \
chown.o \
epoll.o \
execl.o \
execle.o \
execv.o \
fcntl.o \
label.o \
link.o \
lockf.o \
lwp.o \
mkdir.o \
mknod.o \
msgsys.o \
nfssys.o \
open.o \
ppriv.o \
rename.o \
sbrk.o \
semsys.o \
shmsys.o \
sidsys.o \
signal.o \
stat.o \
time.o \
unlink.o \
ustat.o \
PORTREGEX= \
glob.o \
regcmp.o \
regex.o \
VALUES= \
MOSTOBJS= \
$(STRETS) \
$(CRTOBJS) \
$(DYNOBJS) \
$(FPOBJS) \
$(I386FPOBJS) \
$(FPASMOBJS) \
$(ATOMICOBJS) \
$(CHACHAOBJS) \
$(XATTROBJS) \
$(COMOBJS) \
$(GENOBJS) \
$(PORTFP) \
$(PORTGEN) \
$(PORTGEN64) \
$(PORTI18N) \
$(PORTI18N_COND) \
$(PORTLOCALE) \
$(PORTPRINT) \
$(PORTPRINT_W) \
$(PORTREGEX) \
$(PORTSTDIO) \
$(PORTSTDIO64) \
$(PORTSTDIO_W) \
$(PORTSYS) \
$(PORTSYS64) \
$(AIOOBJS) \
$(RTOBJS) \
$(SECFLAGSOBJS) \
$(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
# 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.
# Make string literals read-only to save memory
# As a favor to the dtrace syscall provider, libc still calls the
# old syscall traps that have been obsoleted by the *at() interfaces.
# Delete this to compile libc using only the new *at() system call traps
# proc64_id.o is built with defines in $(SRC)/uts/intel/sys/x86_archext.h
# Inform the run-time linker about libc specialized initialization
# Force libc's internal references to be resolved immediately upon loading
# in order to avoid critical region problems. Since almost all libc symbols
# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
# 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.
# libc method of building an archive
# The "$(GREP) -v ' L '" part is necessary only until
# lorder is fixed to ignore thread-local variables.
# extra files for the clean target
CLEANFILES= \
assym.h \
genassym \
$(ALTPICS)
CLOBBERFILES += $(LIB_PIC)
# list of C source for lint
SRCS= \
$(THREADSMACHOBJS:%.o=threads/%.c) \
$(UNWINDMACHOBJS:%.o=unwind/%.c) \
# conditional assignments
# $(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
# Files which need the threads .il inline template
TIL= \
aio.o \
alloc.o \
atexit.o \
atfork.o \
cancel.o \
err.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 \
tmem.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/%) := \
$(PORTPRINT_C89:%=pics/%) := \
$(PORTSTDIO_C89:%=pics/%) := \
$(PORTI18N_COND:%=pics/%) := \
lint:
# object files that depend on inline template
# include common libc targets
# We need to strip out all CTF data from the static library
$(BUILD.AR)
setjmp.o \
$(ASSYMDEP_OBJS:%=pics/%): assym.h
# assym.h build rules
genassym: $(GENASSYM_C)
-o $@ $(GENASSYM_C)
$(OFFSETS_CREATE) <$(OFFSETS) >$@
./genassym >>$@
# derived C source and related explicit dependencies