Print this page
lib: move compat links from targetdirs to proper makefiles


  28 
  29 LIBBASENAME=    libc
  30 LIBRARY=        $(LIBBASENAME:%=%.a)
  31 VERS=           .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.
  36 LIB_PIC= libc_pic.a
  37 
  38 ROOTLIB=        $(ROOT)/usr/lib
  39 ROOTFS_LIB=     $(ROOT)/lib
  40 ROOTLIB64=      $(ROOTLIB)/$(MACH64)
  41 ROOTFS_LIB64=   $(ROOTFS_LIB)/$(MACH64)
  42 
  43 ROOTVARIANTDIR= $(ROOTLIB)/libc
  44 ROOTVARIANTDIR64=       $(ROOTLIB64)/libc
  45 
  46 # include common library definitions
  47 include ../Makefile.lib

  48 
  49 #
  50 # on some architectures, we build multiple libc variants
  51 #
  52 VAR1 =          hwcap1
  53 VAR2 =          hwcap2
  54 VAR3 =          hwcap3
  55 
  56 VARBLD_1=       $(MACH:sparc=sparc)
  57 VARBLD=         $(VARBLD_1:i386=)
  58 
  59 VARBLD64_1=     $(MACH:sparc=sparcv9)
  60 VARBLD64=       $(VARBLD64_1:i386=)
  61 
  62 VAR1_DYNLIB =   $(LIBRARY:%.a=%_$(VAR1).so$(VERS))
  63 VAR1_BLDDIR =   $(MACH)_$(VAR1)/$(VARBLD)
  64 VAR2_DYNLIB =   $(LIBRARY:%.a=%_$(VAR2).so$(VERS))
  65 VAR2_BLDDIR =   $(MACH)_$(VAR2)/$(VARBLD)
  66 VAR3_DYNLIB =   $(LIBRARY:%.a=%_$(VAR3).so$(VERS))
  67 VAR3_BLDDIR =   $(MACH)_$(VAR3)/$(VARBLD)


  75 
  76 i386_COMP=
  77 sparc_COMP=     capabilities
  78 
  79 MACH_COMP=      $($(MACH)_COMP)
  80 
  81 i386_ETC=       $(MACH)/etc
  82 sparc_ETC=
  83 
  84 VARIANTS=       $($(MACH)_VARIANTS)
  85 VARIANT_SUBDIRS = $(VARIANTS:%=$(MACH)_%/$(VARBLD))
  86 
  87 VARIANTS64=     $($(MACH64)_VARIANTS)
  88 VARIANT_SUBDIRS64       = $(VARIANTS64:%=$(MACH)_%/$(VARBLD64))
  89 
  90 SUBDIRS=        $(MACH_CAP) $(MACH) $(MACH_ETC) $(VARIANT_SUBDIRS)
  91 $(BUILD64)SUBDIRS += $(MACH64) $(VARIANT_SUBDIRS64)
  92 
  93 LIBS =          $(DYNLIB)
  94 
  95 ROOTLIBS64=     $(ROOTLIBDIR64)/$(DYNLIB)
  96 MACHLIBS64=     $(MACH64)/$(DYNLIB)
  97 VARIANTLIBS=    $(VARIANTS:%=$(MACH)_%/$(VARBLD)/$(LIBBASENAME)_%.so.1)
  98 VARIANTLIBS64=  $(VARIANTS64:%=$(MACH)_%/$(VARBLD64)/$(LIBBASENAME)_%.so.1)
  99 ROOTVARIANTLIBS= $(VARIANTS:%=$(ROOTVARIANTDIR)/$(LIBBASENAME)_%.so.1)
 100 ROOTVARIANTLIBS64= $(VARIANTS64:%=$(ROOTVARIANTDIR64)/$(LIBBASENAME)_%.so.1)
 101 
 102 # definitions for install_h target
 103 BASEHDRS=       getxby_door.h
 104 CHECKHDRS=      $(BASEHDRS:%.h=port/gen/%.check)
 105 HDRS=           $(BASEHDRS)
 106 
 107 CLOBBERFILES += THIRDPARTYLICENSE extract-copyright
 108 
 109 # install rules for install_h target
 110 $(ROOTHDRDIR)/%: port/gen/%
 111         $(INS.file)
 112 
 113 $(ROOTLIBDIR)/$(DYNLIB) :=      FILEMODE = 755
 114 $(ROOTLIBDIR64)/$(DYNLIB) :=    FILEMODE = 755
 115 $(ROOTFS_LIBDIR)/$(DYNLIB)      :=      FILEMODE = 755
 116 $(ROOTFS_LIBDIR64)/$(DYNLIB)    :=      FILEMODE = 755
 117 
 118 $(ROOTVARIANTDIR)                       := FILEMODE= 755
 119 $(ROOTVARIANTDIR)/$(VAR1_DYNLIB)        := FILEMODE= 755
 120 $(ROOTVARIANTDIR)/$(VAR2_DYNLIB)        := FILEMODE= 755
 121 $(ROOTVARIANTDIR)/$(VAR3_DYNLIB)        := FILEMODE= 755
 122 
 123 $(ROOTVARIANTDIR64)                     := FILEMODE= 755
 124 $(ROOTVARIANTDIR64)/$(VAR1_DYNLIB64)    := FILEMODE= 755
 125 
 126 .KEEP_STATE:
 127 
 128 all:    all_h lib32 $(BUILD64) .WAIT lib64 .WAIT etc THIRDPARTYLICENSE
 129 
 130 THIRDPARTYLICENSE: extract-copyright
 131         $(RM) $@
 132         ./extract-copyright . > $@
 133 
 134 etc:    $($(MACH)_ETC)


 148         fi
 149 
 150 $(MACH)/assym.h $(MACH64)/assym.h:
 151         @cd $(@D); $(MAKE) assym.h
 152 
 153 $(VARIANTLIBS): FRC
 154         @cd $(@D); pwd; VERSION='$(VERSION)' $(MAKE) $(@F)
 155 
 156 $(VARIANTLIBS64): FRC
 157         @cd $(@D); pwd; VERSION='$(VERSION)' $(MAKE) $(@F)
 158 
 159 $($(MACH)_ETC): FRC
 160         @cd $(@); pwd; $(MAKE) $(TARGET)
 161 
 162 $($(MACH)_COMP): FRC
 163         @cd $(@); pwd; $(MAKE) $(TARGET)
 164 
 165 install:        all                     \
 166                 etc                     \
 167                 inslib32                \
 168                 $(BUILD64) inslib64


 169 
 170 inslib32:       $(ROOTFS_LIBS) $(ROOTFS_LINKS) $(ROOTVARIANTLIBS)
 171 
 172 inslib64:       $(ROOTFS_LIBS64) $(ROOTFS_LINKS64) $(ROOTVARIANTLIBS64)
 173 
 174 install_h: all_h $(ROOTHDRS)
 175 
 176 all_h:  $(MACH)/assym.h $(MACH64)/assym.h
 177 
 178 check:  $(CHECKHDRS)
 179 
 180 $(ROOTFS_LIB)/%: $(MACH)/%
 181         $(INS.file)
 182 $(ROOTFS_LIBDIR)/$(LIBLINKS): $(ROOTFS_LIBDIR)/$(LIBLINKS)$(VERS)
 183         $(INS.liblink)
 184 $(ROOTFS_LIB64)/%: $(MACH64)/%
 185         $(INS.file)
 186 $(ROOTFS_LIBDIR64)/$(LIBLINKS): $(ROOTFS_LIBDIR64)/$(LIBLINKS)$(VERS)
 187         $(INS.liblink)
 188 
 189 $(ROOTVARIANTDIR): $(ROOTLIB)
 190         $(INS.dir)
 191 $(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR1_BLDDIR)/%
 192         $(INS.file)
 193 $(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR2_BLDDIR)/%
 194         $(INS.file)
 195 $(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR3_BLDDIR)/%
 196         $(INS.file)
 197 
 198 $(ROOTVARIANTDIR64): $(ROOTLIB64)
 199         $(INS.dir)
 200 $(ROOTVARIANTDIR64)/%: $(ROOTVARIANTDIR64) $(VAR1_BLDDIR64)/%
 201         $(INS.file)
 202 
 203 $(MACH)/$(LIB_PIC): FRC
 204         @cd $(MACH); pwd; VERSION='$(VERSION)' $(MAKE) $(LIB_PIC)
 205 $(MACH64)/$(LIB_PIC): FRC
 206         @cd $(MACH64); pwd; VERSION='$(VERSION)' $(MAKE) $(LIB_PIC)
 207 
 208 all     :=      TARGET= all


 218 
 219 clean: $(SUBDIRS)
 220 clobber: $(SUBDIRS) etc clobber_local
 221 clobber_local:
 222         $(RM) $(CLOBBERFILES)
 223 
 224 lint:
 225 
 226 _msg:   $(MSGDOMAIN) catalog
 227 
 228 catalog:
 229         sh ./makelibccatalog.sh $(MSGDOMAIN)
 230 
 231 $(MSGDOMAIN):
 232         $(INS.dir)
 233 
 234 cscope.out tags: FRC
 235         $(XREF) -x $@
 236 
 237 FRC:

 238 # include MACH-specific library targets
 239 include ../Makefile.mach


  28 
  29 LIBBASENAME=    libc
  30 LIBRARY=        $(LIBBASENAME:%=%.a)
  31 VERS=           .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.
  36 LIB_PIC= libc_pic.a
  37 
  38 ROOTLIB=        $(ROOT)/usr/lib
  39 ROOTFS_LIB=     $(ROOT)/lib
  40 ROOTLIB64=      $(ROOTLIB)/$(MACH64)
  41 ROOTFS_LIB64=   $(ROOTFS_LIB)/$(MACH64)
  42 
  43 ROOTVARIANTDIR= $(ROOTLIB)/libc
  44 ROOTVARIANTDIR64=       $(ROOTLIB64)/libc
  45 
  46 # include common library definitions
  47 include ../Makefile.lib
  48 include ../Makefile.rootfs
  49 
  50 #
  51 # on some architectures, we build multiple libc variants
  52 #
  53 VAR1 =          hwcap1
  54 VAR2 =          hwcap2
  55 VAR3 =          hwcap3
  56 
  57 VARBLD_1=       $(MACH:sparc=sparc)
  58 VARBLD=         $(VARBLD_1:i386=)
  59 
  60 VARBLD64_1=     $(MACH:sparc=sparcv9)
  61 VARBLD64=       $(VARBLD64_1:i386=)
  62 
  63 VAR1_DYNLIB =   $(LIBRARY:%.a=%_$(VAR1).so$(VERS))
  64 VAR1_BLDDIR =   $(MACH)_$(VAR1)/$(VARBLD)
  65 VAR2_DYNLIB =   $(LIBRARY:%.a=%_$(VAR2).so$(VERS))
  66 VAR2_BLDDIR =   $(MACH)_$(VAR2)/$(VARBLD)
  67 VAR3_DYNLIB =   $(LIBRARY:%.a=%_$(VAR3).so$(VERS))
  68 VAR3_BLDDIR =   $(MACH)_$(VAR3)/$(VARBLD)


  76 
  77 i386_COMP=
  78 sparc_COMP=     capabilities
  79 
  80 MACH_COMP=      $($(MACH)_COMP)
  81 
  82 i386_ETC=       $(MACH)/etc
  83 sparc_ETC=
  84 
  85 VARIANTS=       $($(MACH)_VARIANTS)
  86 VARIANT_SUBDIRS = $(VARIANTS:%=$(MACH)_%/$(VARBLD))
  87 
  88 VARIANTS64=     $($(MACH64)_VARIANTS)
  89 VARIANT_SUBDIRS64       = $(VARIANTS64:%=$(MACH)_%/$(VARBLD64))
  90 
  91 SUBDIRS=        $(MACH_CAP) $(MACH) $(MACH_ETC) $(VARIANT_SUBDIRS)
  92 $(BUILD64)SUBDIRS += $(MACH64) $(VARIANT_SUBDIRS64)
  93 
  94 LIBS =          $(DYNLIB)
  95 
  96 ROOTLIBS64=     $(ROOTLIB64)/$(DYNLIB)
  97 MACHLIBS64=     $(MACH64)/$(DYNLIB)
  98 VARIANTLIBS=    $(VARIANTS:%=$(MACH)_%/$(VARBLD)/$(LIBBASENAME)_%.so.1)
  99 VARIANTLIBS64=  $(VARIANTS64:%=$(MACH)_%/$(VARBLD64)/$(LIBBASENAME)_%.so.1)
 100 ROOTVARIANTLIBS= $(VARIANTS:%=$(ROOTVARIANTDIR)/$(LIBBASENAME)_%.so.1)
 101 ROOTVARIANTLIBS64= $(VARIANTS64:%=$(ROOTVARIANTDIR64)/$(LIBBASENAME)_%.so.1)
 102 
 103 # definitions for install_h target
 104 BASEHDRS=       getxby_door.h
 105 CHECKHDRS=      $(BASEHDRS:%.h=port/gen/%.check)
 106 HDRS=           $(BASEHDRS)
 107 
 108 CLOBBERFILES += THIRDPARTYLICENSE extract-copyright
 109 
 110 # install rules for install_h target
 111 $(ROOTHDRDIR)/%: port/gen/%
 112         $(INS.file)
 113 
 114 $(ROOTLIB)/$(DYNLIB)    :=      FILEMODE = 755
 115 $(ROOTLIB64)/$(DYNLIB) :=       FILEMODE = 755
 116 $(ROOTFS_LIBDIR)/$(DYNLIB)      :=      FILEMODE = 755
 117 $(ROOTFS_LIBDIR64)/$(DYNLIB)    :=      FILEMODE = 755
 118 
 119 $(ROOTVARIANTDIR)                       := FILEMODE= 755
 120 $(ROOTVARIANTDIR)/$(VAR1_DYNLIB)        := FILEMODE= 755
 121 $(ROOTVARIANTDIR)/$(VAR2_DYNLIB)        := FILEMODE= 755
 122 $(ROOTVARIANTDIR)/$(VAR3_DYNLIB)        := FILEMODE= 755
 123 
 124 $(ROOTVARIANTDIR64)                     := FILEMODE= 755
 125 $(ROOTVARIANTDIR64)/$(VAR1_DYNLIB64)    := FILEMODE= 755
 126 
 127 .KEEP_STATE:
 128 
 129 all:    all_h lib32 $(BUILD64) .WAIT lib64 .WAIT etc THIRDPARTYLICENSE
 130 
 131 THIRDPARTYLICENSE: extract-copyright
 132         $(RM) $@
 133         ./extract-copyright . > $@
 134 
 135 etc:    $($(MACH)_ETC)


 149         fi
 150 
 151 $(MACH)/assym.h $(MACH64)/assym.h:
 152         @cd $(@D); $(MAKE) assym.h
 153 
 154 $(VARIANTLIBS): FRC
 155         @cd $(@D); pwd; VERSION='$(VERSION)' $(MAKE) $(@F)
 156 
 157 $(VARIANTLIBS64): FRC
 158         @cd $(@D); pwd; VERSION='$(VERSION)' $(MAKE) $(@F)
 159 
 160 $($(MACH)_ETC): FRC
 161         @cd $(@); pwd; $(MAKE) $(TARGET)
 162 
 163 $($(MACH)_COMP): FRC
 164         @cd $(@); pwd; $(MAKE) $(TARGET)
 165 
 166 install:        all                     \
 167                 etc                     \
 168                 inslib32                \
 169                 $(ROOTCOMPATLINKS)
 170 
 171 $(BUILD64)install: inslib64 $(ROOTCOMPATLINKS64)
 172 
 173 inslib32:       $(ROOTFS_LIBS) $(ROOTFS_LINKS) $(ROOTVARIANTLIBS)
 174 
 175 inslib64:       $(ROOTFS_LIBS64) $(ROOTFS_LINKS64) $(ROOTVARIANTLIBS64)
 176 
 177 install_h: all_h $(ROOTHDRS)
 178 
 179 all_h:  $(MACH)/assym.h $(MACH64)/assym.h
 180 
 181 check:  $(CHECKHDRS)
 182 









 183 $(ROOTVARIANTDIR): $(ROOTLIB)
 184         $(INS.dir)
 185 $(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR1_BLDDIR)/%
 186         $(INS.file)
 187 $(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR2_BLDDIR)/%
 188         $(INS.file)
 189 $(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR3_BLDDIR)/%
 190         $(INS.file)
 191 
 192 $(ROOTVARIANTDIR64): $(ROOTLIB64)
 193         $(INS.dir)
 194 $(ROOTVARIANTDIR64)/%: $(ROOTVARIANTDIR64) $(VAR1_BLDDIR64)/%
 195         $(INS.file)
 196 
 197 $(MACH)/$(LIB_PIC): FRC
 198         @cd $(MACH); pwd; VERSION='$(VERSION)' $(MAKE) $(LIB_PIC)
 199 $(MACH64)/$(LIB_PIC): FRC
 200         @cd $(MACH64); pwd; VERSION='$(VERSION)' $(MAKE) $(LIB_PIC)
 201 
 202 all     :=      TARGET= all


 212 
 213 clean: $(SUBDIRS)
 214 clobber: $(SUBDIRS) etc clobber_local
 215 clobber_local:
 216         $(RM) $(CLOBBERFILES)
 217 
 218 lint:
 219 
 220 _msg:   $(MSGDOMAIN) catalog
 221 
 222 catalog:
 223         sh ./makelibccatalog.sh $(MSGDOMAIN)
 224 
 225 $(MSGDOMAIN):
 226         $(INS.dir)
 227 
 228 cscope.out tags: FRC
 229         $(XREF) -x $@
 230 
 231 FRC:
 232 
 233 # include MACH-specific library targets
 234 include ../Makefile.mach