xref: /titanic_44/usr/src/cmd/sgs/libelf/Makefile.com (revision 9dd0f810214fdc8e1af881a9a5c4b6927629ff9e)
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 2006 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
53DEMOFILES=	Makefile	README		acom.c		dcom.c \
54		pcom.c		tpcom.c		dispsyms.c
55
56include $(SRC)/lib/Makefile.lib
57include $(SRC)/cmd/sgs/Makefile.com
58
59#
60# Do not compile the libelf.a objects with the -xF flag
61#
62$(OBJS) :=	XFFLAG=
63
64WARLOCKFILES=	$(OBJECTS:%.o=wlocks/%.ll)
65
66MAPFILES =	../common/mapfile-common
67
68CLOBBERFILES +=
69
70DYNFLAGS +=	$(VERSREF)
71LDLIBS +=	$(CONVLIBDIR) $(CONV_LIB) $(VAR_LIBELF_LDLIBS) -lc
72
73LINTFLAGS +=	-u -erroff=E_BAD_PTR_CAST_ALIGN
74LINTFLAGS64 +=	-u -erroff=E_CAST_INT_TO_SMALL_INT
75
76BUILD.AR=	$(RM) $@ ; \
77		$(AR) q $@ `$(LORDER) $(OBJECTS:%=$(DIR)/%)| $(TSORT)`
78		$(POST_PROCESS_A)
79
80
81BLTDEFS=	msg.h
82BLTDATA=	msg.c
83BLTMESG=	$(SGSMSGDIR)/libelf
84
85BLTFILES=	$(BLTDEFS) $(BLTDATA) $(BLTMESG)
86
87SGSMSGCOM=	../common/libelf.msg
88SGSMSG32=	../common/libelf.32.msg
89SGSMSGTARG=	$(SGSMSGCOM)
90SGSMSGALL=	$(SGSMSGCOM) $(SGSMSG32)
91
92SGSMSGFLAGS1=	$(SGSMSGFLAGS) -m $(BLTMESG)
93SGSMSGFLAGS2=	$(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n libelf_msg
94
95BLTSRCS=	$(BLTOBJS:%.o=%.c)
96LIBSRCS=	$(COMOBJS:%.o=../common/%.c)  $(MISCOBJS:%.o=../misc/%.c) \
97		$(MACHOBJS:%.o=%.c)  $(BLTSRCS)
98SRCS=		../common/llib-lelf
99LINTSRCS=	$(LIBSRCS) ../common/lintsup.c
100
101ROOTFS_DYNLIB=		$(DYNLIB:%=$(ROOTFS_LIBDIR)/%)
102ROOTFS_LINTLIB=		$(LINTLIB:%=$(ROOTFS_LIBDIR)/%)
103
104ROOTFS_DYNLIB64=	$(DYNLIB:%=$(ROOTFS_LIBDIR64)/%)
105ROOTFS_LINTLIB64=	$(LINTLIB:%=$(ROOTFS_LIBDIR64)/%)
106
107$(ROOTFS_DYNLIB) :=	FILEMODE= 755
108$(ROOTFS_DYNLIB64) :=	FILEMODE= 755
109
110ROOTDEMODIR=	$(ROOT)/usr/demo/ELF
111ROOTDEMOFILES=	$(DEMOFILES:%=$(ROOTDEMODIR)/%)
112
113LIBS =		$(DYNLIB) $(LINTLIB)
114
115CLEANFILES +=	$(LINTOUTS) $(BLTSRCS) $(BLTFILES) $(WARLOCKFILES)
116
117$(ROOTDEMODIR) :=	OWNER =		root
118$(ROOTDEMODIR) :=	GROUP =		bin
119$(ROOTDEMODIR) :=	DIRMODE =	$(VAR_LIBELF_ROOTDEMODIR_DIRMODE)
120
121.PARALLEL:	$(LIBS) $(ROOTDEMOFILES)
122