xref: /illumos-gate/usr/src/cmd/sgs/libelf/Makefile.com (revision 5328fc53d11d7151861fa272e4fb0248b8f0e145)
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# Copyright (c) 2018, Joyent, Inc.
25# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
26#
27
28LIBRARY=	libelf.a
29VERS=		.1
30
31MACHOBJS=
32COMOBJS=	ar.o		begin.o		cntl.o		cook.o \
33		data.o		end.o		fill.o		flag.o \
34		getarhdr.o	getarsym.o	getbase.o	getdata.o \
35		getehdr.o	getident.o	getphdr.o	getscn.o \
36		getshdr.o \
37		getphnum.o	getshnum.o	getshstrndx.o \
38		hash.o		input.o		kind.o \
39		ndxscn.o	newdata.o	newehdr.o	newphdr.o \
40		newscn.o	next.o		nextscn.o	output.o \
41		rand.o		rawdata.o	rawfile.o	rawput.o \
42		strptr.o	update.o	error.o		gelf.o \
43		clscook.o	checksum.o
44CLASSOBJS=	clscook64.o	newehdr64.o	newphdr64.o	update64.o \
45		checksum64.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
55SRCDIR=	$(SRC)/cmd/sgs/libelf
56
57# Use the value of M4 set in Makefile.master via Makefile.lib
58
59DEMOFILES=	Makefile	00README	acom.c		dcom.c \
60		pcom.c		tpcom.c		dispsyms.c
61DEMOFILESRCDIR=	$(SRCDIR)/demo
62ROOTDEMODIRBASE=$(ROOT)/usr/demo/ELF
63ROOTDEMODIRS=   $(ROOTDEMODIRBASE)
64
65include $(SRC)/cmd/sgs/Makefile.com
66
67MAPFILES =	$(SRCDIR)/common/mapfile-vers
68
69DYNFLAGS +=	$(VERSREF)
70LDLIBS +=	$(CONVLIBDIR) -lconv -lc
71
72CERRWARN +=	-_gcc=-Wno-parentheses
73CERRWARN +=	$(CNOWARN_UNINIT)
74
75SMOFF += indenting
76
77BLTDEFS=	msg.h
78BLTDATA=	msg.c
79BLTMESG=	$(SGSMSGDIR)/libelf
80
81BLTFILES=	$(BLTDEFS) $(BLTDATA) $(BLTMESG)
82
83SGSMSGCOM=	$(SRCDIR)/common/libelf.msg
84SGSMSG32=	$(SRCDIR)/common/libelf.32.msg
85SGSMSGTARG=	$(SGSMSGCOM)
86SGSMSGALL=	$(SGSMSGCOM) $(SGSMSG32)
87
88SGSMSGFLAGS1=	$(SGSMSGFLAGS) -m $(BLTMESG)
89SGSMSGFLAGS2=	$(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n libelf_msg
90
91BLTSRCS=	$(BLTOBJS:%.o=%.c)
92LIBSRCS=	$(COMOBJS:%.o=$(SRCDIR)/common/%.c)  $(MISCOBJS:%.o=$(SRCDIR)/misc/%.c) \
93		$(MACHOBJS:%.o=%.c)  $(BLTSRCS)
94
95ROOTFS_DYNLIB=		$(DYNLIB:%=$(ROOTFS_LIBDIR)/%)
96
97ROOTFS_DYNLIB64=	$(DYNLIB:%=$(ROOTFS_LIBDIR64)/%)
98
99$(ROOTFS_DYNLIB) :=	FILEMODE= 755
100$(ROOTFS_DYNLIB64) :=	FILEMODE= 755
101
102LIBS =		$(DYNLIB)
103
104CLEANFILES +=	$(BLTSRCS) $(BLTFILES)
105
106.PARALLEL:	$(LIBS)
107