blob: 4174f8e372d6909b6bea0352686d6d9da4090578 [file] [log] [blame]
Roland McGrathe47ab762005-11-17 03:16:00 +00001## Process this file with automake to create Makefile.in
2##
Roland McGrathcb6d8652007-08-23 08:10:54 +00003## Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 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..
Roland McGrathe47ab762005-11-17 03:16:00 +000038
39
40modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390
41libebl_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
45noinst_LIBRARIES = $(libebl_pic)
46noinst_DATA = $(libebl_pic:_pic.a=.so)
47
48
49if MUDFLAP
50libelf = ../libelf/libelf.a
51libdw = ../libdw/libdw.a
52libmudflap = -lmudflap
53else
54libelf = ../libelf/libelf.so
55libdw = ../libdw/libdw.so
56libmudflap =
57endif
58
59
60textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
61
62libebl_%.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
68libebl_%.map: Makefile
69 echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' > $@
70
71
Roland McGrath994b4892005-12-05 22:46:21 +000072i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c \
Roland McGrathcb6d8652007-08-23 08:10:54 +000073 i386_retval.c i386_regs.c i386_auxv.c
Roland McGrathe47ab762005-11-17 03:16:00 +000074libebl_i386_pic_a_SOURCES = $(i386_SRCS)
75am_libebl_i386_pic_a_OBJECTS = $(i386_SRCS:.c=.os)
76
77sh_SRCS = sh_init.c sh_symbol.c
78libebl_sh_pic_a_SOURCES = $(sh_SRCS)
79am_libebl_sh_pic_a_OBJECTS = $(sh_SRCS:.c=.os)
80
Roland McGrath994b4892005-12-05 22:46:21 +000081x86_64_SRCS = x86_64_init.c x86_64_symbol.c x86_64_corenote.c \
Roland McGrathcb6d8652007-08-23 08:10:54 +000082 x86_64_retval.c x86_64_regs.c i386_auxv.c
Roland McGrathe47ab762005-11-17 03:16:00 +000083libebl_x86_64_pic_a_SOURCES = $(x86_64_SRCS)
84am_libebl_x86_64_pic_a_OBJECTS = $(x86_64_SRCS:.c=.os)
85
Roland McGrath95024622006-07-21 10:06:31 +000086ia64_SRCS = ia64_init.c ia64_symbol.c ia64_regs.c ia64_retval.c
Roland McGrathe47ab762005-11-17 03:16:00 +000087libebl_ia64_pic_a_SOURCES = $(ia64_SRCS)
88am_libebl_ia64_pic_a_OBJECTS = $(ia64_SRCS:.c=.os)
89
Roland McGrathcb6d8652007-08-23 08:10:54 +000090alpha_SRCS = alpha_init.c alpha_symbol.c alpha_retval.c alpha_regs.c \
91 alpha_corenote.c
Roland McGrathe47ab762005-11-17 03:16:00 +000092libebl_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
Ulrich Drepperb597dfa2007-10-16 05:21:27 +000099sparc_SRCS = sparc_init.c sparc_symbol.c sparc_regs.c sparc_retval.c \
100 sparc_corenote.c sparc64_corenote.c sparc_auxv.c
Roland McGrathe47ab762005-11-17 03:16:00 +0000101libebl_sparc_pic_a_SOURCES = $(sparc_SRCS)
102am_libebl_sparc_pic_a_OBJECTS = $(sparc_SRCS:.c=.os)
103
Roland McGrathcb6d8652007-08-23 08:10:54 +0000104ppc_SRCS = ppc_init.c ppc_symbol.c ppc_retval.c ppc_regs.c \
105 ppc_corenote.c ppc_auxv.c
Roland McGrathe47ab762005-11-17 03:16:00 +0000106libebl_ppc_pic_a_SOURCES = $(ppc_SRCS)
107am_libebl_ppc_pic_a_OBJECTS = $(ppc_SRCS:.c=.os)
108
Roland McGrathcb6d8652007-08-23 08:10:54 +0000109ppc64_SRCS = ppc64_init.c ppc64_symbol.c ppc64_retval.c \
110 ppc64_corenote.c ppc_regs.c ppc_auxv.c
Roland McGrathe47ab762005-11-17 03:16:00 +0000111libebl_ppc64_pic_a_SOURCES = $(ppc64_SRCS)
112am_libebl_ppc64_pic_a_OBJECTS = $(ppc64_SRCS:.c=.os)
113
Roland McGrath321327a2006-01-13 00:51:21 +0000114s390_SRCS = s390_init.c s390_symbol.c s390_regs.c s390_retval.c
Roland McGrathe47ab762005-11-17 03:16:00 +0000115libebl_s390_pic_a_SOURCES = $(s390_SRCS)
116am_libebl_s390_pic_a_OBJECTS = $(s390_SRCS:.c=.os)
117
118
Roland McGrathc812a832006-08-08 20:02:11 +0000119%.os: %.c
Roland McGrathe47ab762005-11-17 03:16:00 +0000120 if $(COMPILE) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \
121 -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \
Roland McGrathc812a832006-08-08 20:02:11 +0000122 then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
Roland McGrathe47ab762005-11-17 03:16:00 +0000123 else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
124 fi
125
126install: install-am install-ebl-modules
127install-ebl-modules:
128 $(mkinstalldirs) $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)
129 for m in $(modules); do \
130 $(INSTALL_PROGRAM) libebl_$${m}.so $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}-$(PACKAGE_VERSION).so; \
131 ln -fs libebl_$${m}-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}.so; \
132 done
133
134uninstall: uninstall-am
135 for m in $(modules); do \
136 rm -f $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}-$(PACKAGE_VERSION).so; \
137 rm -f $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}.so; \
138 done
139 rmdir --ignore-fail-on-non-empty $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)
Roland McGrathe47ab762005-11-17 03:16:00 +0000140
Roland McGrathcb6d8652007-08-23 08:10:54 +0000141noinst_HEADERS = libebl_CPU.h common-reloc.c linux-core-note.c
Roland McGrathe47ab762005-11-17 03:16:00 +0000142EXTRA_DIST = $(foreach m,$(modules),$($(m)_SRCS)) $(modules:=_reloc.def)
143
144CLEANFILES = *.gcno *.gcda \
Roland McGrath3dca43b2005-11-18 02:30:43 +0000145 $(foreach m,$(modules),\
146 libebl_$(m).so $(am_libebl_$(m)_pic_a_OBJECTS))