llvm.org GIT mirror llvm / b2cb486
Several changes: * Get rid of variables that are duplicates of autoconf variables. * Rename BUILD_* to PROJ_* * Define some project related install locations * Don't assume LLVM's configured values are the project's git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19589 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 14 years ago
1 changed file(s) with 77 addition(s) and 87 deletion(s). Raw diff Collapse all Expand all
1111 #
1212 #===------------------------------------------------------------------------===#
1313
14 # Define LLVM speific info and directories
15 PACKAGE_NAME := @PACKAGE_NAME@
16 PACKAGE_VERSION := @PACKAGE_VERSION@
17 LLVM_PREFIX := @LLVM_PREFIX@
18 LLVM_BINDIR := @LLVM_BINDIR@
19 LLVM_LIBDIR := @LLVM_LIBDIR@
20 LLVM_DATADIR := @LLVM_DATADIR@
21 LLVM_DOCSDIR := @LLVM_DOCSDIR@
22 LLVM_ETCDIR := @LLVM_ETCDIR@
23 LLVM_INCLUDEDIR := @LLVM_INCLUDEDIR@
24 LLVM_INFODIR := @LLVM_INFODIR@
25 LLVM_MANDIR := @LLVM_MANDIR@
14 # Define LLVM specific info and directories based on the autoconf variables
15 LLVMPackageName := @PACKAGE_NAME@
16 LLVMVersion := @PACKAGE_VERSION@
2617 LLVM_CONFIGTIME := @LLVM_CONFIGTIME@
27 LLVM_TARBALL_NAME := @PACKAGE_NAME@-@PACKAGE_VERSION@
18
19 ###########################################################################
20 # Directory Configuration
21 # This section of the Makefile determines what is where. To be
22 # specific, there are several locations that need to be defined:
23 #
24 # o LLVM_SRC_ROOT : The root directory of the LLVM source code.
25 # o LLVM_OBJ_ROOT : The root directory containing the built LLVM code.
26 #
27 # o PROJ_SRC_DIR : The directory containing the code to build.
28 # o PROJ_SRC_ROOT : The root directory of the code to build.
29 #
30 # o PROJ_OBJ_DIR : The directory in which compiled code will be placed.
31 # o PROJ_OBJ_ROOT : The root directory in which compiled code is placed.
32 #
33 ###########################################################################
34
35 # Set the project name to LLVM if its not defined
36 ifndef PROJECT_NAME
37 PROJECT_NAME := LLVM
38 endif
39
40 PROJ_OBJ_DIR := $(shell pwd)
41 PROJ_OBJ_ROOT := $(subst //,/,$(shell cd $(PROJ_OBJ_DIR)/$(LEVEL); pwd))
42
43 ifeq ($(PROJECT_NAME),LLVM)
44 LLVM_SRC_ROOT := @abs_top_srcdir@
45 LLVM_OBJ_ROOT := @abs_top_builddir@
46 PROJ_SRC_ROOT := $(LLVM_SRC_ROOT)
47 PROJ_SRC_DIR := $(subst //,/,$(LLVM_SRC_ROOT)/$(patsubst $(LLVM_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)))
48 PROJ_prefix := @prefix@
49 PROJ_bindir := @prefix@/bin
50 PROJ_libdir := @prefix@/lib
51 PROJ_datadir := @prefix@/share
52 PROJ_docsdir := @prefix@/docs/llvm
53 PROJ_etcdir := @prefix@/etc/llvm
54 PROJ_includedir := @prefix@/include
55 PROJ_infodir := @prefix@/info
56 PROJ_mandir := @prefix@/man
57 PROJ_VERSION := $(LLVMVersion)
58 else
59 ifndef PROJ_SRC_ROOT
60 $(error Projects must define PROJ_SRC_ROOT)
61 endif
62 ifndef PROJ_OBJ_ROOT
63 $(error Projects must define PROJ_OBJ_ROOT)
64 endif
65 ifndef PROJ_INSTALL_ROOT
66 $(error Projects must define PROJ_INSTALL_ROOT)
67 endif
68 ifndef LLVM_SRC_ROOT
69 $(error Projects must define LLVM_SRC_ROOT)
70 endif
71 ifndef LLVM_OBJ_ROOT
72 $(error Projects must define LLVM_OBJ_ROOT)
73 endif
74 PROJ_SRC_DIR := $(subst //,/,$(PROJ_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)))
75 PROJ_prefix := $(PROJ_INSTALL_ROOT)
76 PROJ_bindir := $(PROJ_INSTALL_ROOT)/bin
77 PROJ_libdir := $(PROJ_INSTALL_ROOT)/lib
78 PROJ_datadir := $(PROJ_INSTALL_ROOT)/share
79 PROJ_docsdir := $(PROJ_INSTALL_ROOT)/docs/llvm
80 PROJ_etcdir := $(PROJ_INSTALL_ROOT)/etc/llvm
81 PROJ_includedir := $(PROJ_INSTALL_ROOT)/include
82 PROJ_infodir := $(PROJ_INSTALL_ROOT)/info
83 PROJ_mandir := $(PROJ_INSTALL_ROOT)/man
84 ifndef PROJ_VERSION
85 PROJ_VERSION := 1.0
86 endif
87 endif
2888
2989 # Determine if we're on a unix type operating system
3090 LLVM_ON_UNIX:=@LLVM_ON_UNIX@
67127 FLEX := @LEX@
68128 GREP := @GREP@
69129 INSTALL := @INSTALL@
70 INSTALL_SH := $(BUILD_SRC_ROOT)/autoconf/install-sh
130 INSTALL_SH := $(LLVM_SRC_ROOT)/autoconf/install-sh
71131 INSTALL_PROGRAM = @INSTALL_PROGRAM@
72132 INSTALL_SCRIPT = @INSTALL_SCRIPT@
73133 INSTALL_DATA = @INSTALL_DATA@
74 MKDIR := @abs_top_srcdir@/autoconf/mkinstalldirs
134 MKDIR := $(LLVM_SRC_ROOT)/autoconf/mkinstalldirs
75135 MV := @MV@
76136 PAX := @PAX@
77137 RANLIB := @RANLIB@
94154 TCLSH := @TCLSH@
95155 ZIP := @ZIP@
96156
97 # Paths to miscellaneous programs we assume are present
98 RPWD := pwd
99 ECHO := echo
100
101157 # Path to location for LLVM C/C++ front-end. You can modify this if you
102158 # want to override the value set by configure.
103159 LLVMGCCDIR := @LLVMGCCDIR@
144200 # Executable file extension for this platform.
145201 EXEEXT = @EXEEXT@
146202
147 ###########################################################################
148 # Directory Configuration
149 # This section of the Makefile determines what is where. To be
150 # specific, there are several locations that need to be defined:
151 #
152 # o LLVM_SRC_ROOT : The root directory of the LLVM source code.
153 # o LLVM_OBJ_ROOT : The root directory containing the built LLVM code.
154 #
155 # o BUILD_SRC_DIR : The directory containing the code to build.
156 # o BUILD_SRC_ROOT : The root directory of the code to build.
157 #
158 # o BUILD_OBJ_DIR : The directory in which compiled code will be placed.
159 # o BUILD_OBJ_ROOT : The root directory in which compiled code is placed.
160 #
161 ###########################################################################
162
163 # Set the object build directory. By default, it is the current directory.
164 ifndef BUILD_OBJ_DIR
165 BUILD_OBJ_DIR := $(subst //,/,$(shell $(RPWD)))
166 endif
167
168 # Set the root of the object directory.
169 ifndef BUILD_OBJ_ROOT
170 BUILD_OBJ_ROOT := $(subst //,/,$(shell cd $(BUILD_OBJ_DIR)/$(LEVEL); $(RPWD)))
171 endif
172
173 # Set the source build directory. That is almost always the current directory.
174 ifndef BUILD_SRC_DIR
175 BUILD_SRC_DIR := $(subst //,/,@abs_top_srcdir@/$(patsubst $(BUILD_OBJ_ROOT)%,%,$(BUILD_OBJ_DIR)))
176 endif
177
178 # Set the source root directory.
179 ifndef BUILD_SRC_ROOT
180 BUILD_SRC_ROOT := $(subst //,/,@abs_top_srcdir@)
181 endif
182
183 # Set the LLVM object directory.
184 ifndef LLVM_OBJ_ROOT
185 ifdef LLVM_SRC_ROOT
186 LLVM_OBJ_ROOT := $(shell cd $(LLVM_SRC_ROOT); $(RPWD))
187 else
188 LLVM_OBJ_ROOT := $(BUILD_OBJ_ROOT)
189 endif
190 endif
191
192 # Set the LLVM source directory.
193 # It is typically the root directory of what we're compiling now.
194 ifndef LLVM_SRC_ROOT
195 LLVM_SRC_ROOT := $(BUILD_SRC_ROOT)
196 endif
197
198 # Installation directories, as provided by the configure script.
199 abs_top_srcdir = @abs_top_srcdir@
200 abs_top_builddir = @abs_top_builddir@
201 exec_prefix = @exec_prefix@
202 prefix = @prefix@
203 program_transform_name = @program_transform_name@
204 bindir = @bindir@
205 sbindir = @sbindir@
206 libexecdir = @libexecdir@
207 datadir = @datadir@
208 sysconfdir = @sysconfdir@
209 sharedstatedir = @sharedstatedir@
210 localstatedir = @localstatedir@
211 libdir = @libdir@
212 includedir = @includedir@
213 infodir = @infodir@
214 mandir = @mandir@
203 # Things we just assume are "there"
204 ECHO := echo