Add lto doc.
[oota-llvm.git] / Makefile
index 1aa33039794ad534742c5c08114342283f742c8b..b48b49b16762ee9f6e6b75fe626fe8dbeef6271b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -6,27 +6,37 @@
 # the University of Illinois Open Source License. See LICENSE.TXT for details.
 # 
 #===------------------------------------------------------------------------===#
-LEVEL = .
-DIRS = lib/System lib/Support utils lib
+
+LEVEL := .
+DIRS := lib/System lib/Support utils lib/VMCore lib tools runtime docs
+OPTIONAL_DIRS := examples projects
+EXTRA_DIST := test llvm.spec include win32 Xcode
 
 include $(LEVEL)/Makefile.config 
 
+# llvm-gcc4 doesn't need runtime libs.
+ifeq ($(LLVMGCC_MAJVERS),4)
+  DIRS := $(filter-out runtime, $(DIRS))
+endif
+
+ifeq ($(MAKECMDGOALS),libs-only)
+  DIRS := $(filter-out tools runtime docs, $(DIRS))
+  OPTIONAL_DIRS :=
+endif
+
 ifeq ($(MAKECMDGOALS),tools-only)
-  DIRS += tools
-else
-  ifneq ($(MAKECMDGOALS),libs-only)
-    DIRS += tools
-    ifneq ($(LLVMGCC_MAJVERS),4)
-      DIRS += runtime
-    else
-      $(warning Skipping runtime libraries, llvm-gcc 4 detected.)
-    endif
-    OPTIONAL_DIRS := examples projects
-    DIRS += docs
-  endif
+  DIRS := $(filter-out runtime docs, $(DIRS))
+  OPTIONAL_DIRS :=
 endif
-EXTRA_DIST := test llvm.spec include win32 Xcode
 
+# Don't install utils, examples, or projects they are only used to 
+# build LLVM.
+ifeq ($(MAKECMDGOALS),install)
+  DIRS := $(filter-out utils, $(DIRS))
+  OPTIONAL_DIRS :=
+endif
+
+# Include the main makefile machinery.
 include $(LLVM_SRC_ROOT)/Makefile.rules
 
 # Specify options to pass to configure script when we're
@@ -87,3 +97,6 @@ ifeq ($(BuildMode),Debug)
        $(Echo) '*****' make an optimized build.
 endif
 
+check-llvm2cpp:
+       $(MAKE) check TESTSUITE=Feature RUNLLVM2CPP=1
+