1 ## Process this file with automake to create Makefile.in
3 ## Copyright (C) 2002-2010 Red Hat, Inc.
4 ## This file is part of elfutils.
6 ## This file is free software; you can redistribute it and/or modify
7 ## it under the terms of either
9 ## * the GNU Lesser General Public License as published by the Free
10 ## Software Foundation; either version 3 of the License, or (at
11 ## your option) any later version
15 ## * the GNU General Public License as published by the Free
16 ## Software Foundation; either version 2 of the License, or (at
17 ## your option) any later version
19 ## or both in parallel, as here.
21 ## elfutils is distributed in the hope that it will be useful, but
22 ## WITHOUT ANY WARRANTY; without even the implied warranty of
23 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 ## General Public License for more details.
26 ## You should have received copies of the GNU General Public License and
27 ## the GNU Lesser General Public License along with this program. If
28 ## not, see <http://www.gnu.org/licenses/>.
30 include $(top_srcdir)/config/eu.am
31 INCLUDES += -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl -I$(top_srcdir)/libdw
33 GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
36 lib_LIBRARIES = libasm.a
38 noinst_LIBRARIES = libasm_pic.a
39 noinst_PROGRAMS = $(noinst_LIBRARIES:_pic.a=.so)
41 pkginclude_HEADERS = libasm.h
43 libasm_a_SOURCES = asm_begin.c asm_abort.c asm_end.c asm_error.c \
44 asm_getelf.c asm_newscn.c asm_newscn_ingrp.c \
45 asm_newsubscn.c asm_newsym.c asm_newcomsym.c \
47 asm_newscngrp.c asm_scngrp_newsignature.c \
48 asm_fill.c asm_align.c asm_addstrz.c \
49 asm_addint8.c asm_adduint8.c \
50 asm_addint16.c asm_adduint16.c \
51 asm_addint32.c asm_adduint32.c \
52 asm_addint64.c asm_adduint64.c \
53 asm_adduleb128.c asm_addsleb128.c \
54 disasm_begin.c disasm_cb.c disasm_end.c disasm_str.c \
58 libasm_pic_a_SOURCES =
59 am_libasm_pic_a_OBJECTS = $(libasm_a_SOURCES:.c=.os)
63 libasm_so_LDLIBS += -lpthread
67 libasm.so: libasm_pic.a libasm.map
68 $(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
69 -Wl,--version-script,$(srcdir)/libasm.map,--no-undefined \
70 -Wl,--soname,$@.$(VERSION) \
71 ../libebl/libebl.a ../libelf/libelf.so $(libasm_so_LDLIBS)
72 if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
73 ln -fs $@ $@.$(VERSION)
75 install: install-am libasm.so
76 $(mkinstalldirs) $(DESTDIR)$(libdir)
77 $(INSTALL_PROGRAM) libasm.so $(DESTDIR)$(libdir)/libasm-$(PACKAGE_VERSION).so
78 ln -fs libasm-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libasm.so.$(VERSION)
79 ln -fs libasm.so.$(VERSION) $(DESTDIR)$(libdir)/libasm.so
81 uninstall: uninstall-am
82 rm -f $(DESTDIR)$(libdir)/libasm-$(PACKAGE_VERSION).so
83 rm -f $(DESTDIR)$(libdir)/libasm.so.$(VERSION)
84 rm -f $(DESTDIR)$(libdir)/libasm.so
85 rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils
88 noinst_HEADERS = libasmP.h symbolhash.h
89 EXTRA_DIST = libasm.map
91 CLEANFILES += $(am_libasm_pic_a_OBJECTS) libasm.so.$(VERSION)