Print this page




   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 #
  23 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 # Copyright 2015 Joyent, Inc.
  26 #
  27 
  28 PROG:sh = basename `cd ..; pwd`
  29 
  30 include ../../../Makefile.ctf
  31 
  32 OBJS = $(PROG).o
  33 
  34 SRCS = ../$(PROG).c
  35 
  36 FILEMODE = 0555
  37 
  38 # libproc is added individually as pwait doesn't need it.
  39 # These are defined this way so lint can use them
  40 LDLIBS_pargs    = -lproc
  41 LDLIBS_pcred    = -lproc
  42 LDLIBS_pfiles   = -lproc -lnsl
  43 LDLIBS_pflags   = -lproc
  44 LDLIBS_pldd     = -lproc
  45 LDLIBS_plgrp    = -lproc -llgrp
  46 LDLIBS_pmap     = -lproc
  47 LDLIBS_pmadvise = -lproc
  48 LDLIBS_ppriv    = -lproc
  49 LDLIBS_preap    = -lproc
  50 LDLIBS_prun     = -lproc
  51 LDLIBS_psig     = -lproc


  97 SRCS_pmadvise =         $(PMAP)/pmap_common.c
  98 
  99 CPPFLAGS_preap =        $(CINC)
 100 OBJS_preap =            $(COBJS)
 101 
 102 CPPFLAGS_psig =         $(CINC)
 103 OBJS_psig =             $(COBJS)
 104 
 105 CPPFLAGS_ptime =        $(CINC)
 106 OBJS_ptime =            $(COBJS)
 107 
 108 CPPFLAGS_ptree =        $(CINC)
 109 OBJS_ptree =            $(COBJS)
 110 
 111 CPPFLAGS_pwait =        $(CINC)
 112 OBJS_pwait =            $(COBJS)
 113 
 114 CPPFLAGS_pwdx =         $(CINC)
 115 OBJS_pwdx =             $(COBJS)
 116 
 117 LN_pargs =              penv pauxv
 118 
 119 CPPFLAGS +=     $(CPPFLAGS_$(PROG))
 120 OBJS +=         $(OBJS_$(PROG))
 121 SRCS +=         $(SRCS_$(PROG))
 122 






 123 INSTALL_NEW=
 124 INSTALL_LEGACY=$(RM) $(ROOTPROCBINSYMLINK) ; \
 125         $(LN) -s ../../bin/$(PROG) $(ROOTPROCBINSYMLINK)
 126 
 127 .KEEP_STATE:
 128 
 129 elfcap.o:       $(ELFCAP)/elfcap.c
 130                 $(COMPILE.c) -o $@ $(ELFCAP)/elfcap.c
 131                 $(POST_PROCESS_O)
 132 
 133 pmap_common.o:  $(PMAP)/pmap_common.c
 134                 $(COMPILE.c) -o $@ $(PMAP)/pmap_common.c
 135                 $(POST_PROCESS_O)
 136 
 137 %.o:    ../%.c
 138         $(COMPILE.c) $<
 139         $(POST_PROCESS_O)
 140 
 141 %.o:    ../../common/%.c
 142         $(COMPILE.c) $<
 143         $(POST_PROCESS_O)
 144 
 145 all:    $(PROG) $(LN_$(PROG))
 146 
 147 ROOTBINLN=$(LN_$(PROG):%=$(ROOTBIN)/%)
 148 ROOTBINPROG=$(ROOTBIN)/$(PROG)
 149 ROOTPROCBINSYMLINK=$(ROOT)/usr/proc/bin/$(PROG)
 150 
 151 $(PROG): $$(OBJS)
 152         $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
 153         $(POST_PROCESS)
 154 
 155 #
 156 # Install the ptool, symlinking it into /usr/proc/bin if PTOOL_TYPE is set
 157 # to LEGACY.
 158 #
 159 install: all $(ROOTISAPROG) $(ROOTISALN)
 160         -$(RM) $(ROOTBINPROG)
 161         -$(LN) $(ISAEXEC) $(ROOTBINPROG)
 162         -$(INSTALL_$(PTOOL_TYPE))
 163 
 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 clean:
 177         $(RM) $(OBJS)
 178 
 179 lint:
 180         $(LINT.c) $(SRCS) $(LDLIBS)


   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 #
  23 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.

  25 #
  26 
  27 PROG:sh = basename `cd ..; pwd`
  28 


  29 OBJS = $(PROG).o
  30 
  31 SRCS = ../$(PROG).c
  32 
  33 FILEMODE = 0555
  34 
  35 # libproc is added individually as pwait doesn't need it.
  36 # These are defined this way so lint can use them
  37 LDLIBS_pargs    = -lproc
  38 LDLIBS_pcred    = -lproc
  39 LDLIBS_pfiles   = -lproc -lnsl
  40 LDLIBS_pflags   = -lproc
  41 LDLIBS_pldd     = -lproc
  42 LDLIBS_plgrp    = -lproc -llgrp
  43 LDLIBS_pmap     = -lproc
  44 LDLIBS_pmadvise = -lproc
  45 LDLIBS_ppriv    = -lproc
  46 LDLIBS_preap    = -lproc
  47 LDLIBS_prun     = -lproc
  48 LDLIBS_psig     = -lproc


  94 SRCS_pmadvise =         $(PMAP)/pmap_common.c
  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 


 114 CPPFLAGS +=     $(CPPFLAGS_$(PROG))
 115 OBJS +=         $(OBJS_$(PROG))
 116 SRCS +=         $(SRCS_$(PROG))
 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 
 124 INSTALL_NEW=
 125 INSTALL_LEGACY=$(RM) $(ROOTPROCBINSYMLINK) ; \
 126         $(LN) -s ../../bin/$(PROG) $(ROOTPROCBINSYMLINK)
 127 
 128 .KEEP_STATE:
 129 
 130 elfcap.o:       $(ELFCAP)/elfcap.c
 131                 $(COMPILE.c) -o $@ $(ELFCAP)/elfcap.c

 132 
 133 pmap_common.o:  $(PMAP)/pmap_common.c
 134                 $(COMPILE.c) -o $@ $(PMAP)/pmap_common.c

 135 
 136 %.o:    ../%.c
 137         $(COMPILE.c) $<

 138 
 139 %.o:    ../../common/%.c
 140         $(COMPILE.c) $<
 141         $(POST_PROCESS_O)
 142 
 143 all:    $(PROG)
 144 

 145 ROOTBINPROG=$(ROOTBIN)/$(PROG)
 146 ROOTPROCBINSYMLINK=$(ROOT)/usr/proc/bin/$(PROG)
 147 
 148 $(PROG): $$(OBJS)
 149         $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
 150         $(POST_PROCESS)
 151 
 152 #
 153 # Install the ptool, symlinking it into /usr/proc/bin if PTOOL_TYPE is set
 154 # to LEGACY.
 155 #
 156 install: all $(ROOTISAPROG)
 157         -$(RM) $(ROOTBINPROG)
 158         -$(LN) $(ISAEXEC) $(ROOTBINPROG)
 159         -$(INSTALL_$(PTOOL_TYPE))
 160 












 161 clean:
 162         $(RM) $(OBJS)
 163 
 164 lint:
 165         $(LINT.c) $(SRCS) $(LDLIBS)