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 | 5f38a2c | 2006-01-12 03:08:35 +0000 | [diff] [blame] | 3 | ## Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 | ## |
| 27 | DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\" |
| 28 | if MUDFLAP |
| 29 | AM_CFLAGS = -fmudflap |
| 30 | else |
| 31 | AM_CFLAGS = |
| 32 | endif |
| 33 | AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 \ |
| 34 | -std=gnu99 |
| 35 | INCLUDES = -I$(srcdir) -I$(top_srcdir)/libebl \ |
| 36 | -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \ |
| 37 | -I$(top_srcdir)/lib -I.. |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 38 | |
| 39 | |
| 40 | modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 |
| 41 | libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \ |
| 42 | libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \ |
| 43 | libebl_sparc_pic.a libebl_ppc_pic.a libebl_ppc64_pic.a \ |
| 44 | libebl_s390_pic.a |
| 45 | noinst_LIBRARIES = $(libebl_pic) |
| 46 | noinst_DATA = $(libebl_pic:_pic.a=.so) |
| 47 | |
| 48 | |
| 49 | if MUDFLAP |
| 50 | libelf = ../libelf/libelf.a |
| 51 | libdw = ../libdw/libdw.a |
| 52 | libmudflap = -lmudflap |
| 53 | else |
| 54 | libelf = ../libelf/libelf.so |
| 55 | libdw = ../libdw/libdw.so |
| 56 | libmudflap = |
| 57 | endif |
| 58 | |
| 59 | |
| 60 | textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi |
| 61 | |
| 62 | libebl_%.so: libebl_%_pic.a libebl_%.map $(libelf) $(libdw) |
| 63 | $(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ |
| 64 | -Wl,--version-script,$(word 2,$^) \ |
| 65 | -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap) |
| 66 | $(textrel_check) |
| 67 | |
| 68 | libebl_%.map: Makefile |
| 69 | echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' > $@ |
| 70 | |
| 71 | |
Roland McGrath | 994b489 | 2005-12-05 22:46:21 +0000 | [diff] [blame] | 72 | i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c \ |
| 73 | i386_retval.c i386_regs.c |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 74 | libebl_i386_pic_a_SOURCES = $(i386_SRCS) |
| 75 | am_libebl_i386_pic_a_OBJECTS = $(i386_SRCS:.c=.os) |
| 76 | |
| 77 | sh_SRCS = sh_init.c sh_symbol.c |
| 78 | libebl_sh_pic_a_SOURCES = $(sh_SRCS) |
| 79 | am_libebl_sh_pic_a_OBJECTS = $(sh_SRCS:.c=.os) |
| 80 | |
Roland McGrath | 994b489 | 2005-12-05 22:46:21 +0000 | [diff] [blame] | 81 | x86_64_SRCS = x86_64_init.c x86_64_symbol.c x86_64_corenote.c \ |
| 82 | x86_64_retval.c x86_64_regs.c |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 83 | libebl_x86_64_pic_a_SOURCES = $(x86_64_SRCS) |
| 84 | am_libebl_x86_64_pic_a_OBJECTS = $(x86_64_SRCS:.c=.os) |
| 85 | |
Roland McGrath | 9502462 | 2006-07-21 10:06:31 +0000 | [diff] [blame] | 86 | 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] | 87 | libebl_ia64_pic_a_SOURCES = $(ia64_SRCS) |
| 88 | am_libebl_ia64_pic_a_OBJECTS = $(ia64_SRCS:.c=.os) |
| 89 | |
| 90 | alpha_SRCS = alpha_init.c alpha_symbol.c alpha_retval.c |
| 91 | libebl_alpha_pic_a_SOURCES = $(alpha_SRCS) |
| 92 | am_libebl_alpha_pic_a_OBJECTS = $(alpha_SRCS:.c=.os) |
| 93 | |
| 94 | arm_SRCS = arm_init.c arm_symbol.c |
| 95 | libebl_arm_pic_a_SOURCES = $(arm_SRCS) |
| 96 | am_libebl_arm_pic_a_OBJECTS = $(arm_SRCS:.c=.os) |
| 97 | |
Roland McGrath | c373d85 | 2006-10-10 00:25:21 +0000 | [diff] [blame^] | 98 | sparc_SRCS = sparc_init.c sparc_symbol.c sparc_regs.c sparc_retval.c |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 99 | libebl_sparc_pic_a_SOURCES = $(sparc_SRCS) |
| 100 | am_libebl_sparc_pic_a_OBJECTS = $(sparc_SRCS:.c=.os) |
| 101 | |
Roland McGrath | 994b489 | 2005-12-05 22:46:21 +0000 | [diff] [blame] | 102 | ppc_SRCS = ppc_init.c ppc_symbol.c ppc_retval.c ppc_regs.c |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 103 | libebl_ppc_pic_a_SOURCES = $(ppc_SRCS) |
| 104 | am_libebl_ppc_pic_a_OBJECTS = $(ppc_SRCS:.c=.os) |
| 105 | |
Roland McGrath | 994b489 | 2005-12-05 22:46:21 +0000 | [diff] [blame] | 106 | ppc64_SRCS = ppc64_init.c ppc64_symbol.c ppc64_retval.c ppc_regs.c |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 107 | libebl_ppc64_pic_a_SOURCES = $(ppc64_SRCS) |
| 108 | am_libebl_ppc64_pic_a_OBJECTS = $(ppc64_SRCS:.c=.os) |
| 109 | |
Roland McGrath | 321327a | 2006-01-13 00:51:21 +0000 | [diff] [blame] | 110 | 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] | 111 | libebl_s390_pic_a_SOURCES = $(s390_SRCS) |
| 112 | am_libebl_s390_pic_a_OBJECTS = $(s390_SRCS:.c=.os) |
| 113 | |
| 114 | |
Roland McGrath | c812a83 | 2006-08-08 20:02:11 +0000 | [diff] [blame] | 115 | %.os: %.c |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 116 | if $(COMPILE) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \ |
| 117 | -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \ |
Roland McGrath | c812a83 | 2006-08-08 20:02:11 +0000 | [diff] [blame] | 118 | then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 119 | else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ |
| 120 | fi |
| 121 | |
| 122 | install: install-am install-ebl-modules |
| 123 | install-ebl-modules: |
| 124 | $(mkinstalldirs) $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR) |
| 125 | for m in $(modules); do \ |
| 126 | $(INSTALL_PROGRAM) libebl_$${m}.so $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}-$(PACKAGE_VERSION).so; \ |
| 127 | ln -fs libebl_$${m}-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}.so; \ |
| 128 | done |
| 129 | |
| 130 | uninstall: uninstall-am |
| 131 | for m in $(modules); do \ |
| 132 | rm -f $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}-$(PACKAGE_VERSION).so; \ |
| 133 | rm -f $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}.so; \ |
| 134 | done |
| 135 | rmdir --ignore-fail-on-non-empty $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR) |
Roland McGrath | e47ab76 | 2005-11-17 03:16:00 +0000 | [diff] [blame] | 136 | |
| 137 | noinst_HEADERS = libebl_CPU.h common-reloc.c |
| 138 | EXTRA_DIST = $(foreach m,$(modules),$($(m)_SRCS)) $(modules:=_reloc.def) |
| 139 | |
| 140 | CLEANFILES = *.gcno *.gcda \ |
Roland McGrath | 3dca43b | 2005-11-18 02:30:43 +0000 | [diff] [blame] | 141 | $(foreach m,$(modules),\ |
| 142 | libebl_$(m).so $(am_libebl_$(m)_pic_a_OBJECTS)) |