1# 2# CDDL HEADER START 3# 4# The contents of this file are subject to the terms of the 5# Common Development and Distribution License, Version 1.0 only 6# (the "License"). You may not use this file except in compliance 7# with the License. 8# 9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10# or http://www.opensolaris.org/os/licensing. 11# See the License for the specific language governing permissions 12# and limitations under the License. 13# 14# When distributing Covered Code, include this CDDL HEADER in each 15# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16# If applicable, add the following below this CDDL HEADER, with the 17# fields enclosed by brackets "[]" replaced with your own identifying 18# information: Portions Copyright [yyyy] [name of copyright owner] 19# 20# CDDL HEADER END 21# 22# 23# Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24# Use is subject to license terms. 25# 26# ident "%Z%%M% %I% %E% SMI" 27# 28 29LIBBASENAME= libc 30LIBRARY= $(LIBBASENAME:%=%.a) 31VERS= .1 32 33# Note that we build libc_pic.a for the benefit of building 34# ld.so.1, but we do not install it. Only ld.so.1 needs it 35# and it must be built in the same workspace as libc. 36LIB_PIC= libc_pic.a 37 38ROOTLIB= $(ROOT)/usr/lib 39ROOTFS_LIB= $(ROOT)/lib 40ROOTLIB64= $(ROOTLIB)/$(MACH64) 41ROOTFS_LIB64= $(ROOTFS_LIB)/$(MACH64) 42 43ROOTVARIANTDIR= $(ROOTLIB)/libc 44 45ROOTFS_LINTDIR= $(ROOTFS_LIB) 46ROOTFS_LINTDIR64= $(ROOTFS_LIB64) 47ROOTFS_LINTLIB= $(ROOTFS_LINTDIR)/$(LINTLIB) 48ROOTFS_LINTLIB64= $(ROOTFS_LINTDIR64)/$(LINTLIB) 49 50# include common library definitions 51include ../Makefile.lib 52 53# 54# on some architectures, we build multiple libc variants 55# 56VAR1 = hwcap1 57VAR2 = hwcap2 58 59VAR1_DYNLIB = $(LIBRARY:%.a=%_$(VAR1).so$(VERS)) 60VAR1_BLDDIR = $(MACH)_$(VAR1) 61VAR2_DYNLIB = $(LIBRARY:%.a=%_$(VAR2).so$(VERS)) 62VAR2_BLDDIR = $(MACH)_$(VAR2) 63 64i386_VARIANTS= $(VAR1) $(VAR2) 65sparc_VARIANTS= 66 67i386_ETC= $(MACH)/etc 68sparc_ETC= 69 70VARIANTS= $($(MACH)_VARIANTS) 71VARIANT_SUBDIRS = $(VARIANTS:%=$(MACH)_%) 72 73SUBDIRS= $(MACH) $(MACH_ETC) $(VARIANT_SUBDIRS) 74$(BUILD64)SUBDIRS += $(MACH64) 75 76LIBS = $(DYNLIB) $(LINTLIB) 77 78ROOTLIBS64= $(ROOTLIBDIR64)/$(DYNLIB) $(ROOTLIBDIR64)/$(LINTLIB) 79MACHLIBS64= $(MACH64)/$(DYNLIB) $(MACH64)/$(LINTLIB) 80VARIANTLIBS= $(VARIANTS:%=$(MACH)_%/$(LIBBASENAME)_%.so.1) 81ROOTVARIANTLIBS= $(VARIANTS:%=$(ROOTVARIANTDIR)/$(LIBBASENAME)_%.so.1) 82 83# definitions for install_h target 84BASEHDRS= getxby_door.h 85CHECKHDRS= $(BASEHDRS:%.h=port/gen/%.check) 86HDRS= $(BASEHDRS) 87 88# install rules for install_h target 89$(ROOTHDRDIR)/%: port/gen/% 90 $(INS.file) 91 92$(ROOTLIBDIR)/$(DYNLIB) := FILEMODE = 755 93$(ROOTLIBDIR64)/$(DYNLIB) := FILEMODE = 755 94$(ROOTFS_LIBDIR)/$(DYNLIB) := FILEMODE = 755 95$(ROOTFS_LIBDIR64)/$(DYNLIB) := FILEMODE = 755 96 97$(ROOTVARIANTDIR) := FILEMODE= 755 98$(ROOTVARIANTDIR)/$(VAR1_DYNLIB) := FILEMODE= 755 99$(ROOTVARIANTDIR)/$(VAR2_DYNLIB) := FILEMODE= 755 100 101.KEEP_STATE: 102 103all: check_i18n .WAIT spec .WAIT lib32 $(BUILD64) .WAIT lib64 .WAIT etc 104 105check_i18n: 106 @if [ ! -f $(ROOTFS_LIBDIR)/libc_i18n.a -a \ 107 ! -f $(ROOTFS_LIBDIR64)/libc_i18n.a ]; then \ 108 if [ "$$CLOSED_IS_PRESENT" = no ]; then \ 109 $(ECHO) "Warning: closed binaries not" \ 110 "properly unpacked." >&2;\ 111 $(ECHO) "Missing libc_i18n.a" >&2; \ 112 exit 1; \ 113 else \ 114 $(ECHO) "Warning: libc_i18n.a must be built" \ 115 "before libc can be built." >&2; \ 116 exit 1; \ 117 fi \ 118 fi 119 120etc: $($(MACH)_ETC) 121 122lib32: $(MACHLIBS) $(MACH)/$(LIB_PIC) $(VARIANTLIBS) 123 124lib64: $(MACHLIBS64) $(MACH64)/$(LIB_PIC) $(VARIANTLIBS) 125 126$(VARIANTLIBS): FRC 127 @cd $(@D); pwd; VERSION='$(VERSION)' $(MAKE) $(@F) 128 129$($(MACH)_ETC): FRC 130 @cd $(@); pwd; $(MAKE) $(TARGET) 131 132install: all \ 133 etc \ 134 spec \ 135 inslib32 \ 136 $(BUILD64) inslib64 137 138inslib32: $(ROOTFS_LIBS) $(ROOTFS_LINKS) $(ROOTFS_LINT) \ 139 $(ROOTFS_LINTLIB) \ 140 $(ROOTVARIANTLIBS) 141 142inslib64: $(ROOTFS_LIBS64) $(ROOTFS_LINKS64) \ 143 $(ROOTFS_LINTLIB64) 144 145install_h: $(ROOTHDRS) 146 147check: $(CHECKHDRS) 148 149$(ROOTFS_LIB)/%: $(MACH)/% 150 $(INS.file) 151$(ROOTFS_LIBDIR)/$(LIBLINKS): $(ROOTFS_LIBDIR)/$(LIBLINKS)$(VERS) 152 $(INS.liblink) 153$(ROOTFS_LIB64)/%: $(MACH64)/% 154 $(INS.file) 155$(ROOTFS_LIBDIR64)/$(LIBLINKS): $(ROOTFS_LIBDIR64)/$(LIBLINKS)$(VERS) 156 $(INS.liblink) 157 158$(ROOTVARIANTDIR): $(ROOTLIB) 159 $(INS.dir) 160$(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR1_BLDDIR)/% 161 $(INS.file) 162$(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR2_BLDDIR)/% 163 $(INS.file) 164 165# install rule for lint library target 166$(ROOTFS_LINTDIR)/%: port/% 167 $(INS.file) 168$(ROOTFS_LINTDIR64)/%: port/% 169 $(INS.file) 170$(ROOTFS_LINTDIR)/%: $(MACH)/% 171 $(INS.file) 172$(ROOTFS_LINTDIR64)/%: $(MACH64)/% 173 $(INS.file) 174 175$(LINTLIB): 176 @cd $(MACH); pwd; VERSION='$(VERSION)' $(MAKE) $@ 177$(LINTLIB64): 178 @cd $(MACH64); pwd; VERSION='$(VERSION)' $(MAKE) $@ 179 180$(MACH)/$(LIB_PIC): FRC 181 @cd $(MACH); pwd; VERSION='$(VERSION)' $(MAKE) $(LIB_PIC) 182$(MACH64)/$(LIB_PIC): FRC 183 @cd $(MACH64); pwd; VERSION='$(VERSION)' $(MAKE) $(LIB_PIC) 184 185all := TARGET= all 186install := TARGET= install 187clean := TARGET= clean 188clobber := TARGET= clobber 189lint := TARGET= lint 190 191.PARALLEL: $(SUBDIRS) 192 193spec $(SUBDIRS): FRC 194 @cd $@; pwd; VERSION='$(VERSION)' $(MAKE) $(TARGET) 195 196clean clobber: spec .WAIT $(SUBDIRS) 197 198lint: $(SUBDIRS) 199 200_msg: $(MSGDOMAIN) catalog 201 202catalog: 203 sh ./makelibccatalog.sh $(MSGDOMAIN) 204 205$(MSGDOMAIN): 206 $(INS.dir) 207 208ARCHITECTURES = $(MACH) $(BUILD64) $(MACH64) 209 210cscope.out tags: FRC 211 $(XREF) -x $@ 212 213FRC: 214# include MACH-specific library targets 215include ../Makefile.mach 216