Print this page
    
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/cmd/ptools/Makefile.bld
          +++ new/usr/src/cmd/ptools/Makefile.bld
   1    1  #
   2    2  # CDDL HEADER START
   3    3  #
   4    4  # The contents of this file are subject to the terms of the
   5    5  # Common Development and Distribution License (the "License").
   6    6  # You may not use this file except in compliance with the License.
   7    7  #
   8    8  # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9    9  # or http://www.opensolaris.org/os/licensing.
  10   10  # See the License for the specific language governing permissions
  11   11  # and limitations under the License.
  12   12  #
  13   13  # When distributing Covered Code, include this CDDL HEADER in each
  14   14  # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  
    | 
      ↓ open down ↓ | 
    14 lines elided | 
    
      ↑ open up ↑ | 
  
  15   15  # If applicable, add the following below this CDDL HEADER, with the
  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 2009 Sun Microsystems, Inc.  All rights reserved.
  24   24  # Use is subject to license terms.
  25      -# Copyright 2015 Joyent, Inc.
  26   25  #
  27   26  
  28   27  PROG:sh = basename `cd ..; pwd`
  29   28  
  30      -include ../../../Makefile.ctf
  31      -
  32   29  OBJS = $(PROG).o
  33   30  
  34   31  SRCS = ../$(PROG).c
  35   32  
  36   33  FILEMODE = 0555
  37   34  
  38   35  # libproc is added individually as pwait doesn't need it.
  39   36  # These are defined this way so lint can use them
  40   37  LDLIBS_pargs    = -lproc
  41   38  LDLIBS_pcred    = -lproc
  42   39  LDLIBS_pfiles   = -lproc -lnsl
  43   40  LDLIBS_pflags   = -lproc
  44   41  LDLIBS_pldd     = -lproc
  45   42  LDLIBS_plgrp    = -lproc -llgrp
  46   43  LDLIBS_pmap     = -lproc
  47   44  LDLIBS_pmadvise = -lproc
  48   45  LDLIBS_ppriv    = -lproc
  49   46  LDLIBS_preap    = -lproc
  50   47  LDLIBS_prun     = -lproc
  51   48  LDLIBS_psig     = -lproc
  52   49  LDLIBS_pstack   = -lproc -lc_db
  53   50  LDLIBS_pstop    = -lproc
  54   51  LDLIBS_ptime    = -lproc
  55   52  LDLIBS_ptree    = -lproc -lcontract
  56   53  LDLIBS_pwdx     = -lproc
  57   54  
  58   55  LDLIBS += $(LDLIBS_$(PROG))
  59   56  
  60   57  CERRWARN_plgrp  += -_gcc=-Wno-parentheses
  61   58  
  62   59  CERRWARN_ppriv  += -_gcc=-Wno-parentheses
  63   60  CERRWARN_ppriv  += -_gcc=-Wno-uninitialized
  64   61  
  65   62  CERRWARN_ptree  += -_gcc=-Wno-parentheses
  66   63  
  67   64  CERRWARN_pstack += -_gcc=-Wno-uninitialized
  68   65  CERRWARN_pstack += -_gcc=-Wno-clobbered
  69   66  
  70   67  CERRWARN_pargs  += -_gcc=-Wno-clobbered
  71   68  CERRWARN_pargs  += -_gcc=-Wno-type-limits
  72   69  
  73   70  CERRWARN += $(CERRWARN_$(PROG))
  74   71  
  75   72  #
  76   73  # Common code definitions
  77   74  #
  78   75  COBJS = ptools_common.o
  79   76  CINC = -I../../common
  80   77  
  81   78  # pargs depends on ../../common/elfcap components
  82   79  # pmadvise depends on pmap components
  83   80  
  84   81  ELFCAP =        $(SRC)/common/elfcap
  85   82  PMAP =          $(SRC)/cmd/ptools/pmap
  86   83  
  87   84  CPPFLAGS_pargs =        -I$(ELFCAP)
  88   85  OBJS_pargs =            elfcap.o
  89   86  SRCS_pargs =            $(ELFCAP)/elfcap.c
  90   87  
  91   88  CPPFLAGS_pmap =         -I$(PMAP) $(CINC)
  92   89  OBJS_pmap =             pmap_common.o $(COBJS)
  93   90  SRCS_pmap =             $(PMAP)/pmap_common.c
  94   91  
  95   92  CPPFLAGS_pmadvise =     -I$(PMAP) $(CINC)
  96   93  OBJS_pmadvise =         pmap_common.o $(COBJS)
  97   94  SRCS_pmadvise =         $(PMAP)/pmap_common.c
  98   95  
  99   96  CPPFLAGS_preap =        $(CINC)
 100   97  OBJS_preap =            $(COBJS)
 101   98  
 102   99  CPPFLAGS_psig =         $(CINC)
 103  100  OBJS_psig =             $(COBJS)
 104  101  
 105  102  CPPFLAGS_ptime =        $(CINC)
 106  103  OBJS_ptime =            $(COBJS)
  
    | 
      ↓ open down ↓ | 
    65 lines elided | 
    
      ↑ open up ↑ | 
  
 107  104  
 108  105  CPPFLAGS_ptree =        $(CINC)
 109  106  OBJS_ptree =            $(COBJS)
 110  107  
 111  108  CPPFLAGS_pwait =        $(CINC)
 112  109  OBJS_pwait =            $(COBJS)
 113  110  
 114  111  CPPFLAGS_pwdx =         $(CINC)
 115  112  OBJS_pwdx =             $(COBJS)
 116  113  
 117      -LN_pargs =              penv pauxv
 118      -
 119  114  CPPFLAGS +=     $(CPPFLAGS_$(PROG))
 120  115  OBJS +=         $(OBJS_$(PROG))
 121  116  SRCS +=         $(SRCS_$(PROG))
 122  117  
      118 +# For lint, always include ptools_common.c, but suppress the "defined but
      119 +# not used" error, in case a given ptool doesn't need it.
      120 +SRCS +=         ../../common/ptools_common.c
      121 +LINTFLAGS +=    -xerroff=E_NAME_DEF_NOT_USED2
      122 +LINTFLAGS64 +=  -xerroff=E_NAME_DEF_NOT_USED2
      123 +
 123  124  INSTALL_NEW=
 124  125  INSTALL_LEGACY=$(RM) $(ROOTPROCBINSYMLINK) ; \
 125  126          $(LN) -s ../../bin/$(PROG) $(ROOTPROCBINSYMLINK)
 126  127  
 127  128  .KEEP_STATE:
 128  129  
 129  130  elfcap.o:       $(ELFCAP)/elfcap.c
 130  131                  $(COMPILE.c) -o $@ $(ELFCAP)/elfcap.c
 131      -                $(POST_PROCESS_O)
 132  132  
 133  133  pmap_common.o:  $(PMAP)/pmap_common.c
 134  134                  $(COMPILE.c) -o $@ $(PMAP)/pmap_common.c
 135      -                $(POST_PROCESS_O)
 136  135  
 137  136  %.o:    ../%.c
 138  137          $(COMPILE.c) $<
 139      -        $(POST_PROCESS_O)
 140  138  
 141  139  %.o:    ../../common/%.c
 142  140          $(COMPILE.c) $<
 143  141          $(POST_PROCESS_O)
 144  142  
 145      -all:    $(PROG) $(LN_$(PROG))
      143 +all:    $(PROG)
 146  144  
 147      -ROOTBINLN=$(LN_$(PROG):%=$(ROOTBIN)/%)
 148  145  ROOTBINPROG=$(ROOTBIN)/$(PROG)
 149  146  ROOTPROCBINSYMLINK=$(ROOT)/usr/proc/bin/$(PROG)
 150  147  
 151  148  $(PROG): $$(OBJS)
 152  149          $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
 153  150          $(POST_PROCESS)
 154  151  
 155  152  #
 156  153  # Install the ptool, symlinking it into /usr/proc/bin if PTOOL_TYPE is set
 157  154  # to LEGACY.
 158  155  #
 159      -install: all $(ROOTISAPROG) $(ROOTISALN)
      156 +install: all $(ROOTISAPROG)
 160  157          -$(RM) $(ROOTBINPROG)
 161  158          -$(LN) $(ISAEXEC) $(ROOTBINPROG)
 162  159          -$(INSTALL_$(PTOOL_TYPE))
 163  160  
 164      -$(ROOTBINLN):
 165      -        -$(RM) $@
 166      -        -$(LN) $(ISAEXEC) $@
 167      -
 168      -$(ROOTISALN): $(ROOTISAPROG)
 169      -        -$(RM) $@
 170      -        -$(LN) $(ROOTISAPROG) $@
 171      -
 172      -$(LN_$(PROG)): $(PROG)
 173      -        -$(RM) $@
 174      -        -$(LN) $(PROG) $@
 175      -
 176  161  clean:
 177  162          $(RM) $(OBJS)
 178  163  
 179  164  lint:
 180  165          $(LINT.c) $(SRCS) $(LDLIBS)
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX