Print this page
XXX Remove nawk(1)

Split Close
Expand all
Collapse all
          --- old/usr/src/common/mapfiles/gen/Makefile
          +++ new/usr/src/common/mapfiles/gen/Makefile
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16  # fields enclosed by brackets "[]" replaced with your own identifying
  17   17  # information: Portions Copyright [yyyy] [name of copyright owner]
  18   18  #
  19   19  # CDDL HEADER END
  20   20  #
  21   21  
  22   22  #
  23   23  # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  24   24  # Use is subject to license terms.
  25   25  #
  26      -# ident "%Z%%M% %I%     %E% SMI"
  27      -#
  28   26  
  29   27  include         $(SRC)/Makefile.master
  30   28  
  31   29  FILES=  \
  32   30                  $(MACH)_cc_map.noexeglobs \
  33   31                  $(MACH)_gcc_map.noexeglobs
  34   32  
  35   33  $(BUILD64)FILES += \
  36   34                  $(MACH64)_cc_map.noexeglobs \
  37   35                  $(MACH64)_gcc_map.noexeglobs
↓ open down ↓ 53 lines elided ↑ open up ↑
  91   89  # locals.  Within both executables, some symbols remain globals (_end, _etext,
  92   90  # etc.) as the link-editor has special knowledge of these symbols and their
  93   91  # expected visibility requirements.  By inspecting the deferences between the
  94   92  # global symbols within the two executables, a mapfile can be generated to
  95   93  # ensure the symbols defined by the compilation environments files remain
  96   94  # global.
  97   95  
  98   96  %map.noexeglobs:main.c $(TEMPLATE1) $(TEMPLATE2)
  99   97          $(LINK) -o $(MAIN1) -M$(TEMPLATE1) main.c
 100   98          $(ELFDUMP) -s -N.dynsym $(MAIN1) | $(EGREP) "WEAK|GLOB" | \
 101      -            $(GREP) -v UNDEF | $(NAWK) '{print $$9 }' | $(SORT) > $(SYMS1)
       99 +            $(GREP) -v UNDEF | $(AWK) '{print $$9 }' | $(SORT) > $(SYMS1)
 102  100          $(LINK) -o $(MAIN2) -M$(TEMPLATE2) main.c
 103  101          $(ELFDUMP) -s -N.dynsym $(MAIN2) | $(EGREP) "WEAK|GLOB" | \
 104      -            $(GREP) -v UNDEF | $(NAWK) '{print $$9 }' | $(SORT) > $(SYMS2)
      102 +            $(GREP) -v UNDEF | $(AWK) '{print $$9 }' | $(SORT) > $(SYMS2)
 105  103          $(ECHO) "# GENERATED FILE - DO NOT EDIT"        >  $@
 106  104          $(GREP) MAP-HEAD $(TEMPLATE2) | \
 107  105              $(SED) -e "s/       *# MAP-HEAD//"          >> $@
 108  106          $(DIFF) $(SYMS1) $(SYMS2) | $(GREP) "^<" | \
 109  107              $(SED) -e "s/^< \(.*\)/        \1;/"        >> $@
 110  108          $(GREP) MAP-TAIL $(TEMPLATE2) | \
 111  109              $(SED) -e "s/       *# MAP-TAIL//"          >> $@
 112  110          $(RM) $(SYMS1) $(SYMS2) $(MAIN1) $(MAIN2)
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX