Print this page
Reduce lint
OS-3280 need a way to specify the root of a native system in the lx brand
OS-3279 lx brand should allow delegated datasets
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/ptools/Makefile.bld
          +++ new/usr/src/cmd/ptools/Makefile.bld
↓ open down ↓ 61 lines elided ↑ open up ↑
  62   62  CERRWARN_ptree  += -_gcc=-Wno-parentheses
  63   63  
  64   64  CERRWARN_pstack += -_gcc=-Wno-uninitialized
  65   65  CERRWARN_pstack += -_gcc=-Wno-clobbered
  66   66  
  67   67  CERRWARN_pargs  += -_gcc=-Wno-clobbered
  68   68  CERRWARN_pargs  += -_gcc=-Wno-type-limits
  69   69  
  70   70  CERRWARN += $(CERRWARN_$(PROG))
  71   71  
       72 +#
       73 +# Common code definitions
       74 +#
       75 +COBJS = ptools_common.o
       76 +CINC = -I../../common
       77 +
  72   78  # pargs depends on ../../common/elfcap components
  73   79  # pmadvise depends on pmap components
  74   80  
  75   81  ELFCAP =        $(SRC)/common/elfcap
  76   82  PMAP =          $(SRC)/cmd/ptools/pmap
  77   83  
  78   84  CPPFLAGS_pargs =        -I$(ELFCAP)
  79   85  OBJS_pargs =            elfcap.o
  80   86  SRCS_pargs =            $(ELFCAP)/elfcap.c
  81   87  
  82      -CPPFLAGS_pmap =         -I$(PMAP)
  83      -OBJS_pmap =             pmap_common.o
       88 +CPPFLAGS_pmap =         -I$(PMAP) $(CINC)
       89 +OBJS_pmap =             pmap_common.o $(COBJS)
  84   90  SRCS_pmap =             $(PMAP)/pmap_common.c
  85   91  
  86      -CPPFLAGS_pmadvise =     -I$(PMAP)
  87      -OBJS_pmadvise =         pmap_common.o
       92 +CPPFLAGS_pmadvise =     -I$(PMAP) $(CINC)
       93 +OBJS_pmadvise =         pmap_common.o $(COBJS)
  88   94  SRCS_pmadvise =         $(PMAP)/pmap_common.c
  89   95  
       96 +CPPFLAGS_preap =        $(CINC)
       97 +OBJS_preap =            $(COBJS)
       98 +
       99 +CPPFLAGS_psig =         $(CINC)
      100 +OBJS_psig =             $(COBJS)
      101 +
      102 +CPPFLAGS_ptime =        $(CINC)
      103 +OBJS_ptime =            $(COBJS)
      104 +
      105 +CPPFLAGS_ptree =        $(CINC)
      106 +OBJS_ptree =            $(COBJS)
      107 +
      108 +CPPFLAGS_pwait =        $(CINC)
      109 +OBJS_pwait =            $(COBJS)
      110 +
      111 +CPPFLAGS_pwdx =         $(CINC)
      112 +OBJS_pwdx =             $(COBJS)
      113 +
  90  114  CPPFLAGS +=     $(CPPFLAGS_$(PROG))
  91  115  OBJS +=         $(OBJS_$(PROG))
  92  116  SRCS +=         $(SRCS_$(PROG))
  93  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 +
  94  124  INSTALL_NEW=
  95  125  INSTALL_LEGACY=$(RM) $(ROOTPROCBINSYMLINK) ; \
  96  126          $(LN) -s ../../bin/$(PROG) $(ROOTPROCBINSYMLINK)
  97  127  
  98  128  .KEEP_STATE:
  99  129  
 100  130  elfcap.o:       $(ELFCAP)/elfcap.c
 101  131                  $(COMPILE.c) -o $@ $(ELFCAP)/elfcap.c
 102  132  
 103  133  pmap_common.o:  $(PMAP)/pmap_common.c
 104  134                  $(COMPILE.c) -o $@ $(PMAP)/pmap_common.c
 105  135  
 106  136  %.o:    ../%.c
 107  137          $(COMPILE.c) $<
 108  138  
      139 +%.o:    ../../common/%.c
      140 +        $(COMPILE.c) $<
      141 +        $(POST_PROCESS_O)
      142 +
 109  143  all:    $(PROG)
 110  144  
 111  145  ROOTBINPROG=$(ROOTBIN)/$(PROG)
 112  146  ROOTPROCBINSYMLINK=$(ROOT)/usr/proc/bin/$(PROG)
 113  147  
 114  148  $(PROG): $$(OBJS)
 115  149          $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
 116  150          $(POST_PROCESS)
 117  151  
 118  152  #
↓ open down ↓ 13 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX