Skip to content
Snippets Groups Projects
Commit afed099b authored by Daniel Dunbar's avatar Daniel Dunbar
Browse files

Makefile: Switch Clang Makefiles to always include the top-level Clang Makefile.

 - This eliminates most dependencies on how Clang is installed relative to LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105637 91177308-0d34-0410-b5e6-96231b3b80d8
parent 7a402621
No related branches found
No related tags found
No related merge requests found
Showing
with 72 additions and 42 deletions
LEVEL = ../.. ##===- Makefile --------------------------------------------*- Makefile -*-===##
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
##===----------------------------------------------------------------------===##
# If CLANG_LEVEL is not set, then we are the top-level Makefile. Otherwise, we
# are being included from a subdirectory makefile.
ifndef CLANG_LEVEL
IS_TOP_LEVEL := 1
CLANG_LEVEL := .
DIRS := include lib tools docs DIRS := include lib tools docs
PARALLEL_DIRS := PARALLEL_DIRS :=
...@@ -6,9 +21,22 @@ PARALLEL_DIRS := ...@@ -6,9 +21,22 @@ PARALLEL_DIRS :=
ifeq ($(BUILD_EXAMPLES),1) ifeq ($(BUILD_EXAMPLES),1)
PARALLEL_DIRS += examples PARALLEL_DIRS += examples
endif endif
endif
###
# Common Makefile code, shared by all Clang Makefiles.
# Set LLVM source root level.
LEVEL := $(CLANG_LEVEL)/../..
# Include LLVM common makefile.
include $(LEVEL)/Makefile.common include $(LEVEL)/Makefile.common
###
# Clang Top Level specific stuff.
ifeq ($(IS_TOP_LEVEL),1)
ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
$(RecursiveTargets):: $(RecursiveTargets)::
$(Verb) if [ ! -f test/Makefile ]; then \ $(Verb) if [ ! -f test/Makefile ]; then \
...@@ -37,3 +65,5 @@ cscope.files: ...@@ -37,3 +65,5 @@ cscope.files:
-or -name '*.h' > cscope.files -or -name '*.h' > cscope.files
.PHONY: test report clean cscope.files .PHONY: test report clean cscope.files
endif
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
##===----------------------------------------------------------------------===## ##===----------------------------------------------------------------------===##
LEVEL := ../../.. CLANG_LEVEL := ..
DIRS := tools DIRS := tools
ifdef BUILD_FOR_WEBSITE ifdef BUILD_FOR_WEBSITE
...@@ -22,7 +22,7 @@ $(PROJ_OBJ_DIR)/doxygen.cfg: doxygen.cfg.in ...@@ -22,7 +22,7 @@ $(PROJ_OBJ_DIR)/doxygen.cfg: doxygen.cfg.in
-e 's/@abs_top_builddir@/../g' > $@ -e 's/@abs_top_builddir@/../g' > $@
endif endif
include $(LEVEL)/Makefile.common include $(CLANG_LEVEL)/Makefile
HTML := $(wildcard $(PROJ_SRC_DIR)/*.html) \ HTML := $(wildcard $(PROJ_SRC_DIR)/*.html) \
$(wildcard $(PROJ_SRC_DIR)/*.css) $(wildcard $(PROJ_SRC_DIR)/*.css)
......
...@@ -37,8 +37,8 @@ clean: ...@@ -37,8 +37,8 @@ clean:
else else
# Otherwise, if not in BUILD_FOR_WEBSITE mode, use the project info. # Otherwise, if not in BUILD_FOR_WEBSITE mode, use the project info.
LEVEL := ../../../.. CLANG_LEVEL := ../..
include $(LEVEL)/Makefile.common include $(CLANG_LEVEL)/Makefile
CLANG_VERSION := $(shell cat $(PROJ_SRC_DIR)/../../VER) CLANG_VERSION := $(shell cat $(PROJ_SRC_DIR)/../../VER)
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
# #
##===----------------------------------------------------------------------===## ##===----------------------------------------------------------------------===##
LEVEL = ../../.. CLANG_LEVEL := ..
PARALLEL_DIRS := clang-interpreter PrintFunctionNames wpa PARALLEL_DIRS := clang-interpreter PrintFunctionNames wpa
include $(LEVEL)/Makefile.common include $(CLANG_LEVEL)/Makefile
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
##===----------------------------------------------------------------------===## ##===----------------------------------------------------------------------===##
LEVEL = ../../../.. CLANG_LEVEL := ../..
LIBRARYNAME = PrintFunctionNames LIBRARYNAME = PrintFunctionNames
CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
...@@ -15,7 +15,7 @@ CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include ...@@ -15,7 +15,7 @@ CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
# Include this here so we can get the configuration of the targets that have # Include this here so we can get the configuration of the targets that have
# been configured for construction. We have to do this early so we can set up # been configured for construction. We have to do this early so we can set up
# LINK_COMPONENTS before including Makefile.rules # LINK_COMPONENTS before including Makefile.rules
include $(LEVEL)/Makefile.config include $(CLANG_LEVEL)/../../Makefile.config
LINK_LIBS_IN_SHARED = 1 LINK_LIBS_IN_SHARED = 1
SHARED_LIBRARY = 1 SHARED_LIBRARY = 1
...@@ -24,4 +24,4 @@ LINK_COMPONENTS := bitreader mc core ...@@ -24,4 +24,4 @@ LINK_COMPONENTS := bitreader mc core
USEDLIBS = clangIndex.a clangFrontend.a clangDriver.a clangSema.a \ USEDLIBS = clangIndex.a clangFrontend.a clangDriver.a clangSema.a \
clangAnalysis.a clangAST.a clangParse.a clangLex.a clangBasic.a clangAnalysis.a clangAST.a clangParse.a clangLex.a clangBasic.a
include $(LEVEL)/Makefile.common include $(CLANG_LEVEL)/Makefile
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
##===----------------------------------------------------------------------===## ##===----------------------------------------------------------------------===##
LEVEL = ../../../.. CLANG_LEVEL := ../..
TOOLNAME = clang-interpreter TOOLNAME = clang-interpreter
CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
...@@ -19,7 +19,7 @@ TOOL_NO_EXPORTS = 1 ...@@ -19,7 +19,7 @@ TOOL_NO_EXPORTS = 1
# Include this here so we can get the configuration of the targets that have # Include this here so we can get the configuration of the targets that have
# been configured for construction. We have to do this early so we can set up # been configured for construction. We have to do this early so we can set up
# LINK_COMPONENTS before including Makefile.rules # LINK_COMPONENTS before including Makefile.rules
include $(LEVEL)/Makefile.config include $(CLANG_LEVEL)/../../Makefile.config
LINK_COMPONENTS := jit interpreter nativecodegen bitreader bitwriter ipo \ LINK_COMPONENTS := jit interpreter nativecodegen bitreader bitwriter ipo \
selectiondag asmparser selectiondag asmparser
...@@ -27,4 +27,4 @@ USEDLIBS = clangFrontend.a clangDriver.a clangCodeGen.a clangSema.a \ ...@@ -27,4 +27,4 @@ USEDLIBS = clangFrontend.a clangDriver.a clangCodeGen.a clangSema.a \
clangChecker.a clangAnalysis.a clangRewrite.a clangAST.a \ clangChecker.a clangAnalysis.a clangRewrite.a clangAST.a \
clangParse.a clangLex.a clangBasic.a clangParse.a clangLex.a clangBasic.a
include $(LLVM_SRC_ROOT)/Makefile.rules include $(CLANG_LEVEL)/Makefile
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
##===----------------------------------------------------------------------===## ##===----------------------------------------------------------------------===##
LEVEL = ../../../.. CLANG_LEVEL := ../..
TOOLNAME = clang-wpa TOOLNAME = clang-wpa
CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
...@@ -19,10 +19,10 @@ TOOL_NO_EXPORTS = 1 ...@@ -19,10 +19,10 @@ TOOL_NO_EXPORTS = 1
# Include this here so we can get the configuration of the targets that have # Include this here so we can get the configuration of the targets that have
# been configured for construction. We have to do this early so we can set up # been configured for construction. We have to do this early so we can set up
# LINK_COMPONENTS before including Makefile.rules # LINK_COMPONENTS before including Makefile.rules
include $(LEVEL)/Makefile.config include $(CLANG_LEVEL)/../../Makefile.config
LINK_COMPONENTS := asmparser bitreader mc core LINK_COMPONENTS := asmparser bitreader mc core
USEDLIBS = clangIndex.a clangFrontend.a clangDriver.a clangSema.a \ USEDLIBS = clangIndex.a clangFrontend.a clangDriver.a clangSema.a \
clangAnalysis.a clangAST.a clangParse.a clangLex.a clangBasic.a clangAnalysis.a clangAST.a clangParse.a clangLex.a clangBasic.a
include $(LLVM_SRC_ROOT)/Makefile.rules include $(CLANG_LEVEL)/Makefile
LEVEL = ../../.. CLANG_LEVEL := ..
DIRS := clang clang-c DIRS := clang clang-c
include $(LEVEL)/Makefile.common include $(CLANG_LEVEL)/Makefile
LEVEL = ../../../.. CLANG_LEVEL := ../..
DIRS := DIRS :=
include $(LEVEL)/Makefile.common include $(CLANG_LEVEL)/Makefile
install-local:: install-local::
$(Echo) Installing Clang C API include files $(Echo) Installing Clang C API include files
......
LEVEL = ../../../../.. CLANG_LEVEL := ../../..
BUILT_SOURCES = StmtNodes.inc DeclNodes.inc BUILT_SOURCES = StmtNodes.inc DeclNodes.inc
TD_SRC_DIR = $(PROJ_SRC_DIR)/../Basic TD_SRC_DIR = $(PROJ_SRC_DIR)/../Basic
TABLEGEN_INC_FILES_COMMON = 1 TABLEGEN_INC_FILES_COMMON = 1
include $(LEVEL)/Makefile.common include $(CLANG_LEVEL)/Makefile
INPUT_TDS = $(TD_SRC_DIR)/StmtNodes.td $(TD_SRC_DIR)/DeclNodes.td INPUT_TDS = $(TD_SRC_DIR)/StmtNodes.td $(TD_SRC_DIR)/DeclNodes.td
......
LEVEL = ../../../../.. CLANG_LEVEL := ../../..
BUILT_SOURCES = DiagnosticAnalysisKinds.inc DiagnosticASTKinds.inc \ BUILT_SOURCES = DiagnosticAnalysisKinds.inc DiagnosticASTKinds.inc \
DiagnosticCommonKinds.inc DiagnosticDriverKinds.inc \ DiagnosticCommonKinds.inc DiagnosticDriverKinds.inc \
DiagnosticFrontendKinds.inc DiagnosticLexKinds.inc \ DiagnosticFrontendKinds.inc DiagnosticLexKinds.inc \
...@@ -7,7 +7,7 @@ BUILT_SOURCES = DiagnosticAnalysisKinds.inc DiagnosticASTKinds.inc \ ...@@ -7,7 +7,7 @@ BUILT_SOURCES = DiagnosticAnalysisKinds.inc DiagnosticASTKinds.inc \
TABLEGEN_INC_FILES_COMMON = 1 TABLEGEN_INC_FILES_COMMON = 1
include $(LEVEL)/Makefile.common include $(CLANG_LEVEL)/Makefile
INPUT_TDS = $(wildcard $(PROJ_SRC_DIR)/Diagnostic*.td) INPUT_TDS = $(wildcard $(PROJ_SRC_DIR)/Diagnostic*.td)
......
LEVEL = ../../../../.. CLANG_LEVEL := ../../..
BUILT_SOURCES = Options.inc CC1Options.inc CC1AsOptions.inc BUILT_SOURCES = Options.inc CC1Options.inc CC1AsOptions.inc
TABLEGEN_INC_FILES_COMMON = 1 TABLEGEN_INC_FILES_COMMON = 1
include $(LEVEL)/Makefile.common include $(CLANG_LEVEL)/Makefile
$(ObjDir)/Options.inc.tmp : Options.td OptParser.td $(TBLGEN) $(ObjDir)/.dir $(ObjDir)/Options.inc.tmp : Options.td OptParser.td $(TBLGEN) $(ObjDir)/.dir
$(Echo) "Building Clang Driver Option tables with tblgen" $(Echo) "Building Clang Driver Option tables with tblgen"
......
LEVEL = ../../../.. CLANG_LEVEL := ../..
DIRS := AST Basic Driver DIRS := AST Basic Driver
include $(LEVEL)/Makefile.common include $(CLANG_LEVEL)/Makefile
install-local:: install-local::
$(Echo) Installing Clang include files $(Echo) Installing Clang include files
......
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
# #
##===----------------------------------------------------------------------===## ##===----------------------------------------------------------------------===##
LEVEL = ../../../.. CLANG_LEVEL := ../..
LIBRARYNAME := clangAST LIBRARYNAME := clangAST
BUILD_ARCHIVE = 1 BUILD_ARCHIVE = 1
CPP.Flags += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include CPP.Flags += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
include $(LEVEL)/Makefile.common include $(CLANG_LEVEL)/Makefile
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
# #
##===----------------------------------------------------------------------===## ##===----------------------------------------------------------------------===##
LEVEL = ../../../.. CLANG_LEVEL := ../..
LIBRARYNAME := clangAnalysis LIBRARYNAME := clangAnalysis
BUILD_ARCHIVE = 1 BUILD_ARCHIVE = 1
CPP.Flags += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include CPP.Flags += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
include $(LEVEL)/Makefile.common include $(CLANG_LEVEL)/Makefile
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
##===----------------------------------------------------------------------===## ##===----------------------------------------------------------------------===##
LEVEL = ../../../.. CLANG_LEVEL := ../..
LIBRARYNAME := clangBasic LIBRARYNAME := clangBasic
BUILD_ARCHIVE = 1 BUILD_ARCHIVE = 1
...@@ -20,7 +20,7 @@ ifdef CLANG_VENDOR ...@@ -20,7 +20,7 @@ ifdef CLANG_VENDOR
CPPFLAGS += -DCLANG_VENDOR='"$(CLANG_VENDOR) "' CPPFLAGS += -DCLANG_VENDOR='"$(CLANG_VENDOR) "'
endif endif
include $(LEVEL)/Makefile.common include $(CLANG_LEVEL)/Makefile
SVN_REVISION := $(shell $(LLVM_SRC_ROOT)/utils/GetSourceVersion $(PROJ_SRC_DIR)/../..) SVN_REVISION := $(shell $(LLVM_SRC_ROOT)/utils/GetSourceVersion $(PROJ_SRC_DIR)/../..)
......
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
# #
##===----------------------------------------------------------------------===## ##===----------------------------------------------------------------------===##
LEVEL = ../../../.. CLANG_LEVEL := ../..
LIBRARYNAME := clangChecker LIBRARYNAME := clangChecker
BUILD_ARCHIVE = 1 BUILD_ARCHIVE = 1
CPP.Flags += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include CPP.Flags += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
include $(LEVEL)/Makefile.common include $(CLANG_LEVEL)/Makefile
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# #
##===----------------------------------------------------------------------===## ##===----------------------------------------------------------------------===##
LEVEL = ../../../.. CLANG_LEVEL := ../..
LIBRARYNAME := clangCodeGen LIBRARYNAME := clangCodeGen
BUILD_ARCHIVE = 1 BUILD_ARCHIVE = 1
...@@ -21,5 +21,5 @@ ifdef CLANG_VENDOR ...@@ -21,5 +21,5 @@ ifdef CLANG_VENDOR
CPP.Flags += -DCLANG_VENDOR='"$(CLANG_VENDOR) "' CPP.Flags += -DCLANG_VENDOR='"$(CLANG_VENDOR) "'
endif endif
include $(LEVEL)/Makefile.common include $(CLANG_LEVEL)/Makefile
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
# #
##===----------------------------------------------------------------------===## ##===----------------------------------------------------------------------===##
LEVEL = ../../../.. CLANG_LEVEL := ../..
LIBRARYNAME := clangDriver LIBRARYNAME := clangDriver
BUILD_ARCHIVE = 1 BUILD_ARCHIVE = 1
CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
include $(LEVEL)/Makefile.common include $(CLANG_LEVEL)/Makefile
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
# #
##===----------------------------------------------------------------------===## ##===----------------------------------------------------------------------===##
LEVEL = ../../../.. CLANG_LEVEL := ../..
LIBRARYNAME := clangFrontend LIBRARYNAME := clangFrontend
BUILD_ARCHIVE = 1 BUILD_ARCHIVE = 1
CPP.Flags += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include CPP.Flags += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
include $(LEVEL)/Makefile.common include $(CLANG_LEVEL)/Makefile
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment