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