[llvm-commits] [test-suite] r124922 - in /test-suite/trunk: Makefile.config.in Makefile.rules

Daniel Dunbar daniel at zuster.org
Fri Feb 4 17:13:55 PST 2011


Author: ddunbar
Date: Fri Feb  4 19:13:55 2011
New Revision: 124922

URL: http://llvm.org/viewvc/llvm-project?rev=124922&view=rev
Log:
test-suite: Start sketching support for using LLVM's test-suite w/o an LLVM
source or object tree.

Modified:
    test-suite/trunk/Makefile.config.in
    test-suite/trunk/Makefile.rules

Modified: test-suite/trunk/Makefile.config.in
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.config.in?rev=124922&r1=124921&r2=124922&view=diff
==============================================================================
--- test-suite/trunk/Makefile.config.in (original)
+++ test-suite/trunk/Makefile.config.in Fri Feb  4 19:13:55 2011
@@ -11,6 +11,18 @@
 #
 LLVM_OBJ_ROOT = @LLVM_OBJ@
 
+# Set this variable based on whether or not we have access to LLVM source and
+# object trees.
+ifeq ($(LLVM_SRC_ROOT),no)
+HAS_LLVM := 0
+else
+ifeq ($(LLVM_OBJ_ROOT),no)
+HAS_LLVM := 0
+else
+HAS_LLVM := 1
+endif
+endif
+
 # Set the directory root of this project's source files
 PROJ_SRC_ROOT := $(subst //,/, at abs_top_srcdir@)
 
@@ -20,8 +32,31 @@
 # Set the root directory of this project's install prefix
 PROJ_INSTALL_ROOT := @prefix@
 
-# Include LLVM's configuration Makefile.
+# Include LLVM's configuration Makefile, if available.
+ifeq ($(HAS_LLVM),1)
 include $(LLVM_OBJ_ROOT)/Makefile.config
+else
+
+# Otherwise, define specific things we know we need.
+realpath = $(shell cd $(1); $(PWD))
+PROJ_OBJ_DIR  := $(call realpath, .)
+PROJ_OBJ_ROOT := $(call realpath, $(PROJ_OBJ_DIR)/$(LEVEL))
+PROJ_SRC_DIR := $(call realpath, $(PROJ_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)))
+
+CP := cp
+DATE := date
+DOT := dot
+ECHO := echo
+INSTALL := install
+LIBS :=
+MKDIR := mkdir
+MV := mv
+PWD := pwd
+RM := rm
+SED := sed
+TCLSH := tclsh
+
+endif
 
 # Ignore the LIBS set by $(LLVM_OBJ_ROOT)/Makefile.config
 LIBS :=

Modified: test-suite/trunk/Makefile.rules
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.rules?rev=124922&r1=124921&r2=124922&view=diff
==============================================================================
--- test-suite/trunk/Makefile.rules (original)
+++ test-suite/trunk/Makefile.rules Fri Feb  4 19:13:55 2011
@@ -66,7 +66,9 @@
 ###########################################################################
 
 # Ensure people re-run configure when it gets updated
+ifeq ($(HAS_LLVM),1)
 all::$(LLVM_OBJ_ROOT)/config.status
+endif
 
 ifdef SHARED_LIBRARY
 # if SHARED_LIBRARY is specified, the default is to build the dynamic lib
@@ -342,9 +344,11 @@
 # LEVEL/include          : config.h files for the project
 # LLVM_SRC_ROOT/include  : Files global to LLVM.
 #
-CPPFLAGS += -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) -I$(LLVM_OBJ_ROOT)/include \
-            -I$(PROJ_SRC_ROOT)/include -I$(LEVEL)/include \
-            -I$(LLVM_SRC_ROOT)/include
+CPPFLAGS += -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \
+            -I$(PROJ_SRC_ROOT)/include -I$(LEVEL)/include
+ifeq ($(HAS_LLVM),1)
+CPPFLAGS += -I$(LLVM_OBJ_ROOT)/include -I$(LLVM_SRC_ROOT)/include
+endif
 
 # By default, strip symbol information from executable
 ifndef KEEP_SYMBOLS
@@ -977,12 +981,14 @@
 #
 # Autoconf Dependencies.
 #
+ifeq ($(HAS_LLVM),1)
 $(LLVM_OBJ_ROOT)/config.status:: $(LLVM_SRC_ROOT)/configure
 	@${ECHO} "****************************************************************"
 	@${ECHO} "   You need to re-run $(LLVM_SRC_ROOT)/configure"
 	@${ECHO} "   in directory $(LLVM_OBJ_ROOT)"
 	@${ECHO} "****************************************************************"
 	$(VERB) exit 1
+endif
 
 # If the Makefile in the source tree has been updated, copy it over into the
 # build tree.





More information about the llvm-commits mailing list