blob: abe5468f035cda549afff65a04631842c15955c7 [file] [log] [blame]
Ulrich Drepperb08d5a82005-07-26 05:00:05 +00001## Process this file with automake to create Makefile.in
2##
Roland McGrath22359e22010-02-15 15:57:03 -08003## Copyright (C) 2002-2010 Red Hat, Inc.
Mark Wielaardde2ed972012-06-05 17:15:16 +02004## This file is part of elfutils.
Ulrich Drepperb08d5a82005-07-26 05:00:05 +00005##
Mark Wielaardde2ed972012-06-05 17:15:16 +02006## This file is free software; you can redistribute it and/or modify
7## it under the terms of either
Ulrich Drepperb08d5a82005-07-26 05:00:05 +00008##
Mark Wielaardde2ed972012-06-05 17:15:16 +02009## * 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
12##
13## or
14##
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
18##
19## or both in parallel, as here.
20##
21## elfutils is distributed in the hope that it will be useful, but
Ulrich Drepper361df7d2006-04-04 21:38:57 +000022## 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.
25##
Mark Wielaardde2ed972012-06-05 17:15:16 +020026## 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/>.
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000029##
Roland McGrath22359e22010-02-15 15:57:03 -080030include $(top_srcdir)/config/eu.am
31INCLUDES += -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl -I$(top_srcdir)/libdw
32
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000033GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
34VERSION = 1
35
36lib_LIBRARIES = libasm.a
37if !MUDFLAP
38noinst_LIBRARIES = libasm_pic.a
39noinst_PROGRAMS = $(noinst_LIBRARIES:_pic.a=.so)
40endif
Ulrich Dreppere219f1c2008-01-09 05:49:49 +000041pkginclude_HEADERS = libasm.h
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000042
43libasm_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 \
46 asm_newabssym.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 \
Ulrich Drepper3cbdd382008-01-02 17:44:39 +000054 disasm_begin.c disasm_cb.c disasm_end.c disasm_str.c \
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000055 symbolhash.c
56
57if !MUDFLAP
58libasm_pic_a_SOURCES =
59am_libasm_pic_a_OBJECTS = $(libasm_a_SOURCES:.c=.os)
60
Roland McGrath12af5a22008-12-04 06:28:06 +000061libasm_so_LDLIBS =
Ulrich Drepper7e678fa2009-01-10 18:02:05 -080062if USE_LOCKS
Roland McGrath12af5a22008-12-04 06:28:06 +000063libasm_so_LDLIBS += -lpthread
64endif
65
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000066libasm_so_SOURCES =
67libasm.so: libasm_pic.a libasm.map
Ulrich Drepperfbe998a2005-08-29 16:27:10 +000068 $(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
69 -Wl,--version-script,$(srcdir)/libasm.map,--no-undefined \
70 -Wl,--soname,$@.$(VERSION) \
Roland McGrath12af5a22008-12-04 06:28:06 +000071 ../libebl/libebl.a ../libelf/libelf.so $(libasm_so_LDLIBS)
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000072 if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
73 ln -fs $@ $@.$(VERSION)
74
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000075install: 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
80
81uninstall: 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
86endif
87
88noinst_HEADERS = libasmP.h symbolhash.h
89EXTRA_DIST = libasm.map
90
Roland McGrath22359e22010-02-15 15:57:03 -080091CLEANFILES += $(am_libasm_pic_a_OBJECTS) libasm.so.$(VERSION)