xref: /titanic_44/usr/src/cmd/sgs/elfedit/modules/Makefile.com (revision b5a2d8455dfa3190fc977c4bec53e91c99012767)
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 2007 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
31CAP_LIB=	cap.so
32CAP_OBJ=	cap_msg.o cap32.o cap64.o
33
34DYN_LIB=	dyn.so
35DYN_OBJ=	dyn_msg.o dyn32.o dyn64.o
36
37EHDR_LIB=	ehdr.so
38EHDR_OBJ=	ehdr_msg.o ehdr32.o ehdr64.o
39
40PHDR_LIB=	phdr.so
41PHDR_OBJ=	phdr_msg.o phdr32.o phdr64.o
42
43SHDR_LIB=	shdr.so
44SHDR_OBJ=	shdr_msg.o shdr32.o shdr64.o
45
46STR_LIB=	str.so
47STR_OBJ=	str_msg.o str32.o str64.o
48
49SYM_LIB=	sym.so
50SYM_OBJ=	sym_msg.o sym32.o sym64.o
51
52SYMINFO_LIB=	syminfo.so
53SYMINFO_OBJ=	syminfo_msg.o syminfo32.o syminfo64.o
54
55ELFEDITLIBS=	$(CAP_LIB) $(DYN_LIB) $(EHDR_LIB) $(PHDR_LIB) \
56		$(SHDR_LIB) $(STR_LIB) $(SYM_LIB) $(SYMINFO_LIB)
57
58PICDIR=		pics
59
60CAP_PICS=	$(CAP_OBJ:%.o=$(PICDIR)/%.o)
61DYN_PICS=	$(DYN_OBJ:%.o=$(PICDIR)/%.o)
62EHDR_PICS=	$(EHDR_OBJ:%.o=$(PICDIR)/%.o)
63PHDR_PICS=	$(PHDR_OBJ:%.o=$(PICDIR)/%.o)
64SHDR_PICS=	$(SHDR_OBJ:%.o=$(PICDIR)/%.o)
65STR_PICS=	$(STR_OBJ:%.o=$(PICDIR)/%.o)
66SYM_PICS=	$(SYM_OBJ:%.o=$(PICDIR)/%.o)
67SYMINFO_PICS=	$(SYMINFO_OBJ:%.o=$(PICDIR)/%.o)
68
69LDLIBS +=	$(ELFLIBDIR) -lelf $(LDDBGLIBDIR) $(LDDBG_LIB) \
70		$(CONVLIBDIR) $(CONV_LIB) -lc
71
72$(CAP_LIB):=		PICS = $(CAP_PICS)
73$(DYN_LIB):=		PICS = $(DYN_PICS)
74$(EHDR_LIB):=		PICS = $(EHDR_PICS)
75$(PHDR_LIB):=		PICS = $(PHDR_PICS)
76$(SHDR_LIB):=		PICS = $(SHDR_PICS)
77$(STR_LIB):=		PICS = $(STR_PICS)
78$(SYM_LIB):=		PICS = $(SYM_PICS)
79$(SYMINFO_LIB):=	PICS = $(SYMINFO_PICS)
80
81$(CAP_LIB):=		SONAME = $(CAP_LIB)
82$(DYN_LIB):=		SONAME = $(DYN_LIB)
83$(EHDR_LIB):=		SONAME = $(EHDR_LIB)
84$(PHDR_LIB):=		SONAME = $(PHDR_LIB)
85$(SHDR_LIB):=		SONAME = $(SHDR_LIB)
86$(STR_LIB):=		SONAME = $(STR_LIB)
87$(SYM_LIB):=		SONAME = $(SYM_LIB)
88$(SYMINFO_LIB):=	SONAME = $(SYMINFO_LIB)
89
90# All the modules use a shared mapfile
91MAPFILES = ../common/mapfile-vers
92
93CPPFLAGS +=	-I../../../include -I../../../include/$(MACH) \
94		-I../$(SRCBASE)/lib/libc/inc  -D_REENTRANT
95LLDFLAGS =	'-R$$ORIGIN/../../../lib'
96LLDFLAGS64 =	'-R$$ORIGIN/../../../../lib/$(MACH64)'
97LDFLAGS +=	$(USE_PROTO) $(LLDFLAGS)
98DYNFLAGS +=	$(VERSREF)
99
100LINTFLAGS +=	-uaxs $(LDLIBS)
101LINTFLAGS64 +=	-uaxs $(LDLIBS64)
102
103BLTDEFS =	$(ELFEDITLIBS:%.so=%_msg.h)
104BLTDATA =	$(ELFEDITLIBS:%.so=%_msg.c)
105BLTFILES =	$(BLTDEFS) $(BLTDATA)
106
107CLEANFILES +=	$(BLTFILES) $(LINTOUT) $(PICDIR)/*
108CLOBBERFILES +=	$(ELFEDITLIBS)
109
110ROOTELFEDITDIR=		$(ROOT)/usr/lib/elfedit
111ROOTELFEDITDIR64=	$(ROOT)/usr/lib/elfedit/$(MACH64)
112ROOTELFEDITLIBS=	$(ROOTELFEDITDIR)/$(MTARG)$(CAP_LIB) \
113			$(ROOTELFEDITDIR)/$(MTARG)$(DYN_LIB) \
114			$(ROOTELFEDITDIR)/$(MTARG)$(EHDR_LIB) \
115			$(ROOTELFEDITDIR)/$(MTARG)$(PHDR_LIB) \
116			$(ROOTELFEDITDIR)/$(MTARG)$(SHDR_LIB) \
117			$(ROOTELFEDITDIR)/$(MTARG)$(STR_LIB) \
118			$(ROOTELFEDITDIR)/$(MTARG)$(SYM_LIB) \
119			$(ROOTELFEDITDIR)/$(MTARG)$(SYMINFO_LIB)
120
121
122FILEMODE=	0755
123
124.PARALLEL:	$(ELFEDITLIBS)
125