Imported Upstream version 0.155
[platform/upstream/elfutils.git] / backends / Makefile.am
1 ## Process this file with automake to create Makefile.in
2 ##
3 ## Copyright (C) 2000-2010 Red Hat, Inc.
4 ## Copyright (C) 2012 Tilera Corporation
5 ## This file is part of elfutils.
6 ##
7 ## This file is free software; you can redistribute it and/or modify
8 ## it under the terms of either
9 ##
10 ##   * the GNU Lesser General Public License as published by the Free
11 ##     Software Foundation; either version 3 of the License, or (at
12 ##     your option) any later version
13 ##
14 ## or
15 ##
16 ##   * the GNU General Public License as published by the Free
17 ##     Software Foundation; either version 2 of the License, or (at
18 ##     your option) any later version
19 ##
20 ## or both in parallel, as here.
21 ##
22 ## elfutils is distributed in the hope that it will be useful, but
23 ## WITHOUT ANY WARRANTY; without even the implied warranty of
24 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
25 ## General Public License for more details.
26 ##
27 ## You should have received copies of the GNU General Public License and
28 ## the GNU Lesser General Public License along with this program.  If
29 ## not, see <http://www.gnu.org/licenses/>.
30 include $(top_srcdir)/config/eu.am
31 INCLUDES += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
32            -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
33
34
35 modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 tilegx
36 libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
37              libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
38              libebl_sparc_pic.a libebl_ppc_pic.a libebl_ppc64_pic.a \
39              libebl_s390_pic.a libebl_tilegx_pic.a
40 noinst_LIBRARIES = $(libebl_pic)
41 noinst_DATA = $(libebl_pic:_pic.a=.so)
42
43
44 if MUDFLAP
45 libelf = ../libelf/libelf.a
46 libdw = ../libdw/libdw.a
47 else
48 libelf = ../libelf/libelf.so
49 libdw = ../libdw/libdw.so
50 endif
51
52 i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c i386_cfi.c \
53             i386_retval.c i386_regs.c i386_auxv.c i386_syscall.c
54 cpu_i386 = ../libcpu/libcpu_i386.a
55 libebl_i386_pic_a_SOURCES = $(i386_SRCS)
56 am_libebl_i386_pic_a_OBJECTS = $(i386_SRCS:.c=.os)
57
58 sh_SRCS = sh_init.c sh_symbol.c sh_corenote.c sh_regs.c sh_retval.c
59 libebl_sh_pic_a_SOURCES = $(sh_SRCS)
60 am_libebl_sh_pic_a_OBJECTS = $(sh_SRCS:.c=.os)
61
62 x86_64_SRCS = x86_64_init.c x86_64_symbol.c x86_64_corenote.c x86_64_cfi.c \
63               x86_64_retval.c x86_64_regs.c i386_auxv.c x86_64_syscall.c
64 cpu_x86_64 = ../libcpu/libcpu_x86_64.a
65 libebl_x86_64_pic_a_SOURCES = $(x86_64_SRCS)
66 am_libebl_x86_64_pic_a_OBJECTS = $(x86_64_SRCS:.c=.os)
67
68 ia64_SRCS = ia64_init.c ia64_symbol.c ia64_regs.c ia64_retval.c
69 libebl_ia64_pic_a_SOURCES = $(ia64_SRCS)
70 am_libebl_ia64_pic_a_OBJECTS = $(ia64_SRCS:.c=.os)
71
72 alpha_SRCS = alpha_init.c alpha_symbol.c alpha_retval.c alpha_regs.c \
73              alpha_corenote.c alpha_auxv.c
74 libebl_alpha_pic_a_SOURCES = $(alpha_SRCS)
75 am_libebl_alpha_pic_a_OBJECTS = $(alpha_SRCS:.c=.os)
76
77 arm_SRCS = arm_init.c arm_symbol.c arm_regs.c arm_corenote.c \
78            arm_auxv.c arm_attrs.c arm_retval.c
79 libebl_arm_pic_a_SOURCES = $(arm_SRCS)
80 am_libebl_arm_pic_a_OBJECTS = $(arm_SRCS:.c=.os)
81
82 sparc_SRCS = sparc_init.c sparc_symbol.c sparc_regs.c sparc_retval.c \
83              sparc_corenote.c sparc64_corenote.c sparc_auxv.c
84 libebl_sparc_pic_a_SOURCES = $(sparc_SRCS)
85 am_libebl_sparc_pic_a_OBJECTS = $(sparc_SRCS:.c=.os)
86
87 ppc_SRCS = ppc_init.c ppc_symbol.c ppc_retval.c ppc_regs.c \
88            ppc_corenote.c ppc_auxv.c ppc_attrs.c ppc_syscall.c
89 libebl_ppc_pic_a_SOURCES = $(ppc_SRCS)
90 am_libebl_ppc_pic_a_OBJECTS = $(ppc_SRCS:.c=.os)
91
92 ppc64_SRCS = ppc64_init.c ppc64_symbol.c ppc64_retval.c \
93              ppc64_corenote.c ppc_regs.c ppc_auxv.c ppc_attrs.c ppc_syscall.c
94 libebl_ppc64_pic_a_SOURCES = $(ppc64_SRCS)
95 am_libebl_ppc64_pic_a_OBJECTS = $(ppc64_SRCS:.c=.os)
96
97 s390_SRCS = s390_init.c s390_symbol.c s390_regs.c s390_retval.c
98 libebl_s390_pic_a_SOURCES = $(s390_SRCS)
99 am_libebl_s390_pic_a_OBJECTS = $(s390_SRCS:.c=.os)
100
101 tilegx_SRCS = tilegx_init.c tilegx_symbol.c tilegx_regs.c \
102               tilegx_retval.c tilegx_corenote.c
103 libebl_tilegx_pic_a_SOURCES = $(tilegx_SRCS)
104 am_libebl_tilegx_pic_a_OBJECTS = $(tilegx_SRCS:.c=.os)
105
106
107 libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
108         @rm -f $(@:.so=.map)
109         echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \
110           > $(@:.so=.map)
111         $(LINK) -shared -o $(@:.map=.so) \
112                 -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
113                 -Wl,--version-script,$(@:.so=.map) \
114                 -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
115         $(textrel_check)
116
117 libebl_i386.so: $(cpu_i386)
118 libebl_x86_64.so: $(cpu_x86_64)
119
120 install: install-am install-ebl-modules
121 install-ebl-modules:
122         $(mkinstalldirs) $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)
123         for m in $(modules); do \
124           $(INSTALL_PROGRAM) libebl_$${m}.so $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}-$(PACKAGE_VERSION).so; \
125           ln -fs libebl_$${m}-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}.so; \
126         done
127
128 uninstall: uninstall-am
129         for m in $(modules); do \
130           rm -f $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}-$(PACKAGE_VERSION).so; \
131           rm -f $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}.so; \
132         done
133         rmdir --ignore-fail-on-non-empty $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)
134
135 noinst_HEADERS = libebl_CPU.h common-reloc.c linux-core-note.c x86_corenote.c
136 EXTRA_DIST = $(foreach m,$(modules),$($(m)_SRCS)) $(modules:=_reloc.def)
137
138 CLEANFILES += $(foreach m,$(modules),\
139                         libebl_$(m).map libebl_$(m).so \
140                         $(am_libebl_$(m)_pic_a_OBJECTS))