blob: b16f948654fda84ae97495d61372796ee1a8ee16 [file] [log] [blame]
Roland McGrathe47ab762005-11-17 03:16:00 +00001## Process this file with automake to create Makefile.in
2##
Mark Wielaardf48eb6b2014-01-23 00:56:41 +01003## Copyright (C) 2000-2010, 2013, 2014 Red Hat, Inc.
Jeff Kenton257dcf42012-08-22 09:00:03 -04004## Copyright (C) 2012 Tilera Corporation
Mark Wielaardde2ed972012-06-05 17:15:16 +02005## This file is part of elfutils.
Roland McGrathe47ab762005-11-17 03:16:00 +00006##
Mark Wielaardde2ed972012-06-05 17:15:16 +02007## This file is free software; you can redistribute it and/or modify
8## it under the terms of either
Roland McGrathe47ab762005-11-17 03:16:00 +00009##
Mark Wielaardde2ed972012-06-05 17:15:16 +020010## * 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
Ulrich Drepper361df7d2006-04-04 21:38:57 +000023## 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##
Mark Wielaardde2ed972012-06-05 17:15:16 +020027## 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/>.
Roland McGrath22359e22010-02-15 15:57:03 -080030include $(top_srcdir)/config/eu.am
Mark Wielaardcdaaf212013-04-25 16:50:11 -040031AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
Roland McGrath22359e22010-02-15 15:57:03 -080032 -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
Roland McGrathe47ab762005-11-17 03:16:00 +000033
34
Petr Machata98c8a732013-11-26 03:10:31 +010035modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
36 tilegx
37libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
38 libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
39 libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
40 libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a
Roland McGrathe47ab762005-11-17 03:16:00 +000041noinst_LIBRARIES = $(libebl_pic)
42noinst_DATA = $(libebl_pic:_pic.a=.so)
43
44
Roland McGrathe47ab762005-11-17 03:16:00 +000045libelf = ../libelf/libelf.so
46libdw = ../libdw/libdw.so
Roland McGrathe47ab762005-11-17 03:16:00 +000047
Roland McGrath3c84db32009-06-24 17:41:40 -070048i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c i386_cfi.c \
Jan Kratochvil0b867462013-05-30 14:37:38 +020049 i386_retval.c i386_regs.c i386_auxv.c i386_syscall.c \
50 i386_initreg.c
Ulrich Drepper3cbdd382008-01-02 17:44:39 +000051cpu_i386 = ../libcpu/libcpu_i386.a
Roland McGrathe47ab762005-11-17 03:16:00 +000052libebl_i386_pic_a_SOURCES = $(i386_SRCS)
53am_libebl_i386_pic_a_OBJECTS = $(i386_SRCS:.c=.os)
54
Matt Flemingd80f0b22010-04-10 19:13:37 -070055sh_SRCS = sh_init.c sh_symbol.c sh_corenote.c sh_regs.c sh_retval.c
Roland McGrathe47ab762005-11-17 03:16:00 +000056libebl_sh_pic_a_SOURCES = $(sh_SRCS)
57am_libebl_sh_pic_a_OBJECTS = $(sh_SRCS:.c=.os)
58
Roland McGrath3c84db32009-06-24 17:41:40 -070059x86_64_SRCS = x86_64_init.c x86_64_symbol.c x86_64_corenote.c x86_64_cfi.c \
Jan Kratochvil0b867462013-05-30 14:37:38 +020060 x86_64_retval.c x86_64_regs.c i386_auxv.c x86_64_syscall.c \
H.J. Lu28ce4e82015-03-12 14:51:42 -070061 x86_64_initreg.c x32_corenote.c
Ulrich Drepperff993222008-01-09 05:39:28 +000062cpu_x86_64 = ../libcpu/libcpu_x86_64.a
Roland McGrathe47ab762005-11-17 03:16:00 +000063libebl_x86_64_pic_a_SOURCES = $(x86_64_SRCS)
64am_libebl_x86_64_pic_a_OBJECTS = $(x86_64_SRCS:.c=.os)
65
Roland McGrath95024622006-07-21 10:06:31 +000066ia64_SRCS = ia64_init.c ia64_symbol.c ia64_regs.c ia64_retval.c
Roland McGrathe47ab762005-11-17 03:16:00 +000067libebl_ia64_pic_a_SOURCES = $(ia64_SRCS)
68am_libebl_ia64_pic_a_OBJECTS = $(ia64_SRCS:.c=.os)
69
Roland McGrathcb6d8652007-08-23 08:10:54 +000070alpha_SRCS = alpha_init.c alpha_symbol.c alpha_retval.c alpha_regs.c \
Roland McGrath059c83e2008-02-21 06:19:39 +000071 alpha_corenote.c alpha_auxv.c
Roland McGrathe47ab762005-11-17 03:16:00 +000072libebl_alpha_pic_a_SOURCES = $(alpha_SRCS)
73am_libebl_alpha_pic_a_OBJECTS = $(alpha_SRCS:.c=.os)
74
Roland McGratheb9ba472009-04-14 18:44:45 -070075arm_SRCS = arm_init.c arm_symbol.c arm_regs.c arm_corenote.c \
Mark Wielaard225dddf2014-01-26 20:16:48 +010076 arm_auxv.c arm_attrs.c arm_retval.c arm_cfi.c arm_initreg.c
Roland McGrathe47ab762005-11-17 03:16:00 +000077libebl_arm_pic_a_SOURCES = $(arm_SRCS)
78am_libebl_arm_pic_a_OBJECTS = $(arm_SRCS:.c=.os)
79
Petr Machata98c8a732013-11-26 03:10:31 +010080aarch64_SRCS = aarch64_init.c aarch64_regs.c aarch64_symbol.c \
Mark Wielaard66637fa2014-04-09 11:48:23 +020081 aarch64_corenote.c aarch64_retval.c aarch64_cfi.c \
82 aarch64_initreg.c
Petr Machata98c8a732013-11-26 03:10:31 +010083libebl_aarch64_pic_a_SOURCES = $(aarch64_SRCS)
84am_libebl_aarch64_pic_a_OBJECTS = $(aarch64_SRCS:.c=.os)
Petr Machata98c8a732013-11-26 03:10:31 +010085
Ulrich Drepperb597dfa2007-10-16 05:21:27 +000086sparc_SRCS = sparc_init.c sparc_symbol.c sparc_regs.c sparc_retval.c \
Jose E. Marchesia8a22a32015-12-08 19:10:42 +010087 sparc_corenote.c sparc64_corenote.c sparc_auxv.c sparc_attrs.c \
Jose E. Marchesi67c15c42015-12-08 19:10:43 +010088 sparc_cfi.c sparc_initreg.c
Roland McGrathe47ab762005-11-17 03:16:00 +000089libebl_sparc_pic_a_SOURCES = $(sparc_SRCS)
90am_libebl_sparc_pic_a_OBJECTS = $(sparc_SRCS:.c=.os)
91
Roland McGrathcb6d8652007-08-23 08:10:54 +000092ppc_SRCS = ppc_init.c ppc_symbol.c ppc_retval.c ppc_regs.c \
Jan Kratochviled9d2ca2013-08-27 22:49:36 +020093 ppc_corenote.c ppc_auxv.c ppc_attrs.c ppc_syscall.c \
Jan Kratochvil5cbf42a2013-12-15 18:56:17 +010094 ppc_cfi.c ppc_initreg.c
Roland McGrathe47ab762005-11-17 03:16:00 +000095libebl_ppc_pic_a_SOURCES = $(ppc_SRCS)
96am_libebl_ppc_pic_a_OBJECTS = $(ppc_SRCS:.c=.os)
97
Roland McGrathcb6d8652007-08-23 08:10:54 +000098ppc64_SRCS = ppc64_init.c ppc64_symbol.c ppc64_retval.c \
Jan Kratochviled9d2ca2013-08-27 22:49:36 +020099 ppc64_corenote.c ppc_regs.c ppc_auxv.c ppc_attrs.c ppc_syscall.c \
Mark Wielaard159ac522013-12-18 11:05:54 +0100100 ppc_cfi.c ppc_initreg.c ppc64_resolve_sym.c
Roland McGrathe47ab762005-11-17 03:16:00 +0000101libebl_ppc64_pic_a_SOURCES = $(ppc64_SRCS)
102am_libebl_ppc64_pic_a_OBJECTS = $(ppc64_SRCS:.c=.os)
103
Jan Kratochvilcc84d792012-10-10 19:32:05 +0200104s390_SRCS = s390_init.c s390_symbol.c s390_regs.c s390_retval.c \
Jan Kratochvilc6a41482013-12-17 18:49:54 +0100105 s390_corenote.c s390x_corenote.c s390_cfi.c s390_initreg.c \
106 s390_unwind.c
Roland McGrathe47ab762005-11-17 03:16:00 +0000107libebl_s390_pic_a_SOURCES = $(s390_SRCS)
108am_libebl_s390_pic_a_OBJECTS = $(s390_SRCS:.c=.os)
109
Jeff Kenton257dcf42012-08-22 09:00:03 -0400110tilegx_SRCS = tilegx_init.c tilegx_symbol.c tilegx_regs.c \
111 tilegx_retval.c tilegx_corenote.c
112libebl_tilegx_pic_a_SOURCES = $(tilegx_SRCS)
113am_libebl_tilegx_pic_a_OBJECTS = $(tilegx_SRCS:.c=.os)
114
Roland McGrathe47ab762005-11-17 03:16:00 +0000115
Roland McGrath9e924182010-02-18 14:33:48 -0800116libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
117 @rm -f $(@:.so=.map)
Josh Stonedaee4712015-10-05 11:04:15 -0700118 $(AM_V_at)echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \
Roland McGrath9e924182010-02-18 14:33:48 -0800119 > $(@:.so=.map)
Josh Stonedaee4712015-10-05 11:04:15 -0700120 $(AM_V_CCLD)$(LINK) -shared -o $(@:.map=.so) \
Roland McGrath9e924182010-02-18 14:33:48 -0800121 -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
122 -Wl,--version-script,$(@:.so=.map) \
Mark Wielaard32324792014-04-13 17:39:57 +0200123 -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw)
Ulrich Drepper898ed262014-12-18 12:32:39 -0500124 @$(textrel_check)
Ulrich Drepper3cbdd382008-01-02 17:44:39 +0000125
Ulrich Drepper3cbdd382008-01-02 17:44:39 +0000126libebl_i386.so: $(cpu_i386)
127libebl_x86_64.so: $(cpu_x86_64)
128
Roland McGrathe47ab762005-11-17 03:16:00 +0000129install: install-am install-ebl-modules
130install-ebl-modules:
131 $(mkinstalldirs) $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)
132 for m in $(modules); do \
133 $(INSTALL_PROGRAM) libebl_$${m}.so $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}-$(PACKAGE_VERSION).so; \
134 ln -fs libebl_$${m}-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}.so; \
135 done
136
137uninstall: uninstall-am
138 for m in $(modules); do \
139 rm -f $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}-$(PACKAGE_VERSION).so; \
140 rm -f $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)/libebl_$${m}.so; \
141 done
142 rmdir --ignore-fail-on-non-empty $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)
Roland McGrathe47ab762005-11-17 03:16:00 +0000143
Roland McGratha845f682008-12-03 03:41:58 +0000144noinst_HEADERS = libebl_CPU.h common-reloc.c linux-core-note.c x86_corenote.c
Roland McGrathe47ab762005-11-17 03:16:00 +0000145EXTRA_DIST = $(foreach m,$(modules),$($(m)_SRCS)) $(modules:=_reloc.def)
146
Roland McGrath22359e22010-02-15 15:57:03 -0800147CLEANFILES += $(foreach m,$(modules),\
Roland McGrath9e924182010-02-18 14:33:48 -0800148 libebl_$(m).map libebl_$(m).so \
149 $(am_libebl_$(m)_pic_a_OBJECTS))