xref: /titanic_52/usr/src/cmd/sgs/libelf/Makefile.com (revision b6c3f7863936abeae522e48a13887dddeb691a45)
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
28LIBRARY=	libelf.a
29VERS=		.1
30M4=		m4
31
32MACHOBJS=
33COMOBJS=	ar.o		begin.o		cntl.o		cook.o \
34		data.o		end.o		fill.o		flag.o \
35		getarhdr.o	getarsym.o	getbase.o	getdata.o \
36		getehdr.o	getident.o	getphdr.o	getscn.o \
37		getshdr.o \
38		getphnum.o	getshnum.o	getshstrndx.o \
39		hash.o		input.o		kind.o \
40		ndxscn.o	newdata.o	newehdr.o	newphdr.o \
41		newscn.o	next.o		nextscn.o	output.o \
42		rand.o		rawdata.o	rawfile.o	rawput.o \
43		strptr.o	update.o	error.o		gelf.o \
44		clscook.o	checksum.o
45CLASSOBJS=	clscook64.o	newehdr64.o	newphdr64.o	update64.o
46BLTOBJS=	msg.o		xlate.o		xlate64.o
47MISCOBJS=	String.o	args.o		demangle.o	nlist.o \
48		nplist.o
49MISCOBJS64=	nlist.o
50
51OBJECTS=	$(BLTOBJS)  $(MACHOBJS)  $(COMOBJS)  $(CLASSOBJS) $(MISCOBJS)
52
53include $(SRC)/lib/Makefile.lib
54
55DEMOFILES=	Makefile	README		acom.c		dcom.c \
56		pcom.c		tpcom.c		dispsyms.c
57DEMOFILESRCDIR=	../demo
58ROOTDEMODIRBASE=$(ROOT)/usr/demo/ELF
59ROOTDEMODIRS=   $(ROOTDEMODIRBASE)
60
61include $(SRC)/cmd/sgs/Makefile.com
62
63WARLOCKFILES=	$(OBJECTS:%.o=wlocks/%.ll)
64
65MAPFILES =	../common/mapfile-common
66
67CLOBBERFILES +=
68
69DYNFLAGS +=	$(VERSREF)
70LDLIBS +=	$(CONVLIBDIR) $(CONV_LIB) $(VAR_LIBELF_LDLIBS) -lc
71
72LINTFLAGS +=	-u -erroff=E_BAD_PTR_CAST_ALIGN
73LINTFLAGS64 +=	-u -erroff=E_CAST_INT_TO_SMALL_INT
74
75BUILD.AR=	$(RM) $@ ; \
76		$(AR) q $@ `$(LORDER) $(OBJECTS:%=$(DIR)/%)| $(TSORT)`
77		$(POST_PROCESS_A)
78
79
80BLTDEFS=	msg.h
81BLTDATA=	msg.c
82BLTMESG=	$(SGSMSGDIR)/libelf
83
84BLTFILES=	$(BLTDEFS) $(BLTDATA) $(BLTMESG)
85
86SGSMSGCOM=	../common/libelf.msg
87SGSMSG32=	../common/libelf.32.msg
88SGSMSGTARG=	$(SGSMSGCOM)
89SGSMSGALL=	$(SGSMSGCOM) $(SGSMSG32)
90
91SGSMSGFLAGS1=	$(SGSMSGFLAGS) -m $(BLTMESG)
92SGSMSGFLAGS2=	$(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n libelf_msg
93
94BLTSRCS=	$(BLTOBJS:%.o=%.c)
95LIBSRCS=	$(COMOBJS:%.o=../common/%.c)  $(MISCOBJS:%.o=../misc/%.c) \
96		$(MACHOBJS:%.o=%.c)  $(BLTSRCS)
97SRCS=		../common/llib-lelf
98LINTSRCS=	$(LIBSRCS) ../common/lintsup.c
99
100ROOTFS_DYNLIB=		$(DYNLIB:%=$(ROOTFS_LIBDIR)/%)
101ROOTFS_LINTLIB=		$(LINTLIB:%=$(ROOTFS_LIBDIR)/%)
102
103ROOTFS_DYNLIB64=	$(DYNLIB:%=$(ROOTFS_LIBDIR64)/%)
104ROOTFS_LINTLIB64=	$(LINTLIB:%=$(ROOTFS_LIBDIR64)/%)
105
106$(ROOTFS_DYNLIB) :=	FILEMODE= 755
107$(ROOTFS_DYNLIB64) :=	FILEMODE= 755
108
109LIBS =		$(DYNLIB) $(LINTLIB)
110
111CLEANFILES +=	$(LINTOUTS) $(BLTSRCS) $(BLTFILES) $(WARLOCKFILES)
112
113.PARALLEL:	$(LIBS)
114