Fix for PR#330.
[oota-llvm.git] / Makefile
index c070edd1eeae63a83ebd6d5512660eed8c5db2a4..a9a59de8c1ab8120c17b953c6d4e62f0209e6528 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,18 @@
-##===- ./Makefile ------------------------------------------*- Makefile -*-===##
+#===- ./Makefile -------------------------------------------*- Makefile -*--===#
 # 
 #                     The LLVM Compiler Infrastructure
 #
 # This file was developed by the LLVM research group and is distributed under
 # the University of Illinois Open Source License. See LICENSE.TXT for details.
 # 
-##===----------------------------------------------------------------------===##
+#===------------------------------------------------------------------------===#
 LEVEL = .
-DIRS = lib/Support utils lib tools runtime
+DIRS = lib/Support utils lib tools 
+
+ifneq ($(MAKECMDGOALS),tools-only)
+DIRS += runtime
 OPTIONAL_DIRS = projects
+endif
 
 include $(LEVEL)/Makefile.common
 
@@ -22,25 +26,27 @@ distclean:: clean
                          $(LEVEL)/config.log \
                          $(LEVEL)/TAGS
 
-tools-only:
-       @for dir in lib/Support utils lib tools; do $(MAKE) -C $$dir; done
+tools-only: all
 
-AUTOCONF = autoconf
-AUTOHEADER = autoheader
+# Install support for llvm include files:
+.PHONY: install-includes
 
-configure: autoconf/configure.ac autoconf/aclocal.m4
-       cd autoconf && $(AUTOCONF) -o ../configure configure.ac
+install-includes:
+       $(MKDIR) $(DESTDIR)$(includedir)/llvm
+       cd include && find * '!' '(' -name '*~' -o -name .cvsignore ')' -print | grep -v CVS | pax -rwdvpe $(DESTDIR)$(includedir)/llvm
+ifneq ($(BUILD_SRC_ROOT),$(BUILD_OBJ_ROOT))
+       cd $(BUILD_SRC_ROOT)/include && find * '!' '(' -name '*~' -o -name .cvsignore ')' -print | grep -v CVS | pax -rwdvpe $(DESTDIR)$(includedir)/llvm
+endif
 
-include/Config/config.h.in: autoconf/configure.ac autoconf/aclocal.m4
-       $(AUTOHEADER) -I autoconf autoconf/configure.ac
+install:: install-includes
 
-# Install support for llvm include files.
+# Build tags database for Emacs/Xemacs:
+.PHONY: tags
 
-.PHONY: install-includes
+TAGS: tags
 
-install-includes:
-       $(MKDIR) $(includedir)/llvm
-       cd include && find * '!' '(' -name '*~' -o -name .cvsignore ')' -print | grep -v CVS | pax -rwdvpe $(includedir)/llvm
+all:: tags
 
-install:: install-includes
+tags:
+       $(ETAGS) $(ETAGSFLAGS) `find $(wildcard $(SourceDir)/include $(SourceDir)/lib $(SourceDir)/tools) -name '*.cpp' -o -name '*.h'`