xref: /illumos-gate/usr/src/cmd/sgs/libelf/Makefile.com (revision 79033acb)
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#
23# Copyright 2006 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
67MAPFILES=	../common/mapfile-common
68MAPOPTS=	$(MAPFILES:%=-M%)
69
70CLOBBERFILES +=
71
72DYNFLAGS +=	$(VERSREF) $(MAPOPTS)
73LDLIBS +=	$(CONVLIBDIR) $(CONV_LIB) $(VAR_LIBELF_LDLIBS) -lc
74
75LINTFLAGS +=	-u -erroff=E_BAD_PTR_CAST_ALIGN
76LINTFLAGS64 +=	-u -erroff=E_CAST_INT_TO_SMALL_INT
77
78BUILD.AR=	$(RM) $@ ; \
79		$(AR) q $@ `$(LORDER) $(OBJECTS:%=$(DIR)/%)| $(TSORT)`
80		$(POST_PROCESS_A)
81
82
83BLTDEFS=	msg.h
84BLTDATA=	msg.c
85BLTMESG=	$(SGSMSGDIR)/libelf
86
87BLTFILES=	$(BLTDEFS) $(BLTDATA) $(BLTMESG)
88
89SGSMSGCOM=	../common/libelf.msg
90SGSMSG32=	../common/libelf.32.msg
91SGSMSGTARG=	$(SGSMSGCOM)
92SGSMSGALL=	$(SGSMSGCOM) $(SGSMSG32)
93
94SGSMSGFLAGS1=	$(SGSMSGFLAGS) -m $(BLTMESG)
95SGSMSGFLAGS2=	$(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n libelf_msg
96
97BLTSRCS=	$(BLTOBJS:%.o=%.c)
98LIBSRCS=	$(COMOBJS:%.o=../common/%.c)  $(MISCOBJS:%.o=../misc/%.c) \
99		$(MACHOBJS:%.o=%.c)  $(BLTSRCS)
100SRCS=		../common/llib-lelf
101LINTSRCS=	$(LIBSRCS) ../common/lintsup.c
102
103ROOTFS_DYNLIB=		$(DYNLIB:%=$(ROOTFS_LIBDIR)/%)
104ROOTFS_LINTLIB=		$(LINTLIB:%=$(ROOTFS_LIBDIR)/%)
105
106ROOTFS_DYNLIB64=	$(DYNLIB:%=$(ROOTFS_LIBDIR64)/%)
107ROOTFS_LINTLIB64=	$(LINTLIB:%=$(ROOTFS_LIBDIR64)/%)
108
109$(ROOTFS_DYNLIB) :=	FILEMODE= 755
110$(ROOTFS_DYNLIB64) :=	FILEMODE= 755
111
112ROOTDEMODIR=	$(ROOT)/usr/demo/ELF
113ROOTDEMOFILES=	$(DEMOFILES:%=$(ROOTDEMODIR)/%)
114
115LIBS =		$(DYNLIB) $(LINTLIB)
116
117CLEANFILES +=	$(LINTOUTS) $(BLTSRCS) $(BLTFILES) $(WARLOCKFILES)
118
119$(ROOTDEMODIR) :=	OWNER =		root
120$(ROOTDEMODIR) :=	GROUP =		bin
121$(ROOTDEMODIR) :=	DIRMODE =	$(VAR_LIBELF_ROOTDEMODIR_DIRMODE)
122
123.PARALLEL:	$(LIBS) $(ROOTDEMOFILES)
124