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