xref: /titanic_44/usr/src/cmd/sgs/libelf/Makefile.com (revision fe0e7ec4d916b05b52d8c7cc8a3e6a1b28e77b6f)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29LIBRARY=	libelf.a
30VERS=		.1
31M4=		m4
32
33MACHOBJS=
34COMOBJS=	ar.o		begin.o		cntl.o		cook.o \
35		data.o		end.o		fill.o		flag.o \
36		getarhdr.o	getarsym.o	getbase.o	getdata.o \
37		getehdr.o	getident.o	getphdr.o	getscn.o \
38		getshdr.o \
39		getphnum.o	getshnum.o	getshstrndx.o \
40		hash.o		input.o		kind.o \
41		ndxscn.o	newdata.o	newehdr.o	newphdr.o \
42		newscn.o	next.o		nextscn.o	output.o \
43		rand.o		rawdata.o	rawfile.o	rawput.o \
44		strptr.o	update.o	error.o		gelf.o \
45		clscook.o	checksum.o
46CLASSOBJS=	clscook64.o	newehdr64.o	newphdr64.o	update64.o
47BLTOBJS=	msg.o		xlate.o		xlate64.o
48MISCOBJS=	String.o	args.o		demangle.o	nlist.o \
49		nplist.o
50MISCOBJS64=	nlist.o
51
52OBJECTS=	$(BLTOBJS)  $(MACHOBJS)  $(COMOBJS)  $(CLASSOBJS) $(MISCOBJS)
53
54DEMOFILES=	Makefile	README		acom.c		dcom.c \
55		pcom.c		tpcom.c		dispsyms.c
56
57include $(SRC)/lib/Makefile.lib
58include $(SRC)/cmd/sgs/Makefile.com
59
60#
61# Do not compile the libelf.a objects with the -xF flag
62#
63$(OBJS) :=	XFFLAG=
64
65WARLOCKFILES=	$(OBJECTS:%.o=wlocks/%.ll)
66
67MAPFILE=	$(MAPDIR)/mapfile
68MAPFILES=	$(MAPFILE)
69MAPOPTS=	$(MAPFILES:%=-M%)
70
71CLOBBERFILES +=	$(MAPFILE)
72
73DYNFLAGS +=	$(VERSREF) $(MAPOPTS)
74LDLIBS +=	$(CONVLIBDIR) -lconv $(VAR_LIBELF_LDLIBS) -lc
75
76LINTFLAGS +=	-u -erroff=E_BAD_PTR_CAST_ALIGN
77LINTFLAGS64 +=	-u -erroff=E_CAST_INT_TO_SMALL_INT
78
79BUILD.AR=	$(RM) $@ ; \
80		$(AR) q $@ `$(LORDER) $(OBJECTS:%=$(DIR)/%)| $(TSORT)`
81		$(POST_PROCESS_A)
82
83
84BLTDEFS=	msg.h
85BLTDATA=	msg.c
86BLTMESG=	$(SGSMSGDIR)/libelf
87
88BLTFILES=	$(BLTDEFS) $(BLTDATA) $(BLTMESG)
89
90SGSMSGCOM=	../common/libelf.msg
91SGSMSG32=	../common/libelf.32.msg
92SGSMSGTARG=	$(SGSMSGCOM)
93SGSMSGALL=	$(SGSMSGCOM) $(SGSMSG32)
94
95SGSMSGFLAGS1=	$(SGSMSGFLAGS) -m $(BLTMESG)
96SGSMSGFLAGS2=	$(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n libelf_msg
97
98BLTSRCS=	$(BLTOBJS:%.o=%.c)
99LIBSRCS=	$(COMOBJS:%.o=../common/%.c)  $(MISCOBJS:%.o=../misc/%.c) \
100		$(MACHOBJS:%.o=%.c)  $(BLTSRCS)
101SRCS=		../common/llib-lelf
102LINTSRCS=	$(LIBSRCS) ../common/lintsup.c
103
104ROOTFS_DYNLIB=		$(DYNLIB:%=$(ROOTFS_LIBDIR)/%)
105ROOTFS_LINTLIB=		$(LINTLIB:%=$(ROOTFS_LIBDIR)/%)
106
107ROOTFS_DYNLIB64=	$(DYNLIB:%=$(ROOTFS_LIBDIR64)/%)
108ROOTFS_LINTLIB64=	$(LINTLIB:%=$(ROOTFS_LIBDIR64)/%)
109
110$(ROOTFS_DYNLIB) :=	FILEMODE= 755
111$(ROOTFS_DYNLIB64) :=	FILEMODE= 755
112
113ROOTDEMODIR=	$(ROOT)/usr/demo/ELF
114ROOTDEMOFILES=	$(DEMOFILES:%=$(ROOTDEMODIR)/%)
115
116LIBS =		$(DYNLIB) $(LINTLIB)
117
118CLEANFILES +=	$(LINTOUTS) $(BLTSRCS) $(BLTFILES) $(WARLOCKFILES)
119
120$(ROOTDEMODIR) :=	OWNER =		root
121$(ROOTDEMODIR) :=	GROUP =		bin
122$(ROOTDEMODIR) :=	DIRMODE =	$(VAR_LIBELF_ROOTDEMODIR_DIRMODE)
123
124.PARALLEL:	$(LIBS) $(ROOTDEMOFILES)
125