Trying again to tweak the top-level Makefile to facilitate an Apple-style build.
authorStuart Hastings <stuart@apple.com>
Thu, 22 Oct 2009 17:22:37 +0000 (17:22 +0000)
committerStuart Hastings <stuart@apple.com>
Thu, 22 Oct 2009 17:22:37 +0000 (17:22 +0000)
Now with Clang-compatibility.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84872 91177308-0d34-0410-b5e6-96231b3b80d8

Makefile
utils/buildit/GNUmakefile
utils/buildit/build_llvm

index f3bf3f2345eb8aba6ba202f36e0573579bc2fce9..d2000b48387af043d50255169d2c1a222a1bf6e1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,12 @@ LEVEL := .
 #
 # When cross-compiling, there are some things (tablegen) that need to
 # be build for the build system first.
+
+# If "RC_ProjectName" exists in the environment, and its value is
+# "llvmCore", then this is an "Apple-style" build; search for
+# "Apple-style" in the comments for more info.  Anything else is a
+# normal build.
+ifneq ($(RC_ProjectName),llvmCore)  # Normal build (not "Apple-style").
 ifeq ($(BUILD_DIRS_ONLY),1)
   DIRS := lib/System lib/Support utils
   OPTIONAL_DIRS :=
@@ -211,3 +217,9 @@ happiness: update all check unittests
 
 .NOTPARALLEL:
 
+else # Building "Apple-style."
+# In an Apple-style build, once configuration is done, lines marked
+# "Apple-style" are removed with sed!  Please don't remove these!
+# Look for the string "Apple-style" in utils/buildit/build_llvm.
+include $(shell find . -name GNUmakefile) # Building "Apple-style."
+endif # Building "Apple-style."
index e3b334a045d1a0ac3e8ffd4cf8336f69a80b1681..997188333c1b9d6059f7db3fb8e46f16913baef9 100644 (file)
@@ -59,7 +59,7 @@ endif
 # NOTE : Always put version numbers at the end because they are optional.
 install: $(OBJROOT) $(SYMROOT) $(DSTROOT)
        cd $(OBJROOT) && \
-         $(SRC)/build_llvm "$(RC_ARCHS)" "$(TARGETS)" \
+         $(SRC)/utils/buildit/build_llvm "$(RC_ARCHS)" "$(TARGETS)" \
            $(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) \
            $(LLVM_ASSERTIONS) $(LLVM_OPTIMIZED) \
            $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion) 
index 91fbe15be473dadf3632cb39c157f8b6b207285a..2bdb208237dff2a7b60f46bb61ccea7cbb4835a8 100755 (executable)
@@ -82,6 +82,10 @@ SRC_DIR=$DIR/src
 rm -rf $SRC_DIR || exit 1
 mkdir $SRC_DIR || exit 1
 ln -s $ORIG_SRC_DIR/* $SRC_DIR/ || exit 1
+# We can't use the top-level Makefile as-is.  Remove the soft link:
+rm $SRC_DIR/Makefile || exit 1
+# Now create our own by editing the top-level Makefile, deleting every line marked "Apple-style":
+sed -e '/[Aa]pple-style/d' -e '/include.*GNUmakefile/d' $ORIG_SRC_DIR/Makefile > $SRC_DIR/Makefile || exit 1
 
 # Build the LLVM tree universal.
 mkdir -p $DIR/obj-llvm || exit 1