Print this page
    
NEX-3558 KRRP Integration
re #13842 make clobber leaves trash
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/cmd/devfsadm/Makefile.com
          +++ new/usr/src/cmd/devfsadm/Makefile.com
   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.
  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  # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  22   22  # Use is subject to license terms.
  23   23  #
  
    | 
      ↓ open down ↓ | 
    23 lines elided | 
    
      ↑ open up ↑ | 
  
  24   24  
  25   25  # This target builds both a command (daemon) and various shared objects.  This
  26   26  # isn't a typical target, and the inclusion of both library and command
  27   27  # Makefiles were probably not in their original design.  However, there doesn't
  28   28  # presently seem to be a clash of any required definitions.
  29   29  include ../../../lib/Makefile.lib
  30   30  include ../../Makefile.cmd
  31   31  
  32   32  COMMON = ..
  33   33  UTSBASE = $(COMMON)/../../uts
       34 +KRRPBASE = $(COMMON)/../../common
  34   35  
  35   36  DEVFSADM_MOD = devfsadm
  36   37  
  37   38  DEVALLOCSRC =   devalloc.c
  38   39  
  39   40  PLCYSRC = devpolicy.c plcysubr.c
  40   41  
  41   42  MODLOADDIR = $(COMMON)/../modload
  42   43  
  43   44  DEVFSADM_SRC = $(COMMON)/$(DEVFSADM_MOD:%=%.c) \
  44   45                  $(DEVALLOCSRC:%=$(COMMON)/%) $(PLCYSRC:%=$(COMMON)/%)
  45   46  DEVFSADM_OBJ = $(DEVFSADM_MOD:%=%.o) $(DEVALLOCSRC:%.c=%.o) $(PLCYSRC:%.c=%.o)
  46   47  
  47   48  DEVFSADM_DAEMON = devfsadmd
  48   49  
  49   50  LINKMOD_DIR = linkmod
  50   51  DEVFSADM_DIR = devfsadm
  51   52  
  52   53  CLOBBERFILES = $(MODS) $(DEVLINKTAB) $(DEVFSCOMPATLINKS) $(DEVFSADM_DAEMON)
  53   54  CLOBBERFILES += $(POFILE) $(POFILES) ../plcysubr.c
  54   55  
  55   56  LINK_OBJS_CMN =                 \
  56   57          disk_link.o             \
  57   58          ieee1394_link.o         \
  58   59          dcam1394_link.o         \
  59   60          tape_link.o             \
  60   61          usb_link.o              \
  61   62          port_link.o             \
  
    | 
      ↓ open down ↓ | 
    18 lines elided | 
    
      ↑ open up ↑ | 
  
  62   63          audio_link.o            \
  63   64          cfg_link.o              \
  64   65          misc_link.o             \
  65   66          lofi_link.o             \
  66   67          ramdisk_link.o          \
  67   68          fssnap_link.o           \
  68   69          sgen_link.o             \
  69   70          smp_link.o              \
  70   71          dtrace_link.o           \
  71   72          vscan_link.o            \
       73 +        krrp_link.o             \
  72   74          zfs_link.o              \
  73   75          zut_link.o
  74   76  
  75   77  LINK_OBJS =     $(LINK_OBJS_CMN) \
  76   78                  $(LINK_OBJS_$(MACH))
  77   79  
  78   80  LINK_SRCS =     $(LINK_OBJS_CMN:%.o=$(COMMON)/%.c) \
  79   81                  $(LINK_OBJS_$(MACH):%.o=%.c)
  80   82  
  81   83  LINT_MODULES = $(LINK_SRCS:%.c=%.ln)
  82   84  
  83   85  LINK_MODS =     $(LINK_OBJS:%.o=SUNW_%.so)
  84   86  
  85   87  DEVLINKTAB = devlink.tab
  86   88  DEVLINKTAB_SRC = $(COMMON)/$(DEVLINKTAB).sh
  87   89  
  88   90  COMPAT_LINKS = disks tapes ports audlinks devlinks drvconfig
  89   91  
  90   92  CPPFLAGS +=     -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
  91      -                -I$(COMMON) -I$(UTSBASE)/common -I$(MODLOADDIR)
       93 +                -I$(COMMON) -I$(UTSBASE)/common -I$(MODLOADDIR) -I$(KRRPBASE)
  92   94  CFLAGS += $(CCVERBOSE) $(C_PICFLAGS)
  93   95  
  94   96  LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2
  95   97  LINTFLAGS += -erroff=E_NAME_DEF_NOT_USED2
  96   98  LINTFLAGS += -erroff=E_NAME_MULTIPLY_DEF2
  97   99  
  98  100  CERRWARN += -_gcc=-Wno-uninitialized
  99  101  CERRWARN += -_gcc=-Wno-char-subscripts
 100  102  CERRWARN += -_gcc=-Wno-parentheses
 101  103  
 102  104  # Define the dependencies required by devfsadm and all shared objects.
 103  105  LDLIBS +=               -ldevinfo
 104  106  devfsadm :=             LDLIBS += -lgen -lsysevent -lnvpair -lzonecfg -lbsm
 105  107  SUNW_md_link.so :=      LDLIBS += -lmeta
 106  108  SUNW_disk_link.so :=    LDLIBS += -ldevid
 107  109  SUNW_sgen_link.so :=    LDLIBS += -ldevid
 108  110  
 109  111  # All libraries are built from the same SUNW_%.so rule (see below), and define
 110  112  # their own SONAME using -h explicitly.  Null the generic -h macro that gets
 111  113  # inherited from Makefile.lib, otherwise we'll get two -h definitions.
 112  114  HSONAME =
 113  115  
 114  116  SRCS = $(DEVFSADM_SRC) $(LINK_SRCS)
 115  117  OBJS = $(DEVFSADM_OBJ) $(LINK_OBJS)
 116  118  MODS = $(DEVFSADM_MOD) $(LINK_MODS)
 117  119  
 118  120  POFILES = $(LINK_SRCS:.c=.po) $(DEVFSADM_SRC:.c=.po)
 119  121  POFILE = pdevfsadm.po
 120  122  
 121  123  # install specifics
 122  124  
 123  125  ROOTLIB_DEVFSADM = $(ROOTLIB)/$(DEVFSADM_DIR)
 124  126  ROOTLIB_DEVFSADM_LINKMOD = $(ROOTLIB_DEVFSADM)/$(LINKMOD_DIR)
 125  127  
 126  128  ROOTLIB_DEVFSADM_LINK_MODS = $(LINK_MODS:%=$(ROOTLIB_DEVFSADM_LINKMOD)/%)
 127  129  
 128  130  ROOTUSRSBIN_COMPAT_LINKS = $(COMPAT_LINKS:%=$(ROOTUSRSBIN)/%)
 129  131  
 130  132  ROOTUSRSBIN_DEVFSADM = $(DEVFSADM_MOD:%=$(ROOTUSRSBIN)/%)
 131  133  
 132  134  ROOTLIB_DEVFSADM_DAEMON = $(ROOTLIB_DEVFSADM)/$(DEVFSADM_DAEMON)
 133  135  
 134  136  ROOTETC_DEVLINKTAB = $(DEVLINKTAB:%=$(ROOTETC)/%)
 135  137  
 136  138  FILEMODE= 755
 137  139  
 138  140  $(ROOTETC_DEVLINKTAB) := FILEMODE = 644
 139  141  
 140  142  all :=          TARGET= all
 141  143  install :=      TARGET= install
 142  144  clean :=        TARGET= clean
 143  145  clobber :=      TARGET= clobber
 144  146  lint :=         TARGET= lint
 145  147  
 146  148  
 147  149  .KEEP_STATE:
 148  150  
 149  151  all: $(MODS) $(DEVLINKTAB)
 150  152  
 151  153  install: all                            \
 152  154          $(ROOTLIB_DEVFSADM)             \
 153  155          $(ROOTLIB_DEVFSADM_LINKMOD)     \
 154  156          $(ROOTUSRSBIN_DEVFSADM)         \
 155  157          $(ROOTETC_DEVLINKTAB)           \
 156  158          $(ROOTLIB_DEVFSADM_LINK_MODS)   \
 157  159          $(ROOTUSRINCLUDE)               \
 158  160          $(ROOTLIB_DEVFSADM_DAEMON)      \
 159  161          $(ROOTUSRSBIN_COMPAT_LINKS)
 160  162  
 161  163  
 162  164  clean:
 163  165          $(RM) $(OBJS) 
 164  166  
 165  167  
 166  168  lint: $(DEVFSADM_MOD).ln $(LINT_MODULES)
 167  169  
 168  170  devfsadm.ln: $(DEVFSADM_SRC)
 169  171          $(LINT.c) $(DEVFSADM_SRC) $(LDLIBS)
 170  172  
 171  173  %.ln: $(DEVFSADM_SRC) %.c
 172  174          $(LINT.c) $(DEVFSADM_SRC) $(@:.ln=.c) $(LDLIBS)
 173  175  
 174  176  include ../../Makefile.targ
 175  177  
 176  178  $(POFILE):      $(POFILES)
 177  179          $(RM) $@; cat $(POFILES) > $@
 178  180  
 179  181  $(DEVFSADM_MOD): $(DEVFSADM_OBJ)
 180  182          $(LINK.c) -o $@ $< $(DEVFSADM_OBJ) $(LDLIBS)
 181  183          $(POST_PROCESS)
 182  184  
 183  185  SUNW_%.so: %.o $(MAPFILES)
 184  186          $(CC) -o $@ $(GSHARED) $(DYNFLAGS) -h $@ $< $(LDLIBS) -lc
 185  187          $(POST_PROCESS_SO)
 186  188  
 187  189  %.o: $(COMMON)/%.c
 188  190          $(COMPILE.c) -o $@ $< $(CTFCONVERT_HOOK)
 189  191          $(POST_PROCESS_O)
 190  192  
 191  193  
 192  194  $(DEVLINKTAB): $(DEVLINKTAB_SRC)
 193  195          $(RM) $(DEVLINKTAB)
 194  196          /bin/sh $(DEVLINKTAB_SRC) > $(DEVLINKTAB)
 195  197  
 196  198  $(ROOTUSRSBIN):
 197  199          $(INS.dir)
 198  200  
 199  201  $(ROOTLIB_DEVFSADM):
 200  202          $(INS.dir)
 201  203  
 202  204  $(ROOTUSRINCLUDE):
 203  205          $(INS.dir)
 204  206  
 205  207  $(ROOTLIB_DEVFSADM_LINKMOD):
 206  208          $(INS.dir)
 207  209  
 208  210  $(ROOTLIB_DEVFSADM_LINKMOD)/%: %
 209  211          $(INS.file)
 210  212  
 211  213  $(ROOTLIB_DEVFSADM_DAEMON):
 212  214          $(RM) $@; $(SYMLINK) ../../sbin/$(DEVFSADM_DIR) $@
 213  215  
 214  216  $(ROOTUSRSBIN_COMPAT_LINKS):    $(ROOTUSRSBIN_DEVFSADM)
 215  217          $(RM) $@ ; $(LN) $(ROOTUSRSBIN_DEVFSADM) $@
 216  218  
 217  219  #
 218  220  # Source shared with add_drv/update_drv
 219  221  #
 220  222  ../plcysubr.c:
 221  223          rm -f $@
 222  224          ln -s ../modload/plcysubr.c ..
  
    | 
      ↓ open down ↓ | 
    121 lines elided | 
    
      ↑ open up ↑ | 
  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX