Makefile revision 9acbbeaf2a1ffe5c14b244867d427714fab43c5c
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# CDDL HEADER START
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# The contents of this file are subject to the terms of the
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# Common Development and Distribution License (the "License").
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# You may not use this file except in compliance with the License.
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# See the License for the specific language governing permissions
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# and limitations under the License.
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# When distributing Covered Code, include this CDDL HEADER in each
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# If applicable, add the following below this CDDL HEADER, with the
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# fields enclosed by brackets "[]" replaced with your own identifying
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# information: Portions Copyright [yyyy] [name of copyright owner]
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# CDDL HEADER END
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# Use is subject to license terms.
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# ident "%Z%%M% %I% %E% SMI"
8002d4117c1ea26aff1f16f584ae97bdbd5b21d5Sowmini Varadhan# objects are grouped by source directory
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# local objects
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# This macro should ALWAYS be empty; native APIs are already 'large file'.
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# This macro should ALWAYS be empty; native APIs are already 'large file'.
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# objects from source under ../port
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# This macro should ALWAYS be empty; native APIs are already 'large file'.
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
8002d4117c1ea26aff1f16f584ae97bdbd5b21d5Sowmini Varadhan# This macro should ALWAYS be empty; native APIs are already 'large file'.
8002d4117c1ea26aff1f16f584ae97bdbd5b21d5Sowmini Varadhan# NOTE: libc.so.1 must be linked with the minimal crti.o and crtn.o
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# modules whose source is provided in the $(SRC)/lib/common directory.
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# This must be done because otherwise the Sun C compiler would insert
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# its own versions of these modules and those versions contain code
8002d4117c1ea26aff1f16f584ae97bdbd5b21d5Sowmini Varadhan# to call out to C++ initialization functions. Such C++ initialization
8002d4117c1ea26aff1f16f584ae97bdbd5b21d5Sowmini Varadhan# functions can call back into libc before thread initialization is
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# complete and this leads to segmentation violations and other problems.
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# Since libc contains no C++ code, linking with the minimal crti.o and
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# crtn.o modules is safe and avoids the problems described above.
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# include common library definitions
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# NOTE: libc_i18n.a will be part of libc.so.1. Therefore, the compilation
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# need to be compatible with the ones for the libc stuff. Whenever the changes
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# that affect the compilation conditions of libc happened, those for libc_i18n
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# also need to be updated.
8002d4117c1ea26aff1f16f584ae97bdbd5b21d5Sowmini Varadhan# This is necessary to avoid problems with calling _ex_unwind().
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# We probably don't want any inlining anyway.
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# enables ASSERT() checking in the threads portion of the library.
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# This is automatically enabled for DEBUG builds, not for non-debug builds.
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS)
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem -I. -I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master) -I/usr/include
e11c3f44f531fdff80941ce57c065d2ae861cefcmeemASFLAGS= $(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) \
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# Inform the run-time linker about libc specialized initialization
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# Override this top level flag so the compiler builds in its native
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# C99 mode. This has been enabled to support the complex arithmetic
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# added to libc.
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# libc method of building an archive
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem $(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# extra files for the clean target
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# list of C source for lint
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem $(PORTFP:%.o=../port/fp/%.c) \
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem $(PORTGEN:%.o=../port/gen/%.c) \
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem $(PORTI18N:%.o=../port/i18n/%.c) \
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem $(PORTPRINT:%.o=../port/print/%.c) \
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem $(PORTREGEX:%.o=../port/regex/%.c) \
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem $(PORTSTDIO:%.o=../port/stdio/%.c) \
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem $(PORTSYS:%.o=../port/sys/%.c) \
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem $(AIOOBJS:%.o=../port/aio/%.c) \
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem $(RTOBJS:%.o=../port/rt/%.c) \
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem $(TPOOLOBJS:%.o=../port/tpool/%.c) \
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem $(THREADSOBJS:%.o=../port/threads/%.c) \
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem $(FPOBJS:%.o=fp/%.c) \
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem $(I386FPOBJS:%.o=../i386/fp/%.c) \
8002d4117c1ea26aff1f16f584ae97bdbd5b21d5Sowmini Varadhan# conditional assignments
8002d4117c1ea26aff1f16f584ae97bdbd5b21d5Sowmini Varadhan# $(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# Files which need the threads .il inline template
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/amd64.il
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# large-file-aware components that should be built large
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem#$(COMSYSOBJS64:%=pics/%) := \
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem#$(SYSOBJS64:%=pics/%) := \
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem#$(PORTGEN64:%=pics/%) := \
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem#$(PORTSTDIO64:%=pics/%) := \
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem#$(PORTSYS64:%=pics/%) := \
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
8002d4117c1ea26aff1f16f584ae97bdbd5b21d5Sowmini Varadhanlint := CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
8002d4117c1ea26aff1f16f584ae97bdbd5b21d5Sowmini Varadhanlint := LINTFLAGS64 += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# object files that depend on inline template
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# include common libc targets
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# We need to strip out all CTF data from the static library
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# assym.h build rules
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# XXX A hack. Perhaps this should be 'CPPFLAGS.native' and
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem $(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem $(NATIVECC) -Iinc -I../inc $(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
e11c3f44f531fdff80941ce57c065d2ae861cefcmeem# derived C source and related explicit dependencies