fix edis to only try to link in the x86 parts if the x86 backend is
[oota-llvm.git] / tools / edis / Makefile
1 ##===- tools/ed/Makefile -----------------------------------*- Makefile -*-===##
2
3 #                     The LLVM Compiler Infrastructure
4 #
5 # This file is distributed under the University of Illinois Open Source
6 # License. See LICENSE.TXT for details.
7
8 ##===----------------------------------------------------------------------===##
9
10 LEVEL = ../..
11 LIBRARYNAME = EnhancedDisassembly
12 LINK_LIBS_IN_SHARED = 1
13 SHARED_LIBRARY = 1
14
15 EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/EnhancedDisassembly.exports
16
17 # Include this here so we can get the configuration of the targets
18 # that have been configured for construction. We have to do this 
19 # early so we can set up LINK_COMPONENTS before including Makefile.rules
20 include $(LEVEL)/Makefile.config
21
22 LINK_COMPONENTS := $(TARGETS_TO_BUILD) mcdisassembler
23
24 # If the X86 target is enabled, link in the asmprinter and disassembler.
25 ifneq ($(filter $(TARGETS_TO_BUILD), X86),)
26 LINK_COMPONENTS += x86asmprinter x86disassembler
27 endif
28
29 # If the X86 target is enabled, link in the asmprinter and disassembler.
30 ifneq ($(filter $(TARGETS_TO_BUILD), ARM),)
31 LINK_COMPONENTS += armasmprinter armdisassembler
32 endif
33
34 include $(LEVEL)/Makefile.common
35
36 ifeq ($(HOST_OS),Darwin)
37     # extra options to override libtool defaults 
38     LLVMLibsOptions    := $(LLVMLibsOptions)  \
39                          -avoid-version \
40                          -Wl,-dead_strip
41
42     ifdef EDIS_VERSION
43         LLVMLibsOptions    := $(LLVMLibsOptions) -Wl,-current_version -Wl,$(EDIS_VERSION) \
44                               -Wl,-compatibility_version -Wl,1
45     endif
46
47     # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
48     DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
49     ifneq ($(DARWIN_VERS),8)
50        LLVMLibsOptions    := $(LLVMLibsOptions)  \
51                             -no-undefined -Wl,-install_name \
52                             -Wl,"@rpath/lib$(LIBRARYNAME)$(SHLIBEXT)"
53     endif
54 endif
55