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# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28include		../../../../lib/Makefile.lib
29include		../../Makefile.com
30
31NO_ASM_WARN=	-erroff=E_ASM_DISABLES_OPTIMIZATION
32
33SGSPROTO=	../../proto/$(MACH)
34
35TRUSSLIB=	truss.so.1
36TRUSSSRC=	truss.c
37
38SYMBINDREP=	symbindrep.so.1
39SYMBINDREPSRC=	symbindrep.c
40
41PERFLIB=	perfcnt.so.1
42PERFSRC=	perfcnt.c hash.c
43
44WHOLIB=		who.so.1
45WHOSRC=		who.c
46
47BINDLIB=	bindings.so.1
48BINDSRC=	bindings.c
49
50ONSCRIPTS=	perfcnt symbindrep
51ONPROGS=	dumpbind
52ONLIBS=		$(SYMBINDREP) $(PERFLIB) $(BINDLIB)
53
54USRSCRIPTS=	sotruss whocalls
55CCSLIBS=	$(TRUSSLIB) $(WHOLIB)
56
57PICDIR=		pics
58OBJDIR=		objs
59
60TRUSSPICS=	$(TRUSSSRC:%.c=$(PICDIR)/%.o) $(PICDIR)/env.o
61PERFPICS=	$(PERFSRC:%.c=$(PICDIR)/%.o) $(PICDIR)/env.o
62WHOPICS=	$(WHOSRC:%.c=$(PICDIR)/%.o) $(PICDIR)/env.o
63SYMBINDREPPICS=	$(SYMBINDREPSRC:%.c=$(PICDIR)/%.o) $(PICDIR)/env.o
64BINDPICS=	$(BINDSRC:%.c=$(PICDIR)/%.o) $(PICDIR)/env.o
65
66$(WHOPICS):=	SEMANTICCHK=
67
68LDLIBS +=	$(CONVLIBDIR) $(CONV_LIB)
69
70# Building SUNWonld results in a call to the `package' target.  Requirements
71# needed to run this application on older releases are established:
72#   dlopen/dlclose requires libdl.so.1 prior to 5.10
73#
74DLLIB = $(VAR_DL_LIB)
75package	:=  DLLIB = $(VAR_PKG_DL_LIB)
76
77$(TRUSSLIB):=	PICS = $(TRUSSPICS)
78$(PERFLIB):=	PICS = $(PERFPICS)
79$(WHOLIB):=	PICS = $(WHOPICS)
80$(SYMBINDREP):=	PICS = $(SYMBINDREPPICS)
81$(BINDLIB):=	PICS = $(BINDPICS)
82
83$(TRUSSLIB):=	LDLIBS += $(ZRECORD) -lmapmalloc -lc
84$(PERFLIB):=	LDLIBS += $(ZRECORD) -lmapmalloc -lc
85$(WHOLIB):=	LDLIBS += $(ELFLIBDIR) -lelf $(ZRECORD) -lmapmalloc $(DLLIB) -lc
86$(SYMBINDREP):=	LDLIBS += $(ZRECORD) -lmapmalloc -lc
87$(BINDLIB):=	LDLIBS += $(ZRECORD) -lmapmalloc -lc
88
89$(TRUSSLIB):=	SONAME = $(TRUSSLIB)
90$(PERFLIB):=	SONAME = $(PERFLIB)
91$(WHOLIB):=	SONAME = $(WHOLIB)
92$(SYMBINDREP):=	SONAME = $(SYMBINDREP)
93$(BINDLIB):=	SONAME = $(BINDLIB)
94
95$(TRUSSLIB):=	MAPFILES = mapfile-vers-truss
96$(PERFLIB):=	MAPFILES = mapfile-vers-perfcnt
97$(WHOLIB):=	MAPFILES = mapfile-vers-who
98$(SYMBINDREP):=	MAPFILES = mapfile-vers-symbindrep
99$(BINDLIB):=	MAPFILES = mapfile-vers-bindings
100
101$(ROOTCCSLIB) :=	OWNER =		root
102$(ROOTCCSLIB) :=	GROUP =		bin
103$(ROOTCCSLIB) :=	DIRMODE =	755
104
105CPPFLAGS +=	-D_REENTRANT
106LDFLAGS +=	$(USE_PROTO)
107DYNFLAGS +=	$(VERSREF)
108
109LINTFLAGS +=	-uaxs $(LDLIBS)
110LINTFLAGS64 +=	-uaxs $(LDLIBS)
111
112CLEANFILES +=	$(LINTOUT) $(OBJDIR)/* $(PICDIR)/*
113CLOBBERFILES +=	$(ONSCRIPTS) $(ONPROGS) $(ONLIBS) $(CCSLIBS) $(USRSCRIPTS)
114
115ROOTONLDLIB=		$(ROOT)/opt/SUNWonld/lib
116ROOTONLDLIBS=		$(ONLIBS:%=$(ROOTONLDLIB)/%)
117ROOTONLDLIB64=		$(ROOTONLDLIB)/$(MACH64)
118ROOTONLDLIBS64=		$(ONLIBS:%=$(ROOTONLDLIB64)/%)
119
120ROOTONLDBIN=		$(ROOT)/opt/SUNWonld/bin
121ROOTONLDBINPROG=	$(ONSCRIPTS:%=$(ROOTONLDBIN)/%) \
122			$(ONPROGS:%=$(ROOTONLDBIN)/%)
123
124ROOTCCSLIB=		$(ROOT)/usr/lib/link_audit
125ROOTCCSLIB64=		$(ROOT)/usr/lib/link_audit/$(MACH64)
126ROOTCCSLIBS=		$(CCSLIBS:%=$(ROOTCCSLIB)/%)
127ROOTCCSLIBS64=		$(CCSLIBS:%=$(ROOTCCSLIB64)/%)
128
129ROOTUSRBIN=		$(ROOT)/usr/bin
130ROOTUSRBINS=		$(USRSCRIPTS:%=$(ROOTUSRBIN)/%)
131
132FILEMODE=	0755
133
134.PARALLEL:	$(LIBS) $(PROGS) $(SCRIPTS) $(TRUSSPICS) $(PERFPICS) \
135		$(WHOPICS) $(SYMBINDREPPICS) $(BINDPICS)
136