Generalize the EXPORTED_SYMBOL_FILE concept in the Makefiles to work with
[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
13 BUILT_SOURCES = EDInfo.inc
14
15 EXPORTED_SYMBOL_FILE = 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 ifeq ($(ENABLE_PIC),1)
23     ifneq ($(TARGET_OS), $(filter $(TARGET_OS), Cygwin MingW))
24         LINK_LIBS_IN_SHARED = 1
25         SHARED_LIBRARY = 1
26     endif
27 endif
28
29 LINK_COMPONENTS := $(TARGETS_TO_BUILD) x86asmprinter x86disassembler
30
31 include $(LEVEL)/Makefile.common
32
33 ifeq ($(HOST_OS),Darwin)
34     # extra options to override libtool defaults 
35     LLVMLibsOptions    := $(LLVMLibsOptions)  \
36                          -avoid-version \
37                          -Wl,-dead_strip
38
39     ifdef EDIS_VERSION
40         LLVMLibsOptions    := $(LLVMLibsOptions) -Wl,-current_version -Wl,$(EDIS_VERSION) \
41                               -Wl,-compatibility_version -Wl,1
42     endif
43
44     # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
45     DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
46     ifneq ($(DARWIN_VERS),8)
47        LLVMLibsOptions    := $(LLVMLibsOptions)  \
48                             -no-undefined -Wl,-install_name \
49                             -Wl,"@rpath/lib$(LIBRARYNAME)$(SHLIBEXT)"
50     endif
51 endif
52
53 EDInfo.inc:     $(TBLGEN)
54         $(Echo) "Building semantic information header"
55         $(Verb) $(TableGen) -o $(call SYSPATH, $@) -gen-enhanced-disassembly-header /dev/null
56
57 clean::
58         -$(Verb) $(RM) -f EDInfo.inc