Init.AddDefaultEnvVarPaths(Lang);
- // Add the clang headers, which are relative to the clang driver.
+ // Add the clang headers, which are relative to the clang binary.
llvm::sys::Path MainExecutablePath =
llvm::sys::Path::GetMainExecutable(Argv0,
(void*)(intptr_t)InitializeIncludePaths);
if (!MainExecutablePath.isEmpty()) {
MainExecutablePath.eraseComponent(); // Remove /clang from foo/bin/clang
MainExecutablePath.eraseComponent(); // Remove /bin from foo/bin
- MainExecutablePath.appendComponent("Headers"); // Get foo/Headers
+
+ // Get foo/lib/clang/1.0/include
+ //
+ // FIXME: Don't embed version here.
+ MainExecutablePath.appendComponent("lib");
+ MainExecutablePath.appendComponent("clang");
+ MainExecutablePath.appendComponent("1.0");
+ MainExecutablePath.appendComponent("include");
// We pass true to ignore sysroot so that we *always* look for clang headers
// relative to our executable, never relative to -isysroot.
LEVEL = ../../../..
include $(LEVEL)/Makefile.common
-HeaderDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/Headers
+# FIXME: Get version from a common place.
+HeaderDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib/clang/1.0/include
HEADERS := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.h))
$(OBJHEADERS): $(HeaderDir)/%.h: $(PROJ_SRC_DIR)/%.h $(HeaderDir)/.dir
$(Verb) cp $< $@
- @echo Copying $(notdir $<) to build dir
-
-printit:
- echo $(OBJHEADERS)
- echo $(PROJ_SRC_DIR)
-
+ $(Echo) Copying $(notdir $<) to build dir
+
# Hook into the standard Makefile rules.
all-local:: $(OBJHEADERS)
-PROJ_headers := $(DESTDIR)$(PROJ_prefix)/Headers
+PROJ_headers := $(DESTDIR)$(PROJ_prefix)/lib/clang/1.0/include
INSTHEADERS := $(addprefix $(PROJ_headers)/, $(HEADERS))
$(INSTHEADERS): $(PROJ_headers)/%.h: $(HeaderDir)/%.h | $(PROJ_headers)
$(Verb) $(DataInstall) $< $(PROJ_headers)
+ $(Echo) Installing compiler include file: $(notdir $<)
install-local:: $(INSTHEADERS)