xref: /titanic_51/usr/src/cmd/sgs/elfedit/modules/Makefile.com (revision cf5b5989488984444a152faba2a8183a71dcf485)
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
46SYM_LIB=	sym.so
47SYM_OBJ=	sym_msg.o sym32.o sym64.o
48
49SYMINFO_LIB=	syminfo.so
50SYMINFO_OBJ=	syminfo_msg.o syminfo32.o syminfo64.o
51
52ELFEDITLIBS=	$(CAP_LIB) $(DYN_LIB) $(EHDR_LIB) $(PHDR_LIB) \
53		$(SHDR_LIB) $(SYM_LIB) $(SYMINFO_LIB)
54
55PICDIR=		pics
56
57CAP_PICS=	$(CAP_OBJ:%.o=$(PICDIR)/%.o)
58DYN_PICS=	$(DYN_OBJ:%.o=$(PICDIR)/%.o)
59EHDR_PICS=	$(EHDR_OBJ:%.o=$(PICDIR)/%.o)
60PHDR_PICS=	$(PHDR_OBJ:%.o=$(PICDIR)/%.o)
61SHDR_PICS=	$(SHDR_OBJ:%.o=$(PICDIR)/%.o)
62SYM_PICS=	$(SYM_OBJ:%.o=$(PICDIR)/%.o)
63SYMINFO_PICS=	$(SYMINFO_OBJ:%.o=$(PICDIR)/%.o)
64
65LDLIBS +=	$(ELFLIBDIR) -lelf $(LDDBGLIBDIR) $(LDDBG_LIB) \
66		$(CONVLIBDIR) $(CONV_LIB) -lc
67
68$(CAP_LIB):=		PICS = $(CAP_PICS)
69$(DYN_LIB):=		PICS = $(DYN_PICS)
70$(EHDR_LIB):=		PICS = $(EHDR_PICS)
71$(PHDR_LIB):=		PICS = $(PHDR_PICS)
72$(SHDR_LIB):=		PICS = $(SHDR_PICS)
73$(SYM_LIB):=		PICS = $(SYM_PICS)
74$(SYMINFO_LIB):=	PICS = $(SYMINFO_PICS)
75
76$(CAP_LIB):=		SONAME = $(CAP_LIB)
77$(DYN_LIB):=		SONAME = $(DYN_LIB)
78$(EHDR_LIB):=		SONAME = $(EHDR_LIB)
79$(PHDR_LIB):=		SONAME = $(PHDR_LIB)
80$(SHDR_LIB):=		SONAME = $(SHDR_LIB)
81$(SYM_LIB):=		SONAME = $(SYM_LIB)
82$(SYMINFO_LIB):=	SONAME = $(SYMINFO_LIB)
83
84# All the modules use a shared mapfile
85MAPFILES = ../common/mapfile-vers
86
87CPPFLAGS +=	-I../../../include -I../../../include/$(MACH) \
88		-I../$(SRCBASE)/lib/libc/inc  -D_REENTRANT
89LLDFLAGS =	'-R$$ORIGIN/../../../lib'
90LLDFLAGS64 =	'-R$$ORIGIN/../../../../lib/$(MACH64)'
91LDFLAGS +=	$(USE_PROTO) $(LLDFLAGS)
92DYNFLAGS +=	$(VERSREF)
93
94LINTFLAGS +=	-uaxs $(LDLIBS)
95LINTFLAGS64 +=	-uaxs $(LDLIBS64)
96
97BLTDEFS =	$(ELFEDITLIBS:%.so=%_msg.h)
98BLTDATA =	$(ELFEDITLIBS:%.so=%_msg.c)
99BLTFILES =	$(BLTDEFS) $(BLTDATA)
100
101CLEANFILES +=	$(BLTFILES) $(LINTOUT) $(PICDIR)/*
102CLOBBERFILES +=	$(ELFEDITLIBS)
103
104ROOTELFEDITDIR=		$(ROOT)/usr/lib/elfedit
105ROOTELFEDITDIR64=	$(ROOT)/usr/lib/elfedit/$(MACH64)
106ROOTELFEDITLIBS=	$(ROOTELFEDITDIR)/$(MTARG)$(CAP_LIB) \
107			$(ROOTELFEDITDIR)/$(MTARG)$(DYN_LIB) \
108			$(ROOTELFEDITDIR)/$(MTARG)$(EHDR_LIB) \
109			$(ROOTELFEDITDIR)/$(MTARG)$(PHDR_LIB) \
110			$(ROOTELFEDITDIR)/$(MTARG)$(SHDR_LIB) \
111			$(ROOTELFEDITDIR)/$(MTARG)$(SYM_LIB) \
112			$(ROOTELFEDITDIR)/$(MTARG)$(SYMINFO_LIB)
113
114
115FILEMODE=	0755
116
117.PARALLEL:	$(ELFEDITLIBS)
118