1 #
   2 # CDDL HEADER START
   3 #
   4 # The contents of this file are subject to the terms of the
   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 (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
  24 #
  25 
  26 include         ../../../../lib/Makefile.lib
  27 include         ../../Makefile.com
  28 
  29 NO_ASM_WARN=    -erroff=E_ASM_DISABLES_OPTIMIZATION
  30 
  31 TRUSSLIB=       truss.so.1
  32 TRUSSSRC=       truss.c
  33 
  34 SYMBINDREP=     symbindrep.so.1
  35 SYMBINDREPSRC=  symbindrep.c
  36 
  37 PERFLIB=        perfcnt.so.1
  38 PERFSRC=        perfcnt.c hash.c
  39 
  40 WHOLIB=         who.so.1
  41 WHOSRC=         who.c
  42 
  43 BINDLIB=        bindings.so.1
  44 BINDSRC=        bindings.c
  45 
  46 ONSCRIPTS=      perfcnt symbindrep
  47 ONPROGS=        dumpbind
  48 ONLIBS=         $(SYMBINDREP) $(PERFLIB) $(BINDLIB)
  49 
  50 USRSCRIPTS=     sotruss whocalls
  51 CCSLIBS=        $(TRUSSLIB) $(WHOLIB)
  52  
  53 PICDIR=         pics
  54 OBJDIR=         objs
  55 
  56 TRUSSPICS=      $(TRUSSSRC:%.c=$(PICDIR)/%.o) $(PICDIR)/env.o
  57 PERFPICS=       $(PERFSRC:%.c=$(PICDIR)/%.o) $(PICDIR)/env.o
  58 WHOPICS=        $(WHOSRC:%.c=$(PICDIR)/%.o) $(PICDIR)/env.o
  59 SYMBINDREPPICS= $(SYMBINDREPSRC:%.c=$(PICDIR)/%.o) $(PICDIR)/env.o
  60 BINDPICS=       $(BINDSRC:%.c=$(PICDIR)/%.o) $(PICDIR)/env.o
  61 
  62 $(WHOPICS):=    SEMANTICCHK=
  63 
  64 LDLIBS +=       $(CONVLIBDIR) $(CONV_LIB)
  65 
  66 $(TRUSSLIB):=   PICS = $(TRUSSPICS)
  67 $(PERFLIB):=    PICS = $(PERFPICS)
  68 $(WHOLIB):=     PICS = $(WHOPICS)
  69 $(SYMBINDREP):= PICS = $(SYMBINDREPPICS)
  70 $(BINDLIB):=    PICS = $(BINDPICS)
  71 
  72 $(TRUSSLIB):=   LDLIBS += $(ZRECORD) -lmapmalloc -lc
  73 $(PERFLIB):=    LDLIBS += $(ZRECORD) -lmapmalloc -lc
  74 $(WHOLIB):=     LDLIBS += $(ELFLIBDIR) -lelf $(ZRECORD) -lmapmalloc $(DLLIB) -lc
  75 $(SYMBINDREP):= LDLIBS += $(ZRECORD) -lmapmalloc -lc
  76 $(BINDLIB):=    LDLIBS += $(ZRECORD) -lmapmalloc -lc
  77 
  78 $(TRUSSLIB):=   SONAME = $(TRUSSLIB)
  79 $(PERFLIB):=    SONAME = $(PERFLIB)
  80 $(WHOLIB):=     SONAME = $(WHOLIB)
  81 $(SYMBINDREP):= SONAME = $(SYMBINDREP)
  82 $(BINDLIB):=    SONAME = $(BINDLIB)
  83 
  84 $(TRUSSLIB):=   MAPFILES = ../common/mapfile-vers-truss
  85 $(PERFLIB):=    MAPFILES = ../common/mapfile-vers-perfcnt
  86 $(WHOLIB):=     MAPFILES = ../common/mapfile-vers-who
  87 $(SYMBINDREP):= MAPFILES = ../common/mapfile-vers-symbindrep
  88 $(BINDLIB):=    MAPFILES = ../common/mapfile-vers-bindings
  89 
  90 $(ROOTCCSLIB) :=        DIRMODE =       755
  91 
  92 CPPFLAGS +=     -D_REENTRANT
  93 LDFLAGS +=      $(CC_USE_PROTO)
  94 DYNFLAGS +=     $(VERSREF)
  95 
  96 LINTFLAGS +=    -uaxs $(LDLIBS)
  97 LINTFLAGS64 +=  -uaxs $(LDLIBS)
  98 
  99 CLEANFILES +=   $(LINTOUT) $(OBJDIR)/* $(PICDIR)/*
 100 CLOBBERFILES += $(ONSCRIPTS) $(ONPROGS) $(ONLIBS) $(CCSLIBS) $(USRSCRIPTS)
 101 
 102 ROOTONLDLIB=            $(ROOT)/opt/SUNWonld/lib
 103 ROOTONLDLIBS=           $(ONLIBS:%=$(ROOTONLDLIB)/%)
 104 ROOTONLDLIB64=          $(ROOTONLDLIB)/$(MACH64)
 105 ROOTONLDLIBS64=         $(ONLIBS:%=$(ROOTONLDLIB64)/%)
 106 
 107 ROOTONLDBIN=            $(ROOT)/opt/SUNWonld/bin
 108 ROOTONLDBINPROG=        $(ONSCRIPTS:%=$(ROOTONLDBIN)/%) \
 109                         $(ONPROGS:%=$(ROOTONLDBIN)/%)
 110 
 111 ROOTCCSLIB=             $(ROOT)/usr/lib/link_audit
 112 ROOTCCSLIB64=           $(ROOT)/usr/lib/link_audit/$(MACH64)
 113 ROOTCCSLIBS=            $(CCSLIBS:%=$(ROOTCCSLIB)/%)
 114 ROOTCCSLIBS64=          $(CCSLIBS:%=$(ROOTCCSLIB64)/%)
 115 
 116 ROOTUSRBIN=             $(ROOT)/usr/bin
 117 ROOTUSRBINS=            $(USRSCRIPTS:%=$(ROOTUSRBIN)/%)
 118 
 119 FILEMODE=       0755
 120 
 121 .PARALLEL:      $(LIBS) $(PROGS) $(SCRIPTS) $(TRUSSPICS) $(PERFPICS) \
 122                 $(WHOPICS) $(SYMBINDREPPICS) $(BINDPICS)