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