llvm.org GIT mirror llvm / 7cf8fc7
Make the makefiles go much faster by using the realpath builtin instead of shell. On my 8 core mac pro, this speeds up a 'make -j8' null build of the lib directory from 1.11s to 0.77s wall time. Patch by NAKAMURA Takumi! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110166 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 9 years ago
1 changed file(s) with 11 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
3838 PROJECT_NAME := $(LLVMPackageName)
3939 endif
4040
41 PROJ_OBJ_DIR := $(shell $(PWD))
42 PROJ_OBJ_ROOT := $(shell cd $(PROJ_OBJ_DIR)/$(LEVEL); $(PWD))
41 # The macro below is expanded when 'realpath' is not built-in.
42 # Built-in 'realpath' is available on GNU Make 3.81.
43 realpath = $(shell cd $(1); $(PWD))
44
45 PROJ_OBJ_DIR := $(call realpath, .)
46 PROJ_OBJ_ROOT := $(call realpath, $(PROJ_OBJ_DIR)/$(LEVEL))
4347
4448 ifeq ($(PROJECT_NAME),llvm)
45 LLVM_SRC_ROOT := $(shell cd @abs_top_srcdir@; $(PWD))
46 LLVM_OBJ_ROOT := $(shell cd @abs_top_builddir@; $(PWD))
47 PROJ_SRC_ROOT := $(shell cd $(LLVM_SRC_ROOT); $(PWD))
48 PROJ_SRC_DIR := $(shell cd $(LLVM_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)); $(PWD))
49 LLVM_SRC_ROOT := $(call realpath, @abs_top_srcdir@)
50 LLVM_OBJ_ROOT := $(call realpath, @abs_top_builddir@)
51 PROJ_SRC_ROOT := $(LLVM_SRC_ROOT)
52 PROJ_SRC_DIR := $(call realpath, $(LLVM_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)))
4953 prefix := @prefix@
5054 PROJ_prefix := $(prefix)
5155 PROJ_VERSION := $(LLVMVersion)
6569 ifndef LLVM_OBJ_ROOT
6670 $(error Projects must define LLVM_OBJ_ROOT)
6771 endif
68 PROJ_SRC_DIR := $(shell cd $(PROJ_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)); $(PWD))
72 PROJ_SRC_DIR := $(call realpath, $(PROJ_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)))
6973 prefix := $(PROJ_INSTALL_ROOT)
7074 PROJ_prefix := $(prefix)
7175 ifndef PROJ_VERSION