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 (the "License").
   6 # You may not use this file except in compliance with the License.
   7 #
   8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9 # or http://www.opensolaris.org/os/licensing.
  10 # See the License for the specific language governing permissions
  11 # and limitations under the License.
  12 #
  13 # When distributing Covered Code, include this CDDL HEADER in each
  14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15 # If applicable, add the following below this CDDL HEADER, with the
  16 # fields enclosed by brackets "[]" replaced with your own identifying
  17 # information: Portions Copyright [yyyy] [name of copyright owner]
  18 #
  19 # CDDL HEADER END
  20 #
  21 #
  22 # Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  23 # Copyright 2014 Andrew Stormont.
  24 #
  25 
  26 # rebind basic build macros to 64-bit versions
  27 
  28 CFLAGS=         $(CFLAGS64)
  29 CCFLAGS=        $(CCFLAGS64)
  30 COPTFLAG=       $(COPTFLAG64)
  31 CCOPTFLAG=      $(CCOPTFLAG64)
  32 COMPILE.c=      $(COMPILE64.c)
  33 COMPILE.cc=     $(COMPILE64.cc)
  34 COMPILE.s=      $(COMPILE64.s)
  35 COMPILE.d=      $(COMPILE64.d)
  36 COMPILE.b=      $(COMPILE64.b)
  37 LINK.c=         $(LINK64.c)
  38 LINK.cc=        $(LINK64.cc)
  39 LINT.c=         $(LINT64.c)
  40 
  41 $(NOT_BUILD64)COMPILE.c=        /usr/bin/false
  42 $(NOT_BUILD64)COMPILE.cc=       /usr/bin/false
  43 $(NOT_BUILD64)COMPILE.s=        /usr/bin/false
  44 $(NOT_BUILD64)COMPILE.d=        /usr/bin/false
  45 $(NOT_BUILD64)COMPILE.b=        /usr/bin/false
  46 $(NOT_BUILD64)LINK.c=           /usr/bin/false
  47 $(NOT_BUILD64)LINK.cc=          /usr/bin/false
  48 $(NOT_BUILD64)LINT.c=           /usr/bin/false
  49 
  50 CTF_FLAGS=      $(CTF_FLAGS_64)
  51 
  52 OFFSETS_CREATE= $(OFFSETS_CREATE64)
  53 
  54 #
  55 # Some library path hackery, to allow building of partial workspaces
  56 # and properly set the 64-bit library paths with 'ws'
  57 #
  58 LDLIBS1=        $(ENVLDLIBS1:%=%/$(MACH64))
  59 LDLIBS2=        $(ENVLDLIBS2:%=%/$(MACH64))
  60 LDLIBS3=        $(ENVLDLIBS3:%=%/$(MACH64))
  61 LDLIBS64 =      $(LDLIBS1) $(LDLIBS2) $(LDLIBS3)
  62 LDLIBS64 +=     $(ADJUNCT_PROTO:%=-L%/usr/lib/$(MACH64) -L%/lib/$(MACH64))
  63 #
  64 # Moved these up to the top level here, so they can be overridden
  65 #
  66 LDLIBS.cmd =    $(LDLIBS64)
  67 LDLIBS.lib =    $(LDLIBS64)
  68 
  69 #
  70 # Override Makefile.master's settings of SFWLIBDIR and GCCLIBDIR
  71 #
  72 SFWLIBDIR=      $(SFWLIBDIR64)
  73 GCCLIBDIR=      $(GCCLIBDIR64)
  74 
  75 #
  76 # Override Makefile.master's settings of CC, CCC, AS and LINT
  77 #
  78 CC=             $($(MACH64)_CC)
  79 CCC=            $($(MACH64)_CCC)
  80 CPP=            $($(MACH64)_CPP)
  81 AS=             $($(MACH64)_AS)
  82 LD=             $($(MACH64)_LD)
  83 LINT=           $($(MACH64)_LINT)
  84 
  85 $(NOT_BUILD64)CC=       /usr/bin/false
  86 $(NOT_BUILD64)CCC=      /usr/bin/false
  87 $(NOT_BUILD64)CPP=      /usr/bin/false
  88 $(NOT_BUILD64)AS=       /usr/bin/false
  89 $(NOT_BUILD64)LD=       /usr/bin/false
  90 $(NOT_BUILD64)LINT=     /usr/bin/false
  91 
  92 REAL_CC=        $(CW_CC_CMD:sh)
  93 REAL_CCC=       $(CW_CCC_CMD:sh)
  94 
  95 BUILD.SO=       $(CC) $(CFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
  96                 $(PICS) $(EXTPICS) -L $(ROOTLIBDIR64) $(LDLIBS)
  97 
  98 #
  99 # ld(1) requires the -64 option to create a 64-bit filter solely from a mapfile
 100 #
 101 MAPFILECLASS=   -64
 102 
 103 CCNEEDED =              -lCrun
 104 $(__GNUC64)CCNEEDED =   -L$(GCCLIBDIR) -lstdc++
 105 $(__GNUC64)CCNEEDED +=  -lgcc_s
 106 
 107 BUILDCCC.SO=    $(CCC) $(CCFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
 108                 $(PICS) $(EXTPICS) $(LDLIBS) $(CCNEEDED)
 109 MAPFILE.NGB =   $(MAPFILE.NGB_$(MACH64))