blob: 95143bcbd94d8d74052f753b81b5a9ffccfeae6d [file] [log] [blame]
Roland McGrathe47ab762005-11-17 03:16:00 +00001## Process this file with automake to create Makefile.in
2##
Roland McGrath5f38a2c2006-01-12 03:08:35 +00003## Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Red Hat, Inc.
Ulrich Drepper361df7d2006-04-04 21:38:57 +00004## This file is part of Red Hat elfutils.
Roland McGrathe47ab762005-11-17 03:16:00 +00005##
Ulrich Drepper361df7d2006-04-04 21:38:57 +00006## 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 McGrathe47ab762005-11-17 03:16:00 +00009##
Ulrich Drepper361df7d2006-04-04 21:38:57 +000010## 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 Drepper1e9ef502006-04-04 22:29:06 +000017## Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
Ulrich Drepper361df7d2006-04-04 21:38:57 +000018##
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 McGrathe47ab762005-11-17 03:16:00 +000026##
27DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\"
28if MUDFLAP
29AM_CFLAGS = -fmudflap
30else
31AM_CFLAGS =
32endif
33AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 \
34 -std=gnu99
35INCLUDES = -I$(srcdir) -I$(top_srcdir)/libebl \
36 -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
37 -I$(top_srcdir)/lib -I..
38PACKAGE_VERSION = @PACKAGE_VERSION@
39
40
41modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390
42libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
43 libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
44 libebl_sparc_pic.a libebl_ppc_pic.a libebl_ppc64_pic.a \
45 libebl_s390_pic.a
46noinst_LIBRARIES = $(libebl_pic)
47noinst_DATA = $(libebl_pic:_pic.a=.so)
48
49
50if MUDFLAP
51libelf = ../libelf/libelf.a
52libdw = ../libdw/libdw.a
53libmudflap = -lmudflap
54else
55libelf = ../libelf/libelf.so
56libdw = ../libdw/libdw.so
57libmudflap =
58endif
59
60
61textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
62
63libebl_%.so: libebl_%_pic.a libebl_%.map $(libelf) $(libdw)
64 $(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
65 -Wl,--version-script,$(word 2,$^) \
66 -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
67 $(textrel_check)
68
69libebl_%.map: Makefile
70 echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' > $@
71
72
Roland McGrath994b4892005-12-05 22:46:21 +000073i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c \
74 i386_retval.c i386_regs.c
Roland McGrathe47ab762005-11-17 03:16:00 +000075libebl_i386_pic_a_SOURCES = $(i386_SRCS)
76am_libebl_i386_pic_a_OBJECTS = $(i386_SRCS:.c=.os)
77
78sh_SRCS = sh_init.c sh_symbol.c
79libebl_sh_pic_a_SOURCES = $(sh_SRCS)
80am_libebl_sh_pic_a_OBJECTS = $(sh_SRCS:.c=.os)
81
Roland McGrath994b4892005-12-05 22:46:21 +000082x86_64_SRCS = x86_64_init.c x86_64_symbol.c x86_64_corenote.c \
83 x86_64_retval.c x86_64_regs.c
Roland McGrathe47ab762005-11-17 03:16:00 +000084libebl_x86_64_pic_a_SOURCES = $(x86_64_SRCS)
85am_libebl_x86_64_pic_a_OBJECTS = $(x86_64_SRCS:.c=.os)
86
Roland McGrath95024622006-07-21 10:06:31 +000087ia64_SRCS = ia64_init.c ia64_symbol.c ia64_regs.c ia64_retval.c
Roland McGrathe47ab762005-11-17 03:16:00 +000088libebl_ia64_pic_a_SOURCES = $(ia64_SRCS)
89am_libebl_ia64_pic_a_OBJECTS = $(ia64_SRCS:.c=.os)
90
91alpha_SRCS = alpha_init.c alpha_symbol.c alpha_retval.c
92libebl_alpha_pic_a_SOURCES = $(alpha_SRCS)
93am_libebl_alpha_pic_a_OBJECTS = $(alpha_SRCS:.c=.os)
94
95arm_SRCS = arm_init.c arm_symbol.c
96libebl_arm_pic_a_SOURCES = $(arm_SRCS)
97am_libebl_arm_pic_a_OBJECTS = $(arm_SRCS:.c=.os)
98
Roland McGrath994b4892005-12-05 22:46:21 +000099sparc_SRCS = sparc_init.c sparc_symbol.c sparc_regs.c
Roland McGrathe47ab762005-11-17 03:16:00 +0000100libebl_sparc_pic_a_SOURCES = $(sparc_SRCS)
101am_libebl_sparc_pic_a_OBJECTS = $(sparc_SRCS:.c=.os)
102
Roland McGrath994b4892005-12-05 22:46:21 +0000103ppc_SRCS = ppc_init.c ppc_symbol.c ppc_retval.c ppc_regs.c
Roland McGrathe47ab762005-11-17 03:16:00 +0000104libebl_ppc_pic_a_SOURCES = $(ppc_SRCS)
105am_libebl_ppc_pic_a_OBJECTS = $(ppc_SRCS:.c=.os)
106
Roland McGrath994b4892005-12-05 22:46:21 +0000107ppc64_SRCS = ppc64_init.c ppc64_symbol.c ppc64_retval.c ppc_regs.c
Roland McGrathe47ab762005-11-17 03:16:00 +0000108libebl_ppc64_pic_a_SOURCES = $(ppc64_SRCS)
109am_libebl_ppc64_pic_a_OBJECTS = $(ppc64_SRCS:.c=.os)
110
Roland McGrath321327a2006-01-13 00:51:21 +0000111s390_SRCS = s390_init.c s390_symbol.c s390_regs.c s390_retval.c
Roland McGrathe47ab762005-11-17 03:16:00 +0000112libebl_s390_pic_a_SOURCES = $(s390_SRCS)
113am_libebl_s390_pic_a_OBJECTS = $(s390_SRCS:.c=.os)
114
115
116%.os: %.c %.o
117 if $(COMPILE) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \
118 -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \
119 then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \
120 rm -f "$(DEPDIR)/$*.Tpo"; \
121 else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
122 fi
123
124install: install-am install-ebl-modules
125install-ebl-modules:
126 $(mkinstalldirs) $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)
127 for m in $(modules); do \
128 $(INSTALL_PROGRAM) libebl_$${m}.so $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}-$(PACKAGE_VERSION).so; \
129 ln -fs libebl_$${m}-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}.so; \
130 done
131
132uninstall: uninstall-am
133 for m in $(modules); do \
134 rm -f $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}-$(PACKAGE_VERSION).so; \
135 rm -f $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}.so; \
136 done
137 rmdir --ignore-fail-on-non-empty $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)
Roland McGrathe47ab762005-11-17 03:16:00 +0000138
139noinst_HEADERS = libebl_CPU.h common-reloc.c
140EXTRA_DIST = $(foreach m,$(modules),$($(m)_SRCS)) $(modules:=_reloc.def)
141
142CLEANFILES = *.gcno *.gcda \
Roland McGrath3dca43b2005-11-18 02:30:43 +0000143 $(foreach m,$(modules),\
144 libebl_$(m).so $(am_libebl_$(m)_pic_a_OBJECTS))