xref: /illumos-gate/usr/src/cmd/sgs/libelf/Makefile.com (revision 5661bb76)
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#
26
27LIBRARY=	libelf.a
28VERS=		.1
29
30MACHOBJS=
31COMOBJS=	ar.o		begin.o		cntl.o		cook.o \
32		data.o		end.o		fill.o		flag.o \
33		getarhdr.o	getarsym.o	getbase.o	getdata.o \
34		getehdr.o	getident.o	getphdr.o	getscn.o \
35		getshdr.o \
36		getphnum.o	getshnum.o	getshstrndx.o \
37		hash.o		input.o		kind.o \
38		ndxscn.o	newdata.o	newehdr.o	newphdr.o \
39		newscn.o	next.o		nextscn.o	output.o \
40		rand.o		rawdata.o	rawfile.o	rawput.o \
41		strptr.o	update.o	error.o		gelf.o \
42		clscook.o	checksum.o
43CLASSOBJS=	clscook64.o	newehdr64.o	newphdr64.o	update64.o \
44		checksum64.o
45BLTOBJS=	msg.o		xlate.o		xlate64.o
46MISCOBJS=	String.o	args.o		demangle.o	nlist.o \
47		nplist.o
48MISCOBJS64=	nlist.o
49
50OBJECTS=	$(BLTOBJS)  $(MACHOBJS)  $(COMOBJS)  $(CLASSOBJS) $(MISCOBJS)
51
52include $(SRC)/lib/Makefile.lib
53
54# Use the value of M4 set in Makefile.master via Makefile.lib
55
56DEMOFILES=	Makefile	00README	acom.c		dcom.c \
57		pcom.c		tpcom.c		dispsyms.c
58DEMOFILESRCDIR=	../demo
59ROOTDEMODIRBASE=$(ROOT)/usr/demo/ELF
60ROOTDEMODIRS=   $(ROOTDEMODIRBASE)
61
62include $(SRC)/cmd/sgs/Makefile.com
63
64MAPFILES =	../common/mapfile-vers
65
66DYNFLAGS +=	$(VERSREF)
67LDLIBS +=	$(CONVLIBDIR) $(CONV_LIB) -lc
68
69LINTFLAGS +=	-u -erroff=E_BAD_PTR_CAST_ALIGN
70LINTFLAGS64 +=	-u -erroff=E_CAST_INT_TO_SMALL_INT
71
72CERRWARN +=	-_gcc=-Wno-parentheses
73CERRWARN +=	-_gcc=-Wno-uninitialized
74
75SMOFF += indenting
76
77BUILD.AR=	$(RM) $@ ; \
78		$(AR) q $@ `$(LORDER) $(OBJECTS:%=$(DIR)/%)| $(TSORT)`
79		$(POST_PROCESS_A)
80
81
82BLTDEFS=	msg.h
83BLTDATA=	msg.c
84BLTMESG=	$(SGSMSGDIR)/libelf
85
86BLTFILES=	$(BLTDEFS) $(BLTDATA) $(BLTMESG)
87
88SGSMSGCOM=	../common/libelf.msg
89SGSMSG32=	../common/libelf.32.msg
90SGSMSGTARG=	$(SGSMSGCOM)
91SGSMSGALL=	$(SGSMSGCOM) $(SGSMSG32)
92
93SGSMSGFLAGS1=	$(SGSMSGFLAGS) -m $(BLTMESG)
94SGSMSGFLAGS2=	$(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n libelf_msg
95
96BLTSRCS=	$(BLTOBJS:%.o=%.c)
97LIBSRCS=	$(COMOBJS:%.o=../common/%.c)  $(MISCOBJS:%.o=../misc/%.c) \
98		$(MACHOBJS:%.o=%.c)  $(BLTSRCS)
99SRCS=		../common/llib-lelf
100LINTSRCS=	$(LIBSRCS) ../common/lintsup.c
101
102ROOTFS_DYNLIB=		$(DYNLIB:%=$(ROOTFS_LIBDIR)/%)
103ROOTFS_LINTLIB=		$(LINTLIB:%=$(ROOTFS_LIBDIR)/%)
104
105ROOTFS_DYNLIB64=	$(DYNLIB:%=$(ROOTFS_LIBDIR64)/%)
106ROOTFS_LINTLIB64=	$(LINTLIB:%=$(ROOTFS_LIBDIR64)/%)
107
108$(ROOTFS_DYNLIB) :=	FILEMODE= 755
109$(ROOTFS_DYNLIB64) :=	FILEMODE= 755
110
111LIBS =		$(DYNLIB) $(LINTLIB)
112
113CLEANFILES +=	$(LINTOUTS) $(BLTSRCS) $(BLTFILES)
114
115.PARALLEL:	$(LIBS)
116