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