This provides support for the autoconfing & make build style.
The format, style and implementation follows that used within the llvm and clang projects.
TODO: implement out-of-source documentation builds.
llvm-svn: 210177
--- /dev/null
+##===- Makefile --------------------------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+# If LLD_LEVEL is not set, then we are the top-level Makefile. Otherwise, we
+# are being included from a subdirectory makefile.
+
+ifndef LLD_LEVEL
+
+IS_TOP_LEVEL := 1
+LLD_LEVEL := .
+DIRS := include lib tools utils unittests
+
+PARALLEL_DIRS :=
+
+endif
+
+ifeq ($(MAKECMDGOALS),libs-only)
+ DIRS := $(filter-out tools docs, $(DIRS))
+ OPTIONAL_DIRS :=
+endif
+ifeq ($(BUILD_LLD_ONLY),YES)
+ DIRS := $(filter-out docs unittests, $(DIRS))
+ OPTIONAL_DIRS :=
+endif
+
+###
+# Common Makefile code, shared by all lld Makefiles.
+
+# Set LLVM source root level.
+LEVEL := $(LLD_LEVEL)/../..
+
+# Include LLVM common makefile.
+include $(LEVEL)/Makefile.common
+
+ifneq ($(ENABLE_DOCS),1)
+ DIRS := $(filter-out docs, $(DIRS))
+endif
+
+CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLD_LEVEL)/include
+CPP.Flags += -I$(PROJ_OBJ_DIR)/$(LLD_LEVEL)/include
+
+###
+# lld Top Level specific stuff.
+
+ifeq ($(IS_TOP_LEVEL),1)
+
+ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
+$(RecursiveTargets)::
+ $(Verb) for dir in test unittests; do \
+ if [ -f $(PROJ_SRC_DIR)/$${dir}/Makefile ] && [ ! -f $${dir}/Makefile ]; then \
+ $(MKDIR) $${dir}; \
+ $(CP) $(PROJ_SRC_DIR)/$${dir}/Makefile $${dir}/Makefile; \
+ fi \
+ done
+endif
+
+test::
+ @ $(MAKE) -C test
+
+report::
+ @ $(MAKE) -C test report
+
+clean::
+ @ $(MAKE) -C test clean
+
+libs-only: all
+
+tags::
+ $(Verb) etags `find . -type f -name '*.h' -or -name '*.cpp' | \
+ grep -v /lib/Headers | grep -v /test/`
+
+cscope.files:
+ find tools lib include -name '*.cpp' \
+ -or -name '*.def' \
+ -or -name '*.td' \
+ -or -name '*.h' > cscope.files
+
+.PHONY: test report clean cscope.files
+
+endif
--- /dev/null
+LLD_LEVEL := ..
+DIRS := lld
+
+include $(LLD_LEVEL)/Makefile
--- /dev/null
+LLD_LEVEL := ../..
+DIRS :=
+
+include $(LLD_LEVEL)/Makefile
+
+install-local::
+ $(Echo) Installing lld include files
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir)
+ $(Verb) if test -d "$(PROJ_SRC_DIR)" ; then \
+ cd $(PROJ_SRC_DIR)/.. && \
+ for hdr in `find lld -type f \
+ '(' -name LICENSE.TXT \
+ -o -name '*.def' \
+ -o -name '*.h' \
+ -o -name '*.inc' \
+ ')' -print \
+ | grep -v CVS | grep -v .svn | grep -v .dir` ; do \
+ instdir=$(DESTDIR)`dirname "$(PROJ_includedir)/$$hdr"` ; \
+ if test \! -d "$$instdir" ; then \
+ $(EchoCmd) Making install directory $$instdir ; \
+ $(MKDIR) $$instdir ;\
+ fi ; \
+ $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
+ done ; \
+ fi
+ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
+ $(Verb) if test -d "$(PROJ_OBJ_ROOT)/tools/lld/include/lld" ; then \
+ cd $(PROJ_OBJ_ROOT)/tools/lld/include && \
+ for hdr in `find lld -type f \
+ '(' -name LICENSE.TXT \
+ -o -name '*.def' \
+ -o -name '*.h' \
+ -o -name '*.inc' \
+ ')' -print \
+ | grep -v CVS | grep -v .tmp | grep -v .dir` ; do \
+ instdir=$(DESTDIR)`dirname "$(PROJ_includedir)/$$hdr"` ; \
+ if test \! -d "$$instdir" ; then \
+ $(EchoCmd) Making install directory $$instdir ; \
+ $(MKDIR) $$instdir ;\
+ fi ; \
+ $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
+ done ; \
+ fi
+endif
--- /dev/null
+##===- lld/lib/Core/Makefile ---------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLD_LEVEL := ../..
+LIBRARYNAME := lldCore
+
+include $(LLD_LEVEL)/Makefile
--- /dev/null
+##===- lld/lib/Driver/Makefile ---------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLD_LEVEL := ../..
+LIBRARYNAME := lldDriver
+
+BUILT_SOURCES = CoreOptions.inc UniversalDriverOptions.inc DarwinLdOptions.inc \
+ GnuLdOptions.inc WinLinkOptions.inc
+
+TABLEGEN_INC_FILES_COMMON = 1
+
+include $(LLD_LEVEL)/Makefile
+
+$(ObjDir)/CoreOptions.inc.tmp : CoreOptions.td $(LLVM_TBLGEN) $(ObjDir)/.dir
+ $(Echo) "Building LLD CoreOptions Option tables with tblgen"
+ $(Verb) $(LLVMTableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $<
+
+$(ObjDir)/UniversalDriverOptions.inc.tmp : UniversalDriverOptions.td $(LLVM_TBLGEN) $(ObjDir)/.dir
+ $(Echo) "Building LLD Universal Driver Options tables with tblgen"
+ $(Verb) $(LLVMTableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $<
+
+$(ObjDir)/DarwinLdOptions.inc.tmp : DarwinLdOptions.td $(LLVM_TBLGEN) $(ObjDir)/.dir
+ $(Echo) "Building LLD Darwin ld Option tables with tblgen"
+ $(Verb) $(LLVMTableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $<
+
+$(ObjDir)/GnuLdOptions.inc.tmp : GnuLdOptions.td $(LLVM_TBLGEN) $(ObjDir)/.dir
+ $(Echo) "Building LLD Gnu ld Option tables with tblgen"
+ $(Verb) $(LLVMTableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $<
+
+$(ObjDir)/WinLinkOptions.inc.tmp : WinLinkOptions.td $(LLVM_TBLGEN) $(ObjDir)/.dir
+ $(Echo) "Building LLD WinLinkOptions Option tables with tblgen"
+ $(Verb) $(LLVMTableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $<
--- /dev/null
+##===- lib/Makefile ----------------------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+LLD_LEVEL := ..
+
+# ARCMigrate and Rewrite are always needed because of libclang.
+PARALLEL_DIRS = Core Driver Passes ReaderWriter
+
+include $(LLD_LEVEL)/../../Makefile.config
+
+include $(LLD_LEVEL)/Makefile
--- /dev/null
+##===- lld/lib/Passes/Makefile ---------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLD_LEVEL := ../..
+LIBRARYNAME := lldPasses
+
+include $(LLD_LEVEL)/Makefile
--- /dev/null
+##===- lld/lib/ReaderWriter/ELF/Hexagon/Makefile ----------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLD_LEVEL := ../../../..
+LIBRARYNAME := lldHexagonELFTarget
+USEDLIBS = lldCore.a
+
+CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLD_LEVEL)/lib/ReaderWriter/ELF/Hexagon -I$(PROJ_SRC_DIR)/$(LLD_LEVEL)/lib/ReaderWriter/ELF
+
+include $(LLD_LEVEL)/Makefile
--- /dev/null
+##===- lld/lib/ReaderWriter/ELF/Makefile --------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLD_LEVEL := ../../..
+LIBRARYNAME := lldELF
+USEDLIBS = lldHexagonELFTarget.a lldPPCELFTarget.a lldMipsELFTarget.a \
+ lldX86ELFTarget.a lldX86_64ELFTarget.a \
+ lldReaderWriter.a lldPasses.a
+
+CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLD_LEVEL)/lib/ReaderWriter/ELF
+
+# these link against this lib
+PARALLEL_DIRS := Hexagon PPC X86 X86_64 Mips
+
+include $(LLD_LEVEL)/Makefile
--- /dev/null
+##===- lld/lib/ReaderWriter/ELF/PPC/Makefile ----------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLD_LEVEL := ../../../..
+LIBRARYNAME := lldMipsELFTarget
+USEDLIBS = lldCore.a
+CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLD_LEVEL)/lib/ReaderWriter/ELF
+
+include $(LLD_LEVEL)/Makefile
--- /dev/null
+##===- lld/lib/ReaderWriter/ELF/PPC/Makefile ----------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLD_LEVEL := ../../../..
+LIBRARYNAME := lldPPCELFTarget
+USEDLIBS = lldCore.a
+CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLD_LEVEL)/lib/ReaderWriter/ELF
+
+include $(LLD_LEVEL)/Makefile
--- /dev/null
+##===- lld/lib/ReaderWriter/ELF/X86/Makefile ----------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLD_LEVEL := ../../../..
+LIBRARYNAME := lldX86ELFTarget
+USEDLIBS = lldCore.a
+CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLD_LEVEL)/lib/ReaderWriter/ELF
+
+include $(LLD_LEVEL)/Makefile
--- /dev/null
+##===- lld/lib/ReaderWriter/ELF/X86_64/Makefile ----------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLD_LEVEL := ../../../..
+LIBRARYNAME := lldX86_64ELFTarget
+USEDLIBS = lldCore.a
+CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLD_LEVEL)/lib/ReaderWriter/ELF
+
+include $(LLD_LEVEL)/Makefile
--- /dev/null
+##===- lld/lib/ReaderWriter/MachO/Makefile --------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLD_LEVEL := ../../..
+LIBRARYNAME := lldMachO
+USEDLIBS = lldReaderWriter.a lldCore.a
+
+include $(LLD_LEVEL)/Makefile
--- /dev/null
+##===- lld/lib/ReaderWriter/Makefile ---------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLD_LEVEL := ../..
+LIBRARYNAME := lldReaderWriter
+
+# these link against this lib
+PARALLEL_DIRS := ELF MachO Native PECOFF YAML
+
+include $(LLD_LEVEL)/Makefile
--- /dev/null
+##===- lld/lib/ReaderWriter/Native/Makefile --------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLD_LEVEL := ../../..
+LIBRARYNAME := lldNative
+USEDLIBS = lldReaderWriter.a lldCore.a
+
+include $(LLD_LEVEL)/Makefile
--- /dev/null
+##===- lld/lib/ReaderWriter/PECOFF/Makefile --------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLD_LEVEL := ../../..
+LIBRARYNAME := lldPECOFF
+USEDLIBS = lldReaderWriter.a lldCore.a
+
+include $(LLD_LEVEL)/Makefile
--- /dev/null
+##===- lld/lib/ReaderWriter/YAML/Makefile --------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLD_LEVEL := ../../..
+LIBRARYNAME := lldYAML
+USEDLIBS = lldReaderWriter.a lldCore.a
+
+include $(LLD_LEVEL)/Makefile
--- /dev/null
+LLD_LEVEL := ..
+include $(LLD_LEVEL)/Makefile
+
+# Test in all immediate subdirectories if unset.
+ifdef TESTSUITE
+TESTDIRS := $(TESTSUITE:%=$(PROJ_SRC_DIR)/%)
+else
+TESTDIRS ?= $(PROJ_SRC_DIR)
+endif
+
+# 'lit' wants objdir paths, so it will pick up the lit.site.cfg.
+TESTDIRS := $(TESTDIRS:$(PROJ_SRC_DIR)%=$(PROJ_OBJ_DIR)%)
+
+# Allow EXTRA_TESTDIRS to provide additional test directories.
+TESTDIRS += $(EXTRA_TESTDIRS)
+
+ifndef TESTARGS
+ifdef VERBOSE
+TESTARGS = -v
+else
+TESTARGS = -s -v
+endif
+endif
+
+# Make sure any extra test suites can find the main site config.
+LIT_ARGS := --param lld_site_config=$(PROJ_OBJ_DIR)/lit.site.cfg
+
+ifdef VG
+ LIT_ARGS += "--vg"
+endif
+
+all:: lit.site.cfg Unit/lit.site.cfg
+ @ echo '--- Running lld tests for $(TARGET_TRIPLE) ---'
+ @ $(PYTHON) $(LLVM_SRC_ROOT)/utils/lit/lit.py \
+ $(LIT_ARGS) $(TESTARGS) $(TESTDIRS)
+
+FORCE:
+
+lit.site.cfg: FORCE
+ @echo "Making lld 'lit.site.cfg' file..."
+ @$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g > lit.tmp
+ @$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> lit.tmp
+ @$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(ToolDir)=g >> lit.tmp
+ @$(ECHOPATH) s=@LLVM_LIBS_DIR@=$(LibDir)=g >> lit.tmp
+ @$(ECHOPATH) s=@LLD_SOURCE_DIR@=$(PROJ_SRC_DIR)/..=g >> lit.tmp
+ @$(ECHOPATH) s=@LLD_BINARY_DIR@=$(PROJ_OBJ_DIR)/..=g >> lit.tmp
+ @$(ECHOPATH) s=@TARGET_TRIPLE@=$(TARGET_TRIPLE)=g >> lit.tmp
+ @sed -f lit.tmp $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
+ @-rm -f lit.tmp
+
+Unit/lit.site.cfg: FORCE
+ @echo "Making lld 'Unit/lit.site.cfg' file..."
+ @$(MKDIR) $(dir $@)
+ @$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g > unit.tmp
+ @$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> unit.tmp
+ @$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(ToolDir)=g >> unit.tmp
+ @$(ECHOPATH) s=@LLVM_LIBS_DIR@=$(LibDir)=g >> unit.tmp
+ @$(ECHOPATH) s=@LLD_SOURCE_DIR@=$(PROJ_SRC_DIR)/..=g >> unit.tmp
+ @$(ECHOPATH) s=@LLD_BINARY_DIR@=$(PROJ_OBJ_DIR)/..=g >> unit.tmp
+ @$(ECHOPATH) s=@TARGET_TRIPLE@=$(TARGET_TRIPLE)=g >> unit.tmp
+ @$(ECHOPATH) s=@LLVM_BUILD_MODE@=$(BuildMode)=g >> unit.tmp
+ @$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> unit.tmp
+ @$(ECHOPATH) s=@SHLIBDIR@=$(SharedLibDir)=g >> unit.tmp
+ @$(ECHOPATH) s=@SHLIBPATH_VAR@=$(SHLIBPATH_VAR)=g >> unit.tmp
+ @sed -f unit.tmp $(PROJ_SRC_DIR)/Unit/lit.site.cfg.in > $@
+ @-rm -f unit.tmp
+
+clean::
+ @ find . -name Output | xargs rm -fr
+
+.PHONY: all report clean
--- /dev/null
+##===- tools/Makefile --------------------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLD_LEVEL := ..
+LEVEL := $(LLD_LEVEL)/../..
+
+include $(LLD_LEVEL)/../../Makefile.config
+
+DIRS := lld
+
+include $(LLD_LEVEL)/Makefile
--- /dev/null
+##===------- lld/Makefile --------------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===--------------------------------------------------------------------===##
+
+LLD_LEVEL := ../..
+
+TOOLNAME = lld
+
+# No plugins, optimize startup time.
+TOOL_NO_EXPORTS = 1
+
+#include /Makefile.config
+LEVEL := $(LLD_LEVEL)/../..
+include $(LEVEL)/Makefile.config
+
+LINK_COMPONENTS := $(TARGETS_TO_BUILD)
+USEDLIBS = lldDriver.a \
+ lldELF.a lldMachO.a lldPasses.a lldPECOFF.a lldYAML.a \
+ lldReaderWriter.a lldCore.a lldNative.a \
+ lldHexagonELFTarget.a lldPPCELFTarget.a lldMipsELFTarget.a \
+ lldX86ELFTarget.a lldX86_64ELFTarget.a LLVMOption.a
+
+include $(LLD_LEVEL)/Makefile
--- /dev/null
+##===- unittests/CoreTests/Makefile ----------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLD_LEVEL = ../..
+TESTNAME = CoreTest
+USEDLIBS = gtest.a LLVMOption.a LLVMSupport.a
+
+include $(LLD_LEVEL)/unittests/Makefile
--- /dev/null
+##===---- unittests/DriverTests/Makefile ----------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===---------------------------------------------------------------------===##
+
+LLD_LEVEL = ../..
+TESTNAME = DriverTests
+USEDLIBS = lldDriver.a \
+ lldELF.a lldMachO.a lldPasses.a lldPECOFF.a lldYAML.a \
+ lldReaderWriter.a lldCore.a lldNative.a \
+ lldHexagonELFTarget.a lldPPCELFTarget.a lldMipsELFTarget.a \
+ lldX86ELFTarget.a lldX86_64ELFTarget.a LLVMLinker.a \
+ LLVMOption.a LLVMObject.a LLVMBitReader.a LLVMCore.a LLVMSupport.a
+
+include $(LLD_LEVEL)/unittests/Makefile
--- /dev/null
+##===- unittests/Makefile ----------------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+# If LLD_LEVEL is not set, then we are the top-level Makefile. Otherwise, we
+# are being included from a subdirectory makefile.
+
+ifndef LLD_LEVEL
+
+IS_UNITTEST_LEVEL := 1
+LLD_LEVEL := ..
+
+PARALLEL_DIRS = CoreTests DriverTests
+
+include $(LLD_LEVEL)/../../Makefile.config
+
+endif # LLD_LEVEL
+
+include $(LLD_LEVEL)/Makefile
+
+ifndef IS_UNITTEST_LEVEL
+
+MAKEFILE_UNITTEST_NO_INCLUDE_COMMON := 1
+include $(LLVM_SRC_ROOT)/unittests/Makefile.unittest
+
+endif # IS_UNITTEST_LEVEL
--- /dev/null
+##===- tools/Makefile --------------------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLD_LEVEL := ..
+LEVEL := $(LLD_LEVEL)/../..
+
+include $(LLD_LEVEL)/../../Makefile.config
+
+DIRS := linker-script-test
+
+include $(LLD_LEVEL)/Makefile
--- /dev/null
+##===-------------- linker-script-test/Makefile ----------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===--------------------------------------------------------------------===##
+
+LLD_LEVEL := ../..
+
+TOOLNAME = linker-script-test
+
+# No plugins, optimize startup time.
+TOOL_NO_EXPORTS = 1
+
+#include /Makefile.config
+LEVEL := $(LLD_LEVEL)/../..
+include $(LEVEL)/Makefile.config
+
+LINK_COMPONENTS := $(TARGETS_TO_BUILD)
+USEDLIBS = lldReaderWriter.a LLVMSupport.a
+
+include $(LLD_LEVEL)/Makefile