xref: /illumos-gate/usr/src/cmd/sgs/libelf/Makefile.com (revision 48edc7cf07b5dccc3ad84bf2dafe4150bd666d60)
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 2015 Gary Mills
23# Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
24#
25
26LIBRARY=	libelf.a
27VERS=		.1
28
29MACHOBJS=
30COMOBJS=	ar.o		begin.o		cntl.o		cook.o \
31		data.o		end.o		fill.o		flag.o \
32		getarhdr.o	getarsym.o	getbase.o	getdata.o \
33		getehdr.o	getident.o	getphdr.o	getscn.o \
34		getshdr.o \
35		getphnum.o	getshnum.o	getshstrndx.o \
36		hash.o		input.o		kind.o \
37		ndxscn.o	newdata.o	newehdr.o	newphdr.o \
38		newscn.o	next.o		nextscn.o	output.o \
39		rand.o		rawdata.o	rawfile.o	rawput.o \
40		strptr.o	update.o	error.o		gelf.o \
41		clscook.o	checksum.o
42CLASSOBJS=	clscook64.o	newehdr64.o	newphdr64.o	update64.o \
43		checksum64.o
44BLTOBJS=	msg.o		xlate.o		xlate64.o
45MISCOBJS=	String.o	args.o		demangle.o	nlist.o \
46		nplist.o
47MISCOBJS64=	nlist.o
48
49OBJECTS=	$(BLTOBJS)  $(MACHOBJS)  $(COMOBJS)  $(CLASSOBJS) $(MISCOBJS)
50
51include $(SRC)/lib/Makefile.lib
52
53# Use the value of M4 set in Makefile.master via Makefile.lib
54
55DEMOFILES=	Makefile	00README	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-vers
66
67DYNFLAGS +=	$(VERSREF)
68LDLIBS +=	$(CONVLIBDIR) $(CONV_LIB) -lc
69
70LINTFLAGS +=	-u -erroff=E_BAD_PTR_CAST_ALIGN
71LINTFLAGS64 +=	-u -erroff=E_CAST_INT_TO_SMALL_INT
72
73CERRWARN +=	-_gcc=-Wno-parentheses
74CERRWARN +=	-_gcc=-Wno-uninitialized
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
110LIBS =		$(DYNLIB) $(LINTLIB)
111
112CLEANFILES +=	$(LINTOUTS) $(BLTSRCS) $(BLTFILES) $(WARLOCKFILES)
113
114.PARALLEL:	$(LIBS)
115