Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 1 | ## Process this file with automake to create Makefile.in |
| 2 | ## |
Roland McGrath | 22359e2 | 2010-02-15 15:57:03 -0800 | [diff] [blame] | 3 | ## Copyright (C) 2000-2010 Red Hat, Inc. |
Ulrich Drepper | 361df7d | 2006-04-04 21:38:57 +0000 | [diff] [blame] | 4 | ## This file is part of Red Hat elfutils. |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 5 | ## |
Ulrich Drepper | 361df7d | 2006-04-04 21:38:57 +0000 | [diff] [blame] | 6 | ## Red Hat elfutils is free software; you can redistribute it and/or modify |
| 7 | ## it under the terms of the GNU General Public License as published by the |
| 8 | ## Free Software Foundation; version 2 of the License. |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 9 | ## |
Ulrich Drepper | 361df7d | 2006-04-04 21:38:57 +0000 | [diff] [blame] | 10 | ## Red Hat elfutils is distributed in the hope that it will be useful, but |
| 11 | ## WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | ## General Public License for more details. |
| 14 | ## |
| 15 | ## You should have received a copy of the GNU General Public License along |
| 16 | ## with Red Hat elfutils; if not, write to the Free Software Foundation, |
Ulrich Drepper | 1e9ef50 | 2006-04-04 22:29:06 +0000 | [diff] [blame] | 17 | ## Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. |
Ulrich Drepper | 361df7d | 2006-04-04 21:38:57 +0000 | [diff] [blame] | 18 | ## |
| 19 | ## Red Hat elfutils is an included package of the Open Invention Network. |
| 20 | ## An included package of the Open Invention Network is a package for which |
| 21 | ## Open Invention Network licensees cross-license their patents. No patent |
| 22 | ## license is granted, either expressly or impliedly, by designation as an |
| 23 | ## included package. Should you wish to participate in the Open Invention |
| 24 | ## Network licensing program, please visit www.openinventionnetwork.com |
| 25 | ## <http://www.openinventionnetwork.com>. |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 26 | ## |
Roland McGrath | 22359e2 | 2010-02-15 15:57:03 -0800 | [diff] [blame] | 27 | include $(top_srcdir)/config/eu.am |
| 28 | INCLUDES += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \ |
| 29 | -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 30 | |
| 31 | |
| 32 | modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 |
| 33 | libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \ |
| 34 | libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \ |
| 35 | libebl_sparc_pic.a libebl_ppc_pic.a libebl_ppc64_pic.a \ |
| 36 | libebl_s390_pic.a |
| 37 | noinst_LIBRARIES = $(libebl_pic) |
| 38 | noinst_DATA = $(libebl_pic:_pic.a=.so) |
| 39 | |
| 40 | |
| 41 | if MUDFLAP |
| 42 | libelf = ../libelf/libelf.a |
| 43 | libdw = ../libdw/libdw.a |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 44 | else |
| 45 | libelf = ../libelf/libelf.so |
| 46 | libdw = ../libdw/libdw.so |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 47 | endif |
| 48 | |
Roland McGrath | 3c84db3 | 2009-06-24 17:41:40 -0700 | [diff] [blame] | 49 | i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c i386_cfi.c \ |
Roland McGrath | 1d8bb25 | 2008-08-07 08:39:41 +0000 | [diff] [blame] | 50 | i386_retval.c i386_regs.c i386_auxv.c i386_syscall.c |
Ulrich Drepper | 3cbdd38 | 2008-01-02 17:44:39 +0000 | [diff] [blame] | 51 | cpu_i386 = ../libcpu/libcpu_i386.a |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 52 | libebl_i386_pic_a_SOURCES = $(i386_SRCS) |
| 53 | am_libebl_i386_pic_a_OBJECTS = $(i386_SRCS:.c=.os) |
| 54 | |
Matt Fleming | d80f0b2 | 2010-04-10 19:13:37 -0700 | [diff] [blame] | 55 | sh_SRCS = sh_init.c sh_symbol.c sh_corenote.c sh_regs.c sh_retval.c |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 56 | libebl_sh_pic_a_SOURCES = $(sh_SRCS) |
| 57 | am_libebl_sh_pic_a_OBJECTS = $(sh_SRCS:.c=.os) |
| 58 | |
Roland McGrath | 3c84db3 | 2009-06-24 17:41:40 -0700 | [diff] [blame] | 59 | x86_64_SRCS = x86_64_init.c x86_64_symbol.c x86_64_corenote.c x86_64_cfi.c \ |
Roland McGrath | 1d8bb25 | 2008-08-07 08:39:41 +0000 | [diff] [blame] | 60 | x86_64_retval.c x86_64_regs.c i386_auxv.c x86_64_syscall.c |
Ulrich Drepper | ff99322 | 2008-01-09 05:39:28 +0000 | [diff] [blame] | 61 | cpu_x86_64 = ../libcpu/libcpu_x86_64.a |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 62 | libebl_x86_64_pic_a_SOURCES = $(x86_64_SRCS) |
| 63 | am_libebl_x86_64_pic_a_OBJECTS = $(x86_64_SRCS:.c=.os) |
| 64 | |
Roland McGrath | 9502462 | 2006-07-21 10:06:31 +0000 | [diff] [blame] | 65 | ia64_SRCS = ia64_init.c ia64_symbol.c ia64_regs.c ia64_retval.c |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 66 | libebl_ia64_pic_a_SOURCES = $(ia64_SRCS) |
| 67 | am_libebl_ia64_pic_a_OBJECTS = $(ia64_SRCS:.c=.os) |
| 68 | |
Roland McGrath | cb6d865 | 2007-08-23 08:10:54 +0000 | [diff] [blame] | 69 | alpha_SRCS = alpha_init.c alpha_symbol.c alpha_retval.c alpha_regs.c \ |
Roland McGrath | 059c83e | 2008-02-21 06:19:39 +0000 | [diff] [blame] | 70 | alpha_corenote.c alpha_auxv.c |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 71 | libebl_alpha_pic_a_SOURCES = $(alpha_SRCS) |
| 72 | am_libebl_alpha_pic_a_OBJECTS = $(alpha_SRCS:.c=.os) |
| 73 | |
Roland McGrath | eb9ba47 | 2009-04-14 18:44:45 -0700 | [diff] [blame] | 74 | arm_SRCS = arm_init.c arm_symbol.c arm_regs.c arm_corenote.c \ |
| 75 | arm_auxv.c arm_attrs.c arm_retval.c |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 76 | libebl_arm_pic_a_SOURCES = $(arm_SRCS) |
| 77 | am_libebl_arm_pic_a_OBJECTS = $(arm_SRCS:.c=.os) |
| 78 | |
Ulrich Drepper | b597dfa | 2007-10-16 05:21:27 +0000 | [diff] [blame] | 79 | sparc_SRCS = sparc_init.c sparc_symbol.c sparc_regs.c sparc_retval.c \ |
| 80 | sparc_corenote.c sparc64_corenote.c sparc_auxv.c |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 81 | libebl_sparc_pic_a_SOURCES = $(sparc_SRCS) |
| 82 | am_libebl_sparc_pic_a_OBJECTS = $(sparc_SRCS:.c=.os) |
| 83 | |
Roland McGrath | cb6d865 | 2007-08-23 08:10:54 +0000 | [diff] [blame] | 84 | ppc_SRCS = ppc_init.c ppc_symbol.c ppc_retval.c ppc_regs.c \ |
Roland McGrath | 1d8bb25 | 2008-08-07 08:39:41 +0000 | [diff] [blame] | 85 | ppc_corenote.c ppc_auxv.c ppc_attrs.c ppc_syscall.c |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 86 | libebl_ppc_pic_a_SOURCES = $(ppc_SRCS) |
| 87 | am_libebl_ppc_pic_a_OBJECTS = $(ppc_SRCS:.c=.os) |
| 88 | |
Roland McGrath | cb6d865 | 2007-08-23 08:10:54 +0000 | [diff] [blame] | 89 | ppc64_SRCS = ppc64_init.c ppc64_symbol.c ppc64_retval.c \ |
Roland McGrath | 1d8bb25 | 2008-08-07 08:39:41 +0000 | [diff] [blame] | 90 | ppc64_corenote.c ppc_regs.c ppc_auxv.c ppc_attrs.c ppc_syscall.c |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 91 | libebl_ppc64_pic_a_SOURCES = $(ppc64_SRCS) |
| 92 | am_libebl_ppc64_pic_a_OBJECTS = $(ppc64_SRCS:.c=.os) |
| 93 | |
Roland McGrath | 321327a | 2006-01-13 00:51:21 +0000 | [diff] [blame] | 94 | s390_SRCS = s390_init.c s390_symbol.c s390_regs.c s390_retval.c |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 95 | libebl_s390_pic_a_SOURCES = $(s390_SRCS) |
| 96 | am_libebl_s390_pic_a_OBJECTS = $(s390_SRCS:.c=.os) |
| 97 | |
| 98 | |
Roland McGrath | 9e92418 | 2010-02-18 14:33:48 -0800 | [diff] [blame] | 99 | libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw) |
| 100 | @rm -f $(@:.so=.map) |
| 101 | echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \ |
| 102 | > $(@:.so=.map) |
| 103 | $(LINK) -shared -o $(@:.map=.so) \ |
| 104 | -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \ |
| 105 | -Wl,--version-script,$(@:.so=.map) \ |
Ulrich Drepper | 3cbdd38 | 2008-01-02 17:44:39 +0000 | [diff] [blame] | 106 | -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap) |
| 107 | $(textrel_check) |
| 108 | |
Ulrich Drepper | 3cbdd38 | 2008-01-02 17:44:39 +0000 | [diff] [blame] | 109 | libebl_i386.so: $(cpu_i386) |
| 110 | libebl_x86_64.so: $(cpu_x86_64) |
| 111 | |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 112 | install: install-am install-ebl-modules |
| 113 | install-ebl-modules: |
| 114 | $(mkinstalldirs) $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR) |
| 115 | for m in $(modules); do \ |
| 116 | $(INSTALL_PROGRAM) libebl_$${m}.so $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}-$(PACKAGE_VERSION).so; \ |
| 117 | ln -fs libebl_$${m}-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}.so; \ |
| 118 | done |
| 119 | |
| 120 | uninstall: uninstall-am |
| 121 | for m in $(modules); do \ |
| 122 | rm -f $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}-$(PACKAGE_VERSION).so; \ |
| 123 | rm -f $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}.so; \ |
| 124 | done |
| 125 | rmdir --ignore-fail-on-non-empty $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR) |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 126 | |
Roland McGrath | a845f68 | 2008-12-03 03:41:58 +0000 | [diff] [blame] | 127 | noinst_HEADERS = libebl_CPU.h common-reloc.c linux-core-note.c x86_corenote.c |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 128 | EXTRA_DIST = $(foreach m,$(modules),$($(m)_SRCS)) $(modules:=_reloc.def) |
| 129 | |
Roland McGrath | 22359e2 | 2010-02-15 15:57:03 -0800 | [diff] [blame] | 130 | CLEANFILES += $(foreach m,$(modules),\ |
Roland McGrath | 9e92418 | 2010-02-18 14:33:48 -0800 | [diff] [blame] | 131 | libebl_$(m).map libebl_$(m).so \ |
| 132 | $(am_libebl_$(m)_pic_a_OBJECTS)) |