summaryrefslogtreecommitdiff
path: root/usr/src/lib/libc/Makefile
diff options
context:
space:
mode:
authorstevel@tonic-gate <none@none>2005-06-14 00:00:00 -0700
committerstevel@tonic-gate <none@none>2005-06-14 00:00:00 -0700
commit7c478bd95313f5f23a4c958a745db2134aa03244 (patch)
treec871e58545497667cbb4b0a4f2daf204743e1fe7 /usr/src/lib/libc/Makefile
downloadillumos-joyent-7c478bd95313f5f23a4c958a745db2134aa03244.tar.gz
OpenSolaris Launch
Diffstat (limited to 'usr/src/lib/libc/Makefile')
-rw-r--r--usr/src/lib/libc/Makefile191
1 files changed, 191 insertions, 0 deletions
diff --git a/usr/src/lib/libc/Makefile b/usr/src/lib/libc/Makefile
new file mode 100644
index 0000000000..e1d10f5bb9
--- /dev/null
+++ b/usr/src/lib/libc/Makefile
@@ -0,0 +1,191 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (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
+# or http://www.opensolaris.org/os/licensing.
+# 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 2005 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+LIBBASENAME= libc
+LIBRARY= $(LIBBASENAME:%=%.a)
+VERS= .1
+
+# Note that we build libc_pic.a for the benefit of building
+# ld.so.1, but we do not install it. Only ld.so.1 needs it
+# and it must be built in the same workspace as libc.
+LIB_PIC= libc_pic.a
+
+ROOTLIB= $(ROOT)/usr/lib
+ROOTFS_LIB= $(ROOT)/lib
+ROOTLIB64= $(ROOTLIB)/$(MACH64)
+ROOTFS_LIB64= $(ROOTFS_LIB)/$(MACH64)
+
+ROOTVARIANTDIR= $(ROOTLIB)/libc
+
+ROOTFS_LINTDIR= $(ROOTFS_LIB)
+ROOTFS_LINTDIR64= $(ROOTFS_LIB64)
+ROOTFS_LINTLIB= $(ROOTFS_LINTDIR)/$(LINTLIB)
+ROOTFS_LINTLIB64= $(ROOTFS_LINTDIR64)/$(LINTLIB)
+
+# include common library definitions
+include ../Makefile.lib
+
+#
+# on some architectures, we build multiple libc variants
+#
+VAR1 = hwcap1
+VAR2 = hwcap2
+
+VAR1_DYNLIB = $(LIBRARY:%.a=%_$(VAR1).so$(VERS))
+VAR1_BLDDIR = $(MACH)_$(VAR1)
+VAR2_DYNLIB = $(LIBRARY:%.a=%_$(VAR2).so$(VERS))
+VAR2_BLDDIR = $(MACH)_$(VAR2)
+
+i386_VARIANTS= $(VAR1) $(VAR2)
+sparc_VARIANTS=
+
+VARIANTS= $($(MACH)_VARIANTS)
+VARIANT_SUBDIRS = $(VARIANTS:%=$(MACH)_%)
+
+SUBDIRS= $(MACH) $(VARIANT_SUBDIRS)
+$(BUILD64)SUBDIRS += $(MACH64)
+
+LIBS = $(DYNLIB) $(LINTLIB)
+
+ROOTLIBS64= $(ROOTLIBDIR64)/$(DYNLIB) $(ROOTLIBDIR64)/$(LINTLIB)
+MACHLIBS64= $(MACH64)/$(DYNLIB) $(MACH64)/$(LINTLIB)
+VARIANTLIBS= $(VARIANTS:%=$(MACH)_%/$(LIBBASENAME)_%.so.1)
+ROOTVARIANTLIBS= $(VARIANTS:%=$(ROOTVARIANTDIR)/$(LIBBASENAME)_%.so.1)
+
+# definitions for install_h target
+BASEHDRS= getxby_door.h
+CHECKHDRS= $(BASEHDRS:%.h=port/gen/%.check)
+HDRS= $(BASEHDRS)
+
+# install rules for install_h target
+$(ROOTHDRDIR)/%: port/gen/%
+ $(INS.file)
+
+$(ROOTLIBDIR)/$(DYNLIB) := FILEMODE = 755
+$(ROOTLIBDIR64)/$(DYNLIB) := FILEMODE = 755
+$(ROOTFS_LIBDIR)/$(DYNLIB) := FILEMODE = 755
+$(ROOTFS_LIBDIR64)/$(DYNLIB) := FILEMODE = 755
+
+$(ROOTVARIANTDIR) := FILEMODE= 755
+$(ROOTVARIANTDIR)/$(VAR1_DYNLIB) := FILEMODE= 755
+$(ROOTVARIANTDIR)/$(VAR2_DYNLIB) := FILEMODE= 755
+
+.KEEP_STATE:
+
+all: spec .WAIT lib32 $(BUILD64) .WAIT lib64
+
+lib32: $(MACHLIBS) $(MACH)/$(LIB_PIC) $(VARIANTLIBS)
+
+lib64: $(MACHLIBS64) $(MACH64)/$(LIB_PIC) $(VARIANTLIBS)
+
+$(VARIANTLIBS): FRC
+ @cd $(@D); pwd; VERSION='$(VERSION)' $(MAKE) $(@F)
+
+install: all \
+ spec \
+ inslib32 \
+ $(BUILD64) inslib64
+
+inslib32: $(ROOTFS_LIBS) $(ROOTFS_LINKS) $(ROOTFS_LINT) \
+ $(ROOTFS_LINTLIB) \
+ $(ROOTVARIANTLIBS)
+
+inslib64: $(ROOTFS_LIBS64) $(ROOTFS_LINKS64) \
+ $(ROOTFS_LINTLIB64)
+
+install_h: $(ROOTHDRS)
+
+check: $(CHECKHDRS)
+
+$(ROOTFS_LIB)/%: $(MACH)/%
+ $(INS.file)
+$(ROOTFS_LIBDIR)/$(LIBLINKS): $(ROOTFS_LIBDIR)/$(LIBLINKS)$(VERS)
+ $(INS.liblink)
+$(ROOTFS_LIB64)/%: $(MACH64)/%
+ $(INS.file)
+$(ROOTFS_LIBDIR64)/$(LIBLINKS): $(ROOTFS_LIBDIR64)/$(LIBLINKS)$(VERS)
+ $(INS.liblink)
+
+$(ROOTVARIANTDIR): $(ROOTLIB)
+ $(INS.dir)
+$(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR1_BLDDIR)/%
+ $(INS.file)
+$(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR2_BLDDIR)/%
+ $(INS.file)
+
+# install rule for lint library target
+$(ROOTFS_LINTDIR)/%: port/%
+ $(INS.file)
+$(ROOTFS_LINTDIR64)/%: port/%
+ $(INS.file)
+$(ROOTFS_LINTDIR)/%: $(MACH)/%
+ $(INS.file)
+$(ROOTFS_LINTDIR64)/%: $(MACH64)/%
+ $(INS.file)
+
+$(LINTLIB):
+ @cd $(MACH); pwd; VERSION='$(VERSION)' $(MAKE) $@
+$(LINTLIB64):
+ @cd $(MACH64); pwd; VERSION='$(VERSION)' $(MAKE) $@
+
+$(MACH)/$(LIB_PIC): FRC
+ @cd $(MACH); pwd; VERSION='$(VERSION)' $(MAKE) $(LIB_PIC)
+$(MACH64)/$(LIB_PIC): FRC
+ @cd $(MACH64); pwd; VERSION='$(VERSION)' $(MAKE) $(LIB_PIC)
+
+all := TARGET= all
+install := TARGET= install
+clean := TARGET= clean
+clobber := TARGET= clobber
+lint := TARGET= lint
+
+.PARALLEL: $(SUBDIRS)
+
+spec $(SUBDIRS): FRC
+ @cd $@; pwd; VERSION='$(VERSION)' $(MAKE) $(TARGET)
+
+clean clobber: spec .WAIT $(SUBDIRS)
+
+lint: $(SUBDIRS)
+
+_msg: $(MSGDOMAIN) catalog
+
+catalog:
+ sh ./makelibccatalog.sh $(MSGDOMAIN)
+
+$(MSGDOMAIN):
+ $(INS.dir)
+
+ARCHITECTURES = $(MACH) $(BUILD64) $(MACH64)
+
+cscope.out tags: FRC
+ $(XREF) -x $@
+
+FRC:
+# include MACH-specific library targets
+include ../Makefile.mach