The Android Open Source Project | 441f72d | 2009-03-03 19:29:28 -0800 | [diff] [blame] | 1 | ## Process this file with automake to create Makefile.in |
| 2 | ## Configure input file for elfutils. |
| 3 | ## |
| 4 | ## Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. |
| 5 | ## |
| 6 | ## This program is Open Source software; you can redistribute it and/or |
| 7 | ## modify it under the terms of the Open Software License version 1.0 as |
| 8 | ## published by the Open Source Initiative. |
| 9 | ## |
| 10 | ## You should have received a copy of the Open Software License along |
| 11 | ## with this program; if not, you may obtain a copy of the Open Software |
| 12 | ## License version 1.0 from http://www.opensource.org/licenses/osl.php or |
| 13 | ## by writing the Open Source Initiative c/o Lawrence Rosen, Esq., |
| 14 | ## 3001 King Ranch Road, Ukiah, CA 95482. |
| 15 | ## |
| 16 | DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\" |
| 17 | if MUDFLAP |
| 18 | AM_CFLAGS = -Wall -Wshadow -fpic |
| 19 | else |
| 20 | AM_CFLAGS = -Wall -Werror -Wshadow -fpic |
| 21 | endif |
| 22 | AM_CFLAGS += -DLIBSTR=\"$$(basename $(libdir))\" |
| 23 | |
| 24 | INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/lib -I.. |
| 25 | VERSION = 1 |
| 26 | PACKAGE_VERSION = @PACKAGE_VERSION@ |
| 27 | |
| 28 | lib_LIBRARIES = libebl.a |
| 29 | modules = i386 sh mips x86_64 ia64 alpha arm sparc ppc ppc64 |
| 30 | noinst_LIBRARIES = libebl_i386_pic.a libebl_sh_pic.a libebl_mips_pic.a \ |
| 31 | libebl_x86_64_pic.a libebl_ia64_pic.a libebl_alpha_pic.a \ |
| 32 | libebl_arm_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \ |
| 33 | libebl_ppc64_pic.a |
| 34 | noinst_PROGRAMS = $(noinst_LIBRARIES:_pic.a=.so) |
| 35 | |
| 36 | euincludedir = $(includedir)/elfutils |
| 37 | euinclude_HEADERS = libebl.h |
| 38 | |
| 39 | gen_SOURCES = eblopenbackend.c eblclosebackend.c eblstrtab.c \ |
| 40 | eblreloctypename.c eblsegmenttypename.c \ |
| 41 | eblsectiontypename.c eblmachineflagname.c \ |
| 42 | eblsymboltypename.c ebldynamictagname.c eblsectionname.c \ |
| 43 | eblobjecttypename.c eblsymbolbindingname.c \ |
| 44 | eblbackendname.c eblshflagscombine.c eblwstrtab.c \ |
| 45 | eblgstrtab.c eblosabiname.c eblmachineflagcheck.c \ |
| 46 | eblreloctypecheck.c eblrelocvaliduse.c ebldynamictagcheck.c \ |
| 47 | eblcorenotetypename.c eblobjnotetypename.c \ |
| 48 | eblcorenote.c eblobjnote.c ebldebugscnp.c \ |
| 49 | eblgotpcreloccheck.c |
| 50 | |
| 51 | libebl_a_SOURCES = $(gen_SOURCES) |
| 52 | |
| 53 | # |
| 54 | # XXX Use --enable-new-dtags as soon as ld.so handles DT_RUNPATH when |
| 55 | # using dlopen correctly. |
| 56 | # -Wl,--rpath,\$$ORIGIN/elfutils \ |
| 57 | # |
| 58 | i386_SRCS = i386_init.c i386_destr.c i386_symbol.c i386_corenote.c |
| 59 | libebl_i386_pic_a_SOURCES = |
| 60 | am_libebl_i386_pic_a_OBJECTS = $(i386_SRCS:.c=.os) |
| 61 | |
| 62 | if MUDFLAP |
| 63 | libelf = ../libelf/libelf.a |
| 64 | libmudflap = -lmudflap |
| 65 | else |
| 66 | libelf = ../libelf/libelf.so |
| 67 | libmudflap = |
| 68 | endif |
| 69 | |
| 70 | libebl_i386_so_SOURCES = |
| 71 | libebl_i386.so: libebl_i386_pic.a libebl_i386.map |
| 72 | $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ |
| 73 | -Wl,--version-script,$(srcdir)/libebl_i386.map \ |
| 74 | -Wl,-z,defs $(libelf) $(libmudflap) |
| 75 | |
| 76 | |
| 77 | sh_SRCS = sh_init.c sh_destr.c sh_symbol.c |
| 78 | libebl_sh_pic_a_SOURCES = |
| 79 | am_libebl_sh_pic_a_OBJECTS = $(sh_SRCS:.c=.os) |
| 80 | |
| 81 | libebl_sh_so_SOURCES = |
| 82 | libebl_sh.so: libebl_sh_pic.a libebl_sh.map |
| 83 | $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ |
| 84 | -Wl,--version-script,$(srcdir)/libebl_sh.map \ |
| 85 | -Wl,-z,defs $(libmudflap) |
| 86 | |
| 87 | |
| 88 | mips_SRCS = mips_init.c mips_destr.c mips_symbol.c |
| 89 | libebl_mips_pic_a_SOURCES = |
| 90 | am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os) |
| 91 | |
| 92 | libebl_mips_so_SOURCES = |
| 93 | libebl_mips.so: libebl_mips_pic.a libebl_mips.map |
| 94 | $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ |
| 95 | -Wl,--version-script,$(srcdir)/libebl_mips.map \ |
| 96 | -Wl,-z,defs $(libmudflap) |
| 97 | |
| 98 | |
| 99 | x86_64_SRCS = x86_64_init.c x86_64_destr.c x86_64_symbol.c |
| 100 | libebl_x86_64_pic_a_SOURCES = |
| 101 | am_libebl_x86_64_pic_a_OBJECTS = $(x86_64_SRCS:.c=.os) |
| 102 | |
| 103 | libebl_x86_64_so_SOURCES = |
| 104 | libebl_x86_64.so: libebl_x86_64_pic.a libebl_x86_64.map |
| 105 | $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ |
| 106 | -Wl,--version-script,$(srcdir)/libebl_x86_64.map \ |
| 107 | -Wl,-z,defs $(libelf) $(libmudflap) |
| 108 | |
| 109 | |
| 110 | ia64_SRCS = ia64_init.c ia64_destr.c ia64_symbol.c |
| 111 | libebl_ia64_pic_a_SOURCES = |
| 112 | am_libebl_ia64_pic_a_OBJECTS = $(ia64_SRCS:.c=.os) |
| 113 | |
| 114 | libebl_ia64_so_SOURCES = |
| 115 | libebl_ia64.so: libebl_ia64_pic.a libebl_ia64.map |
| 116 | $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ |
| 117 | -Wl,--version-script,$(srcdir)/libebl_ia64.map \ |
| 118 | -Wl,-z,defs $(libmudflap) |
| 119 | |
| 120 | |
| 121 | alpha_SRCS = alpha_init.c alpha_destr.c alpha_symbol.c |
| 122 | libebl_alpha_pic_a_SOURCES = |
| 123 | am_libebl_alpha_pic_a_OBJECTS = $(alpha_SRCS:.c=.os) |
| 124 | |
| 125 | libebl_alpha_so_SOURCES = |
| 126 | libebl_alpha.so: libebl_alpha_pic.a libebl_alpha.map |
| 127 | $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ |
| 128 | -Wl,--version-script,$(srcdir)/libebl_alpha.map \ |
| 129 | -Wl,-z,defs $(libmudflap) |
| 130 | |
| 131 | |
| 132 | arm_SRCS = arm_init.c arm_destr.c arm_symbol.c |
| 133 | libebl_arm_pic_a_SOURCES = |
| 134 | am_libebl_arm_pic_a_OBJECTS = $(arm_SRCS:.c=.os) |
| 135 | |
| 136 | libebl_arm_so_SOURCES = |
| 137 | libebl_arm.so: libebl_arm_pic.a libebl_arm.map |
| 138 | $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ |
| 139 | -Wl,--version-script,$(srcdir)/libebl_arm.map \ |
| 140 | -Wl,-z,defs $(libmudflap) |
| 141 | |
| 142 | |
| 143 | sparc_SRCS = sparc_init.c sparc_destr.c sparc_symbol.c |
| 144 | libebl_sparc_pic_a_SOURCES = |
| 145 | am_libebl_sparc_pic_a_OBJECTS = $(sparc_SRCS:.c=.os) |
| 146 | |
| 147 | libebl_sparc_so_SOURCES = |
| 148 | libebl_sparc.so: libebl_sparc_pic.a libebl_sparc.map |
| 149 | $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ |
| 150 | -Wl,--version-script,$(srcdir)/libebl_sparc.map \ |
| 151 | -Wl,-z,defs $(libmudflap) |
| 152 | |
| 153 | |
| 154 | ppc_SRCS = ppc_init.c ppc_destr.c ppc_symbol.c |
| 155 | libebl_ppc_pic_a_SOURCES = |
| 156 | am_libebl_ppc_pic_a_OBJECTS = $(ppc_SRCS:.c=.os) |
| 157 | |
| 158 | libebl_ppc_so_SOURCES = |
| 159 | libebl_ppc.so: libebl_ppc_pic.a libebl_ppc.map |
| 160 | $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ |
| 161 | -Wl,--version-script,$(srcdir)/libebl_ppc.map \ |
| 162 | -Wl,-z,defs $(libelf) $(libmudflap) |
| 163 | |
| 164 | |
| 165 | ppc64_SRCS = ppc64_init.c ppc64_destr.c ppc64_symbol.c |
| 166 | libebl_ppc64_pic_a_SOURCES = |
| 167 | am_libebl_ppc64_pic_a_OBJECTS = $(ppc64_SRCS:.c=.os) |
| 168 | |
| 169 | libebl_ppc64_so_SOURCES = |
| 170 | libebl_ppc64.so: libebl_ppc64_pic.a libebl_ppc64.map |
| 171 | $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ |
| 172 | -Wl,--version-script,$(srcdir)/libebl_ppc64.map \ |
| 173 | -Wl,-z,defs $(libelf) $(libmudflap) |
| 174 | |
| 175 | |
| 176 | %.os: %.c %.o |
| 177 | if $(COMPILE) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \ |
| 178 | -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \ |
| 179 | then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \ |
| 180 | rm -f "$(DEPDIR)/$*.Tpo"; \ |
| 181 | else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ |
| 182 | fi |
| 183 | |
| 184 | install: install-am |
| 185 | $(mkinstalldirs) $(DESTDIR)$(libdir)/elfutils |
| 186 | for m in $(modules); do \ |
| 187 | $(INSTALL_PROGRAM) libebl_$${m}.so $(DESTDIR)$(libdir)/elfutils/libebl_$${m}-$(PACKAGE_VERSION).so; \ |
| 188 | ln -fs libebl_$${m}-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/elfutils/libebl_$${m}.so; \ |
| 189 | done |
| 190 | |
| 191 | uninstall: uninstall-am |
| 192 | for m in $(modules); do \ |
| 193 | rm -f $(DESTDIR)$(libdir)/elfutils/libebl_$${m}-$(PACKAGE_VERSION).so; \ |
| 194 | rm -f $(DESTDIR)$(libdir)/elfutils/libebl_$${m}.so; \ |
| 195 | done |
| 196 | rmdir --ignore-fail-on-non-empty $(DESTDIR)$(libdir)/elfutils |
| 197 | rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils |
| 198 | |
| 199 | noinst_HEADERS = libeblP.h $(noinst_LIBRARIES:%_pic.a=%.h) |
| 200 | EXTRA_DIST = $(noinst_LIBRARIES:%_pic.a=%.map) \ |
| 201 | $(foreach m,$(modules),$($(m)_SRCS)) |
| 202 | |
| 203 | CLEANFILES = $(am_libebl_pic_a_OBJECTS) \ |
| 204 | $(foreach m,$(modules),$(am_libebl_$(m)_pic_a_OBJECTS)) |