Makefile revision 2
2N/A#
2N/A# CDDL HEADER START
2N/A#
2N/A# The contents of this file are subject to the terms of the
2N/A# Common Development and Distribution License (the "License").
2N/A# You may not use this file except in compliance with the License.
2N/A#
2N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A# or http://www.opensolaris.org/os/licensing.
2N/A# See the License for the specific language governing permissions
2N/A# and limitations under the License.
2N/A#
2N/A# When distributing Covered Code, include this CDDL HEADER in each
2N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A# If applicable, add the following below this CDDL HEADER, with the
2N/A# fields enclosed by brackets "[]" replaced with your own identifying
2N/A# information: Portions Copyright [yyyy] [name of copyright owner]
2N/A#
2N/A# CDDL HEADER END
2N/A#
2N/A#
2N/A# Copyright (c) 1989, 2011, Oracle and/or its affiliates. All rights reserved.
2N/A#
2N/A#
2N/A
2N/ALIBBASENAME= libc
2N/ALIBRARY= $(LIBBASENAME:%=%.a)
2N/AVERS= .1
2N/A
2N/A# Note that we build libc_pic.a for the benefit of building ld.so.1. Only
2N/A# ld.so.1 needs it and it must be built in the same workspace as libc.
2N/A# Since we do not deliver it, we install it in the stub proto rather than
2N/A# the real one.
2N/ALIB_PIC= libc_pic.a
2N/A
2N/AROOTLIB= $(ROOT)/usr/lib
2N/AROOTFS_LIB= $(ROOT)/lib
2N/AROOTLIB64= $(ROOTLIB)/$(MACH64)
2N/AROOTFS_LIB64= $(ROOTFS_LIB)/$(MACH64)
2N/A
2N/ASTUBROOTLIB= $(STUBROOT)/usr/lib
2N/ASTUBROOTFS_LIB= $(STUBROOT)/lib
2N/ASTUBROOTLIB64= $(STUBROOTLIB)/$(MACH64)
2N/ASTUBROOTFS_LIB64= $(STUBROOTFS_LIB)/$(MACH64)
2N/A
2N/ALROOTLIB= $(LROOT)/usr/lib
2N/ALROOTFS_LIB= $(LROOT)/lib
2N/ALROOTLIB64= $(LROOTLIB)/$(MACH64)
2N/ALROOTFS_LIB64= $(LROOTFS_LIB)/$(MACH64)
2N/A
2N/AROOTVARIANTDIR= $(ROOTLIB)/libc
2N/AROOTVARIANTDIR64= $(ROOTLIB64)/libc
2N/A
2N/AROOTFS_LINTDIR= $(ROOTFS_LIB)
2N/AROOTFS_LINTDIR64= $(ROOTFS_LIB64)
2N/AROOTFS_LINTLIB= $(ROOTFS_LINTDIR)/$(LINTLIB)
2N/AROOTFS_LINTLIB64= $(ROOTFS_LINTDIR64)/$(LINTLIB)
2N/A
2N/A# include common library definitions
2N/Ainclude ../Makefile.lib
2N/A
2N/ALIBC_I18N=$(ROOTFS_LIBDIR)/libc_i18n.a
2N/A$(CLOSED_BUILD)LIBC_I18N=$(CLOSED)/lib/libc_i18n/$(MACH)/libc_i18n.a
2N/A
2N/ALIBC_I18N64=$(ROOTFS_LIBDIR64)/libc_i18n.a
2N/A$(CLOSED_BUILD)LIBC_I18N64=$(CLOSED)/lib/libc_i18n/$(MACH64)/libc_i18n.a
2N/A
2N/A#
2N/A# on some architectures, we build multiple libc variants
2N/A#
2N/AVAR1 = hwcap1
2N/AVAR2 = hwcap2
2N/AVAR3 = hwcap3
2N/A
2N/AVARBLD_1= $(MACH:sparc=sparc)
2N/AVARBLD= $(VARBLD_1:i386=)
2N/A
2N/AVARBLD64_1= $(MACH:sparc=sparcv9)
2N/AVARBLD64= $(VARBLD64_1:i386=)
2N/A
2N/AVAR1_DYNLIB = $(LIBRARY:%.a=%_$(VAR1).so$(VERS))
2N/AVAR1_BLDDIR = $(MACH)_$(VAR1)/$(VARBLD)
2N/AVAR2_DYNLIB = $(LIBRARY:%.a=%_$(VAR2).so$(VERS))
2N/AVAR2_BLDDIR = $(MACH)_$(VAR2)/$(VARBLD)
2N/AVAR3_DYNLIB = $(LIBRARY:%.a=%_$(VAR3).so$(VERS))
2N/AVAR3_BLDDIR = $(MACH)_$(VAR3)/$(VARBLD)
2N/A
2N/AVAR1_DYNLIB64 = $(LIBRARY:%.a=%_$(VAR1).so$(VERS))
2N/AVAR1_BLDDIR64 = $(MACH)_$(VAR1)/$(VARBLD64)
2N/A
2N/Ai386_VARIANTS= $(VAR1) $(VAR2) $(VAR3)
2N/Asparc_VARIANTS=
2N/Asparcv9_VARIANTS=
2N/A
2N/Ai386_COMP= capabilities
2N/Asparc_COMP= capabilities
2N/A
2N/AMACH_COMP= $($(MACH)_COMP)
2N/A
2N/Ai386_ETC= $(MACH)/etc
2N/Asparc_ETC=
2N/A
2N/AVARIANTS= $($(MACH)_VARIANTS)
2N/AVARIANT_SUBDIRS = $(VARIANTS:%=$(MACH)_%/$(VARBLD))
2N/A
2N/AVARIANTS64= $($(MACH64)_VARIANTS)
2N/AVARIANT_SUBDIRS64 = $(VARIANTS64:%=$(MACH)_%/$(VARBLD64))
2N/A
2N/ASUBDIRS= $(MACH_CAP) $(MACH) $(MACH_ETC) $(VARIANT_SUBDIRS)
2N/A$(BUILD64)SUBDIRS += $(MACH64) $(VARIANT_SUBDIRS64)
2N/A
2N/ALIBS = $(DYNLIB) $(LINTLIB)
2N/A
2N/AROOTLIBS64= $(ROOTLIBDIR64)/$(DYNLIB) $(ROOTLIBDIR64)/$(LINTLIB)
2N/AMACHLIBS64= $(MACH64)/$(DYNLIB) $(MACH64)/$(LINTLIB)
2N/AVARIANTLIBS= $(VARIANTS:%=$(MACH)_%/$(VARBLD)/$(LIBBASENAME)_%.so.1)
2N/AVARIANTLIBS64= $(VARIANTS64:%=$(MACH)_%/$(VARBLD64)/$(LIBBASENAME)_%.so.1)
2N/AROOTVARIANTLIBS= $(VARIANTS:%=$(ROOTVARIANTDIR)/$(LIBBASENAME)_%.so.1)
2N/AROOTVARIANTLIBS64= $(VARIANTS64:%=$(ROOTVARIANTDIR64)/$(LIBBASENAME)_%.so.1)
2N/A
2N/A# definitions for install_h target
2N/ABASEHDRS= getxby_door.h
2N/ACHECKHDRS= $(BASEHDRS:%.h=port/gen/%.check)
2N/AHDRS= $(BASEHDRS)
2N/A
2N/A# install rules for install_h target
2N/A$(ROOTHDRDIR)/%: port/gen/%
2N/A $(INS.file)
2N/A
2N/A$(ROOTLIBDIR)/$(DYNLIB) := FILEMODE = 755
2N/A$(ROOTLIBDIR64)/$(DYNLIB) := FILEMODE = 755
2N/A$(ROOTFS_LIBDIR)/$(DYNLIB) := FILEMODE = 755
2N/A$(ROOTFS_LIBDIR64)/$(DYNLIB) := FILEMODE = 755
2N/A
2N/A$(ROOTVARIANTDIR) := FILEMODE= 755
2N/A$(ROOTVARIANTDIR)/$(VAR1_DYNLIB) := FILEMODE= 755
2N/A$(ROOTVARIANTDIR)/$(VAR2_DYNLIB) := FILEMODE= 755
2N/A$(ROOTVARIANTDIR)/$(VAR3_DYNLIB) := FILEMODE= 755
2N/A
2N/A$(ROOTVARIANTDIR64) := FILEMODE= 755
2N/A$(ROOTVARIANTDIR64)/$(VAR1_DYNLIB64) := FILEMODE= 755
2N/A
2N/A.KEEP_STATE:
2N/A
2N/Aall: check_i18n .WAIT lib32 $(BUILD64) .WAIT lib64 .WAIT etc
2N/A
2N/Acheck_i18n:
2N/A @if [ ! -f $(LIBC_I18N) -o \
2N/A ! -f $(LIBC_I18N64) ]; then \
2N/A if [ "$$CLOSED_IS_PRESENT" = no ]; then \
2N/A $(ECHO) "Warning: closed binaries not" \
2N/A "properly unpacked." >&2;\
2N/A $(ECHO) "Missing libc_i18n.a" >&2; \
2N/A exit 1; \
2N/A else \
2N/A $(ECHO) "Warning: libc_i18n.a must be built" \
2N/A "before libc can be built." >&2; \
2N/A exit 1; \
2N/A fi \
2N/A fi
2N/A
2N/A$(MACH)/assym.h $(MACH64)/assym.h:
2N/A @cd $(@D); $(MAKE) assym.h
2N/A
2N/Aetc: $($(MACH)_ETC)
2N/A
2N/Alib32: $(MACH_COMP) $(MACHLIBS) $(MACH)/$(LIB_PIC) $(VARIANTLIBS)
2N/A mkdir -p $(MACH)/i18n_pics
2N/A cd $(MACH)/i18n_pics ; $(AR) -x $(LIBC_I18N)
2N/A @if $(ELFDUMP) -r $(MACH)/$(DYNLIB) | $(GREP) -w environ ; then \
2N/A $(ECHO) "Error: Invalid reference to environ" ; \
2N/A $(ECHO) "Error: See comments in port/gen/env_data.c" ; \
2N/A exit 1; \
2N/A fi
2N/A
2N/A$(MACH_COMP) $(MACHLIBS) $(MACH)/$(LIB_PIC): $(MACH)/assym.h
2N/A
2N/A$(MACH)/$(LIB_PIC): $(MACH_COMP)
2N/A
2N/Alib64: $(MACH_COMP) $(MACHLIBS64) $(MACH64)/$(LIB_PIC) $(VARIANTLIBS64)
2N/A mkdir -p $(MACH64)/i18n_pics
2N/A cd $(MACH64)/i18n_pics ; $(AR) -x $(LIBC_I18N64)
2N/A @if $(ELFDUMP) -r $(MACH64)/$(DYNLIB) | $(GREP) -w environ ; then \
2N/A $(ECHO) "Error: Invalid reference to environ" ; \
2N/A $(ECHO) "Error: See comments in port/gen/env_data.c" ; \
2N/A exit 1; \
2N/A fi
2N/A
2N/A$(MACH_COMP) $(MACHLIBS64) $(MACH64)/$(LIB_PIC): $(MACH64)/assym.h
2N/A
2N/A$(MACH64)/$(LIB_PIC): $(MACH_COMP)
2N/A
2N/A$(VARIANTLIBS): FRC
2N/A @cd $(@D); pwd; VERSION='$(VERSION)' $(MAKE) $(@F)
2N/A
2N/A$(VARIANTLIBS64): FRC
2N/A @cd $(@D); pwd; VERSION='$(VERSION)' $(MAKE) $(@F)
2N/A
2N/A$($(MACH)_ETC): FRC
2N/A @cd $(@); pwd; $(MAKE) $(TARGET)
2N/A
2N/A$($(MACH)_COMP): FRC
2N/A @cd $(@); pwd; $(MAKE) $(TARGET)
2N/A
2N/Ainstall: stubinstall \
2N/A all \
2N/A etc \
2N/A inslib32 \
2N/A $(BUILD64) inslib64
2N/A
2N/Ainslib32: $(ROOTFS_LIBS) $(ROOTFS_LINKS) $(ROOTFS_LINT) \
2N/A $(ROOTFS_LINTLIB) \
2N/A $(ROOTVARIANTLIBS) \
2N/A $(STUBROOTFS_LIB)/$(LIB_PIC)
2N/A
2N/Ainslib64: $(ROOTFS_LIBS64) $(ROOTFS_LINKS64) \
2N/A $(ROOTFS_LINTLIB64) \
2N/A $(ROOTVARIANTLIBS64) \
2N/A $(STUBROOTFS_LIB64)/$(LIB_PIC)
2N/A
2N/Ainstall_h: $(ROOTHDRS)
2N/A
2N/Acheck: $(CHECKHDRS)
2N/A
2N/A$(ROOTFS_LIB)/%: $(MACH)/%
2N/A $(INS.file)
2N/A$(ROOTFS_LIBDIR)/$(LIBLINKS): $(ROOTFS_LIBDIR)/$(LIBLINKS)$(VERS)
2N/A $(INS.liblink)
2N/A$(ROOTFS_LIB64)/%: $(MACH64)/%
2N/A $(INS.file)
2N/A$(ROOTFS_LIBDIR64)/$(LIBLINKS): $(ROOTFS_LIBDIR64)/$(LIBLINKS)$(VERS)
2N/A $(INS.liblink)
2N/A
2N/A$(STUBROOTFS_LIB)/%: $(MACH)/%
2N/A $(INS.file)
2N/A$(STUBROOTFS_LIB64)/%: $(MACH64)/%
2N/A $(INS.file)
2N/A
2N/A$(ROOTVARIANTDIR): $(ROOTLIB)
2N/A $(INS.dir)
2N/A$(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR1_BLDDIR)/%
2N/A $(INS.file)
2N/A$(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR2_BLDDIR)/%
2N/A $(INS.file)
2N/A$(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR3_BLDDIR)/%
2N/A $(INS.file)
2N/A
2N/A$(ROOTVARIANTDIR64): $(ROOTLIB64)
2N/A $(INS.dir)
2N/A$(ROOTVARIANTDIR64)/%: $(ROOTVARIANTDIR64) $(VAR1_BLDDIR64)/%
2N/A $(INS.file)
2N/A
2N/A# install rule for lint library target
2N/A$(ROOTFS_LINTDIR)/%: port/%
2N/A $(INS.file)
2N/A$(ROOTFS_LINTDIR64)/%: port/%
2N/A $(INS.file)
2N/A$(ROOTFS_LINTDIR)/%: $(MACH)/%
2N/A $(INS.file)
2N/A$(ROOTFS_LINTDIR64)/%: $(MACH64)/%
2N/A $(INS.file)
2N/A
2N/A$(LINTLIB):
2N/A @cd $(MACH); pwd; VERSION='$(VERSION)' $(MAKE) $@
2N/A$(LINTLIB64):
2N/A @cd $(MACH64); pwd; VERSION='$(VERSION)' $(MAKE) $@
2N/A
2N/A$(MACH)/$(LIB_PIC): FRC
2N/A @cd $(MACH); pwd; VERSION='$(VERSION)' $(MAKE) $(LIB_PIC)
2N/A$(MACH64)/$(LIB_PIC): FRC
2N/A @cd $(MACH64); pwd; VERSION='$(VERSION)' $(MAKE) $(LIB_PIC)
2N/A
2N/Aall := TARGET= all
2N/Ainstall := TARGET= install
2N/Astub := TARGET= stub
2N/Astubinstall:= TARGET= stubinstall
2N/Aclean := TARGET= clean
2N/Aclobber := TARGET= clobber
2N/Alint := TARGET= lint
2N/A
2N/A.PARALLEL: $(SUBDIRS)
2N/A
2N/A$(SUBDIRS): FRC
2N/A @cd $@; pwd; VERSION='$(VERSION)' $(MAKE) $(TARGET)
2N/A
2N/Aclean clobber: $(SUBDIRS)
2N/A $(RM) -r $(MACH)/i18n_pics
2N/A $(BUILD64)$(RM) -r $(MACH64)/i18n_pics
2N/A
2N/A# Only build stubs for the generic variants
2N/Astub stubinstall: $(MACH) $(MACH64)
2N/A
2N/Alint: $(SUBDIRS)
2N/A
2N/A_msg: $(MSGDOMAIN) catalog
2N/A
2N/Acatalog:
2N/A sh ./makelibccatalog.sh $(MSGDOMAIN)
2N/A
2N/A$(MSGDOMAIN):
2N/A $(INS.dir)
2N/A
2N/Acscope.out tags: FRC
2N/A $(XREF) -x $@
2N/A
2N/AFRC:
2N/A# include MACH-specific library targets
2N/Ainclude ../Makefile.mach