- 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 := lib/System lib/Support utils lib/VMCore lib tools/llvm-config \
+ tools runtime docs unittests
+ OPTIONAL_DIRS := projects bindings
+endif
+
+ifeq ($(BUILD_EXAMPLES),1)
+ OPTIONAL_DIRS += examples
+endif
+
+EXTRA_DIST := test unittests llvm.spec include win32 Xcode
+
+include $(LEVEL)/Makefile.config
+
+# llvm-gcc4 doesn't need runtime libs. llvm-gcc4 is the only supported one.
+# FIXME: Remove runtime entirely once we have an understanding of where
+# libprofile etc should go.
+#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),install-libs)
+ DIRS := $(filter-out tools runtime docs, $(DIRS))
+ OPTIONAL_DIRS := $(filter bindings, $(OPTIONAL_DIRS))
+endif
+
+ifeq ($(MAKECMDGOALS),tools-only)
+ DIRS := $(filter-out runtime docs, $(DIRS))
+ OPTIONAL_DIRS :=
+endif
+
+ifeq ($(MAKECMDGOALS),install-clang)
+ DIRS := tools/clang/tools/driver tools/clang/lib/Headers \
+ tools/clang/lib/Runtime tools/clang/docs
+ OPTIONAL_DIRS :=
+ NO_INSTALL = 1
+endif
+
+ifeq ($(MAKECMDGOALS),clang-only)
+ DIRS := $(filter-out tools runtime docs unittests, $(DIRS)) tools/clang
+ OPTIONAL_DIRS :=