Misha Brukman | 6d5ab86 | 2004-04-24 00:10:56 +0000 | [diff] [blame] | 1 | #===-- Makefile.rules - Common make rules for LLVM ---------*- Makefile -*--===# |
| 2 | # |
John Criswell | d8846c1 | 2003-10-21 14:33:46 +0000 | [diff] [blame] | 3 | # The LLVM Compiler Infrastructure |
| 4 | # |
| 5 | # This file was developed by the LLVM research group and is distributed under |
| 6 | # the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | # |
Misha Brukman | 6d5ab86 | 2004-04-24 00:10:56 +0000 | [diff] [blame] | 8 | #===------------------------------------------------------------------------===# |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 9 | # |
| 10 | # This file is included by all of the LLVM makefiles. This file defines common |
Misha Brukman | 36bc642 | 2003-08-21 22:02:18 +0000 | [diff] [blame] | 11 | # rules to do things like compile a .cpp file or generate dependency info. |
| 12 | # These are platform dependent, so this is the file used to specify these |
| 13 | # system dependent operations. |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 14 | # |
Vikram S. Adve | c214e71 | 2002-08-29 23:28:46 +0000 | [diff] [blame] | 15 | # The following functionality can be set by setting incoming variables. |
| 16 | # The variable $(LEVEL) *must* be set: |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 17 | # |
| 18 | # 1. LEVEL - The level of the current subdirectory from the top of the |
| 19 | # MagicStats view. This level should be expressed as a path, for |
| 20 | # example, ../.. for two levels deep. |
| 21 | # |
| 22 | # 2. DIRS - A list of subdirectories to be built. Fake targets are set up |
Chris Lattner | a8abc22 | 2002-09-18 03:22:27 +0000 | [diff] [blame] | 23 | # so that each of the targets "all", "install", and "clean" each build |
| 24 | # the subdirectories before the local target. DIRS are guaranteed to be |
| 25 | # built in order. |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 26 | # |
Chris Lattner | a8abc22 | 2002-09-18 03:22:27 +0000 | [diff] [blame] | 27 | # 3. PARALLEL_DIRS - A list of subdirectories to be built, but that may be |
| 28 | # built in any order. All DIRS are built in order before PARALLEL_DIRS are |
| 29 | # built, which are then built in any order. |
| 30 | # |
| 31 | # 4. Source - If specified, this sets the source code filenames. If this |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 32 | # is not set, it defaults to be all of the .cpp, .c, .y, and .l files |
Chris Lattner | e001059 | 2001-10-18 01:48:09 +0000 | [diff] [blame] | 33 | # in the current directory. Also, if you want to build files in addition |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 34 | # to the local files, you can use the BUILT_SOURCES variable |
Chris Lattner | 694c5df | 2003-05-15 21:28:55 +0000 | [diff] [blame] | 35 | # |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 36 | # 6. LLVM_SRC_ROOT - If specified, points to the top of the LLVM source tree. |
Dinakar Dhurjati | 584dd18 | 2003-05-29 21:49:00 +0000 | [diff] [blame] | 37 | # |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 38 | # 8. BUILD_SRC_DIR - The directory which contains the current set of Makefiles |
| 39 | # and usually the source code too (unless SourceDir is set). |
| 40 | # |
| 41 | # 9. BUILD_SRC_ROOT - The root directory of the source code being compiled. |
| 42 | # |
| 43 | # 10. BUILD_OBJ_DIR - The directory where object code should be placed. |
| 44 | # |
| 45 | # 11. BUILD_OBJ_ROOT - The root directory for where object code should be |
| 46 | # placed. |
| 47 | # |
| 48 | # For building, |
Chris Lattner | e430a1e | 2003-08-21 22:23:49 +0000 | [diff] [blame] | 49 | # LLVM, LLVM_SRC_ROOT = BUILD_SRC_ROOT |
Chris Lattner | af06a08 | 2003-08-15 03:02:52 +0000 | [diff] [blame] | 50 | # |
Vikram S. Adve | d60aede | 2002-07-09 12:04:21 +0000 | [diff] [blame] | 51 | #===-----------------------------------------------------------------------==== |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 52 | |
John Criswell | 2a6530f | 2003-06-27 16:58:44 +0000 | [diff] [blame] | 53 | # |
John Criswell | 7f33695 | 2003-09-06 14:44:17 +0000 | [diff] [blame] | 54 | # Set the VPATH so that we can find source files. |
John Criswell | 8bff509 | 2003-06-11 13:55:44 +0000 | [diff] [blame] | 55 | # |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 56 | VPATH=$(BUILD_SRC_DIR) |
John Criswell | 8bff509 | 2003-06-11 13:55:44 +0000 | [diff] [blame] | 57 | |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 58 | ########################################################################### |
| 59 | # Default Targets: |
| 60 | # The following targets are the standard top level targets for |
| 61 | # building. |
| 62 | ########################################################################### |
Chris Lattner | 4bb13b8 | 2002-09-13 22:14:47 +0000 | [diff] [blame] | 63 | |
John Criswell | bd08280 | 2003-10-07 14:16:44 +0000 | [diff] [blame] | 64 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 65 | # Ensure all preconditions are met |
| 66 | all:: preconditions |
Chris Lattner | edf1f23 | 2002-07-23 19:21:31 +0000 | [diff] [blame] | 67 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 68 | # Make sure all the user-target rules are double colon rules |
| 69 | all :: preconditions |
| 70 | clean:: preconditions |
| 71 | install :: preconditions |
| 72 | uninstall :: preconditions |
| 73 | check:: preconditions |
| 74 | dist:: preconditions |
| 75 | distcheck:: preconditions |
| 76 | distclean:: preconditions |
Chris Lattner | 95cc1b3 | 2003-08-14 21:10:25 +0000 | [diff] [blame] | 77 | |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 78 | |
John Criswell | 9621a2b | 2003-08-20 15:18:41 +0000 | [diff] [blame] | 79 | ########################################################################### |
| 80 | # Suffixes and implicit rules: |
| 81 | # Empty out the list of suffixes, generate a list that is only |
| 82 | # used by this Makefile, and cancel useless implicit rules. This |
| 83 | # will hopefully speed up compilation a little bit. |
| 84 | ########################################################################### |
| 85 | .SUFFIXES: |
| 86 | .SUFFIXES: .c .cpp .h .hpp .y .l |
Brian Gaeke | d65ed3f | 2004-01-21 19:59:19 +0000 | [diff] [blame] | 87 | .SUFFIXES: .lo .o .a $(SHLIBEXT) .bc .td |
John Criswell | 9621a2b | 2003-08-20 15:18:41 +0000 | [diff] [blame] | 88 | .SUFFIXES: .ps .dot .d |
| 89 | |
John Criswell | 9691439 | 2003-07-16 20:26:06 +0000 | [diff] [blame] | 90 | # |
| 91 | # Mark all of these targets as phony. This will hopefully speed up builds |
| 92 | # slightly since GNU Make will not try to find implicit rules for targets |
| 93 | # which are marked as Phony. |
| 94 | # |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 95 | ALL_TARGETS= all dynamic bytecodelib install-bytecode-library clean distclean install test bytecode prdirs |
| 96 | .PHONY: $(ALL_TARGETS) preconditions |
John Criswell | 9691439 | 2003-07-16 20:26:06 +0000 | [diff] [blame] | 97 | |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 98 | ########################################################################### |
| 99 | # Miscellaneous paths and commands: |
| 100 | # This section defines various configuration macros, such as where |
| 101 | # to find burg, tblgen, and libtool. |
| 102 | ########################################################################### |
| 103 | |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 104 | #-------------------------------------------------------------------- |
Vikram S. Adve | c214e71 | 2002-08-29 23:28:46 +0000 | [diff] [blame] | 105 | # Variables derived from configuration options... |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 106 | #-------------------------------------------------------------------- |
| 107 | |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 108 | ifdef ENABLE_PROFILING |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 109 | CONFIGURATION := Profile |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 110 | CXXFLAGS += -O3 -DNDEBUG -felide-constructors -finline-functions -pg |
| 111 | CFLAGS += -O3 -DNDEBUG -pg |
| 112 | LDFLAGS += -O3 -DNDEBUG -pg |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 113 | else |
| 114 | ifdef ENABLE_OPTIMIZED |
| 115 | CONFIGURATION := Release |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 116 | CXXFLAGS += -O3 -DNDEBUG -finline-functions -felide-constructors -fomit-frame-pointer |
| 117 | CFLAGS += -O3 -DNDEBUG -fomit-frame-pointer |
| 118 | LDFLAGS += -O3 -DNDEBUG |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 119 | else |
| 120 | CONFIGURATION := Debug |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 121 | CXXFLAGS += -g -D_DEBUG |
| 122 | CFLAGS += -g -D_DEBUG |
| 123 | LDFLAGS += -g -D_DEBUG |
| 124 | KEEP_SYMBOLS := 1 |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 125 | endif |
| 126 | endif |
| 127 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 128 | ARFLAGS := cru |
| 129 | #------------------------------------------------------------------------------ |
| 130 | # Directory locations |
| 131 | OBJDIR := $(BUILD_OBJ_DIR)/$(CONFIGURATION) |
| 132 | LIBDIR := $(BUILD_OBJ_ROOT)/lib/$(CONFIGURATION) |
| 133 | TOOLDIR := $(BUILD_OBJ_ROOT)/tools/$(CONFIGURATION) |
| 134 | LLVMLIBDIR := $(LLVM_OBJ_ROOT)/lib/$(CONFIGURATION) |
| 135 | LLVMTOOLDIR := $(LLVM_OBJ_ROOT)/tools/$(CONFIGURATION) |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 136 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 137 | #------------------------------------------------------------------------------ |
| 138 | # Full Paths To Compiled Tools and Utilities |
| 139 | LIBTOOL := $(LLVM_OBJ_ROOT)/mklib |
| 140 | LLVMAS := $(LLVMTOOLDIR)/llvm-as$(EXEEXT) |
| 141 | BURG := $(LLVMTOOLDIR)/burg$(EXEEXT) |
| 142 | TBLGEN := $(LLVMTOOLDIR)/tblgen$(EXEEXT) |
| 143 | GCCLD := $(LLVMTOOLDIR)/gccld$(EXEEXT) |
| 144 | LLVMGCC := PATH=$(LLVMTOOLDIR):$(PATH) $(LLVMGCCDIR)/bin/gcc |
| 145 | LLVMGXX := PATH=$(LLVMTOOLDIR):$(PATH) $(LLVMGCCDIR)/bin/g++ |
Dinakar Dhurjati | ffb55cd | 2003-05-29 16:18:20 +0000 | [diff] [blame] | 146 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 147 | # Need a better way to compute this. |
| 148 | LLVMGCCLIBDIR := $(dir $(shell $(LLVMGCC) -print-file-name=libgcc.a))/ |
Dinakar Dhurjati | ffb55cd | 2003-05-29 16:18:20 +0000 | [diff] [blame] | 149 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 150 | #------------------------------------------------------------------------------ |
| 151 | # Adjust to user's request |
Dinakar Dhurjati | ffb55cd | 2003-05-29 16:18:20 +0000 | [diff] [blame] | 152 | |
John Criswell | 82f4a5a | 2003-07-31 20:58:51 +0000 | [diff] [blame] | 153 | ifndef SHARED_LIBRARY |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 154 | LIBTOOL += --tag=disable-shared |
| 155 | else |
| 156 | LDFLAGS += -rpath $(LIBDIR) |
John Criswell | 82f4a5a | 2003-07-31 20:58:51 +0000 | [diff] [blame] | 157 | endif |
| 158 | |
| 159 | # |
Misha Brukman | b5f096f | 2002-09-12 16:05:39 +0000 | [diff] [blame] | 160 | # Verbosity levels |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 161 | # |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 162 | ifndef VERBOSE |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 163 | VERB := @ |
| 164 | LIBTOOL += --silent |
| 165 | AR += >/dev/null 2>/dev/null |
Misha Brukman | b5f096f | 2002-09-12 16:05:39 +0000 | [diff] [blame] | 166 | endif |
| 167 | |
Vikram S. Adve | feeae58 | 2002-09-18 11:55:13 +0000 | [diff] [blame] | 168 | # By default, strip symbol information from executable |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 169 | ifndef KEEP_SYMBOLS |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 170 | STRIP = $(PLATFORMSTRIPOPTS) |
| 171 | STRIP_WARN_MSG = "(without symbols)" |
Vikram S. Adve | feeae58 | 2002-09-18 11:55:13 +0000 | [diff] [blame] | 172 | endif |
| 173 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 174 | ifdef TOOLNAME |
| 175 | LDFLAGS += -rpath $(TOOLDIR) -export-dynamic $(TOOLLINKOPTS) |
| 176 | endif |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 177 | |
Dinakar Dhurjati | 87ea8aa | 2003-10-29 14:28:35 +0000 | [diff] [blame] | 178 | # TOOLLINKOPTSB to pass options to the linker like library search path etc |
| 179 | # Note that this is different from TOOLLINKOPTS, these options |
| 180 | # are passed to the linker *before* the USEDLIBS options are passed. |
| 181 | # e.g. usage TOOLLINKOPTSB = -L/home/xxx/lib |
| 182 | ifdef TOOLLINKOPTSB |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 183 | LDFLAGS += $(TOOLLINKOPTSB) |
Dinakar Dhurjati | 87ea8aa | 2003-10-29 14:28:35 +0000 | [diff] [blame] | 184 | endif |
| 185 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 186 | LDFLAGS += -L$(LIBDIR) -L$(LLVMLIBDIR) |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 187 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 188 | #------------------------------------------------------------------------------ |
| 189 | # Options To Invoke Tools |
| 190 | |
| 191 | CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused |
| 192 | |
| 193 | CPPFLAGS += -I$(BUILD_OBJ_DIR) \ |
| 194 | -I$(BUILD_SRC_DIR) \ |
| 195 | -I$(BUILD_SRC_ROOT)/include \ |
| 196 | -I$(BUILD_OBJ_ROOT)/include \ |
| 197 | -I$(LLVM_OBJ_ROOT)/include \ |
| 198 | -I$(LLVM_SRC_ROOT)/include \ |
| 199 | -D_GNU_SOURCE -D__STDC_LIMIT_MACROS |
| 200 | |
| 201 | CXXCompile := $(CXX) $(CPPFLAGS) $(CompileCommonOpts) $(CXXFLAGS) -c |
| 202 | LTCXXCompile := $(LIBTOOL) --tag=CXX --mode=compile $(CXXCompile) |
| 203 | CCompile := $(CC) $(CPPFLAGS) $(CompileCommonOpts) -c $(CFLAGS) |
| 204 | LTCCompile := $(LIBTOOL) --mode=compile $(CCompile) |
| 205 | BCCXXCompile := $(LLVMGXX) $(CPPFLAGS) $(CompileCommonOpts) $(CXXFLAGS) -c |
| 206 | BCCCompile := $(LLVMGCC) $(CPPFLAGS) $(CompileCommonOpts) $(CFLAGS) -c |
| 207 | Link := $(LIBTOOL) --tag=CXX --mode=link $(CXX) $(CPPFLAGS) $(CompileCommonOpts) $(LDFLAGS) $(STRIP) |
| 208 | Relink := $(LIBTOOL) --tag=CXX --mode=link $(CXX) |
| 209 | BCLinkLib := $(LLVMGCC) -shared -nostdlib |
| 210 | Burg := $(BURG) -I $(BUILD_SRC_DIR) |
| 211 | TableGen := $(TBLGEN) -I $(BUILD_SRC_DIR) |
| 212 | Archive := $(AR) $(ARFLAGS) |
| 213 | ifdef RANLIB |
| 214 | Ranlib := $(RANLIB) |
| 215 | else |
| 216 | Ranlib := ranlib |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 217 | endif |
| 218 | |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 219 | #---------------------------------------------------------- |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 220 | # Source includes all of the cpp files, and objects are derived from the |
| 221 | # source files... |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 222 | # The local Makefile can list other Source files via BUILT_SOURCES = ... |
Vikram S. Adve | c4bed34 | 2001-10-17 12:33:55 +0000 | [diff] [blame] | 223 | # |
Vikram S. Adve | ad9ea7e | 2002-10-14 16:40:04 +0000 | [diff] [blame] | 224 | ifndef Source |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 225 | |
| 226 | Source := $(notdir $(wildcard $(BUILD_SRC_DIR)/*.cpp \ |
| 227 | $(BUILD_SRC_DIR)/*.cc $(BUILD_SRC_DIR)/*.c $(BUILD_SRC_DIR)/*.y \ |
| 228 | $(BUILD_SRC_DIR)/*.l)) |
| 229 | endif |
| 230 | |
| 231 | ifdef BUILT_SOURCES |
| 232 | Source += $(filter %.cpp %.c %.cc %.y %.l,$(BUILT_SOURCES)) |
Vikram S. Adve | ad9ea7e | 2002-10-14 16:40:04 +0000 | [diff] [blame] | 233 | endif |
Vikram S. Adve | 112a72c | 2001-07-15 13:16:47 +0000 | [diff] [blame] | 234 | |
John Criswell | 82f4a5a | 2003-07-31 20:58:51 +0000 | [diff] [blame] | 235 | # |
| 236 | # Libtool Objects |
| 237 | # |
John Criswell | 410d1b5 | 2003-09-09 20:57:03 +0000 | [diff] [blame] | 238 | Srcs := $(sort $(basename $(Source))) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 239 | ObjectsO := $(Srcs:%=$(OBJDIR)/%.o) |
| 240 | ObjectsLO := $(Srcs:%=$(OBJDIR)/%.lo) |
| 241 | ObjectsBC := $(Srcs:%=$(OBJDIR)/%.bc) |
John Criswell | 82f4a5a | 2003-07-31 20:58:51 +0000 | [diff] [blame] | 242 | |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 243 | #--------------------------------------------------------- |
Chris Lattner | a8abc22 | 2002-09-18 03:22:27 +0000 | [diff] [blame] | 244 | # Handle the DIRS and PARALLEL_DIRS options |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 245 | #--------------------------------------------------------- |
| 246 | |
Anand Shukla | 7c7a07e | 2002-09-18 04:29:30 +0000 | [diff] [blame] | 247 | ifdef DIRS |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 248 | $(ALL_TARGETS):: |
| 249 | $(VERB) for dir in $(DIRS); do \ |
| 250 | if [ ! -f $$dir/Makefile ]; then \ |
| 251 | $(MKDIR) $$dir; \ |
| 252 | cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ |
| 253 | fi; \ |
| 254 | ($(MAKE) -C $$dir $@ $(MFLAGS)) || exit 1; \ |
Chris Lattner | f1ffd99 | 2002-09-17 23:35:02 +0000 | [diff] [blame] | 255 | done |
Anand Shukla | 7c7a07e | 2002-09-18 04:29:30 +0000 | [diff] [blame] | 256 | endif |
Chris Lattner | a8abc22 | 2002-09-18 03:22:27 +0000 | [diff] [blame] | 257 | |
| 258 | # Handle PARALLEL_DIRS |
| 259 | ifdef PARALLEL_DIRS |
Vikram S. Adve | 6edfe27 | 2003-07-10 19:25:29 +0000 | [diff] [blame] | 260 | all :: $(addsuffix /.makeall , $(PARALLEL_DIRS)) |
| 261 | install :: $(addsuffix /.makeinstall , $(PARALLEL_DIRS)) |
| 262 | clean :: $(addsuffix /.makeclean , $(PARALLEL_DIRS)) |
| 263 | test :: $(addsuffix /.maketest , $(PARALLEL_DIRS)) |
| 264 | bytecode :: $(addsuffix /.makebytecode, $(PARALLEL_DIRS)) |
Chris Lattner | a8df7bd | 2003-12-01 07:28:25 +0000 | [diff] [blame] | 265 | stripped-bytecode :: $(addsuffix /.makestripped-bytecode, $(PARALLEL_DIRS)) |
Brian Gaeke | f313ea7 | 2004-03-10 17:38:01 +0000 | [diff] [blame] | 266 | install-bytecode :: $(addsuffix /.makeinstall-bytecode, $(PARALLEL_DIRS)) |
Chris Lattner | a8abc22 | 2002-09-18 03:22:27 +0000 | [diff] [blame] | 267 | |
Brian Gaeke | f313ea7 | 2004-03-10 17:38:01 +0000 | [diff] [blame] | 268 | %/.makeall %/.makeinstall %/.makeclean %/.maketest %/.makebytecode %/.makestripped-bytecode %/.makeinstall-bytecode: |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 269 | $(VERB) if [ ! -f $(@D)/Makefile ]; then \ |
| 270 | $(MKDIR) $(@D); \ |
| 271 | cp $(BUILD_SRC_DIR)/$(@D)/Makefile $(@D)/Makefile; \ |
John Criswell | b3866b6 | 2003-11-25 19:32:22 +0000 | [diff] [blame] | 272 | fi; \ |
Misha Brukman | 694b3ff | 2004-05-21 23:21:11 +0000 | [diff] [blame] | 273 | $(MAKE) -C $(@D) $(subst $(@D)/.make,,$@) $(MFLAGS) |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 274 | endif |
| 275 | |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 276 | # Handle directories that may or may not exist |
John Criswell | 2a6530f | 2003-06-27 16:58:44 +0000 | [diff] [blame] | 277 | ifdef OPTIONAL_DIRS |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 278 | $(ALL_TARGETS):: |
| 279 | $(VERB) for dir in $(OPTIONAL_DIRS); do \ |
| 280 | if [ -d $(BUILD_SRC_DIR)/$$dir ]; then\ |
| 281 | if [ ! -f $$dir/Makefile ]; then \ |
| 282 | $(MKDIR) $$dir; \ |
| 283 | cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ |
| 284 | fi; \ |
| 285 | ($(MAKE) -C$$dir $@ $(MFLAGS)) || exit 1; \ |
| 286 | fi \ |
John Criswell | 2a6530f | 2003-06-27 16:58:44 +0000 | [diff] [blame] | 287 | done |
| 288 | endif |
| 289 | |
Reid Spencer | fc94508 | 2004-08-20 09:20:05 +0000 | [diff] [blame] | 290 | #--------------------------------------------------------- |
| 291 | # Handle the CONFIG_FILES options |
| 292 | #--------------------------------------------------------- |
| 293 | ifdef CONFIG_FILES |
Reid Spencer | 05e90a0 | 2004-08-20 09:32:32 +0000 | [diff] [blame] | 294 | install:: install-config-files |
Reid Spencer | fc94508 | 2004-08-20 09:20:05 +0000 | [diff] [blame] | 295 | |
| 296 | $(sysconfdir): |
| 297 | $(MKDIR) $(sysconfdir) |
| 298 | |
Reid Spencer | 05e90a0 | 2004-08-20 09:32:32 +0000 | [diff] [blame] | 299 | install-config-files: $(sysconfdir) $(CONFIG_FILES) |
Reid Spencer | 37130d2 | 2004-10-04 07:05:07 +0000 | [diff] [blame] | 300 | $(VERB)$(ECHO) Installing Configuration Files To $(sysconfdir) |
| 301 | $(VERB)for file in $(CONFIG_FILES); do \ |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 302 | $(INSTALL) $(BUILD_SRC_DIR)/$${file} $(sysconfdir) ; \ |
Reid Spencer | fc94508 | 2004-08-20 09:20:05 +0000 | [diff] [blame] | 303 | done |
| 304 | endif |
| 305 | |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 306 | ########################################################################### |
| 307 | # Library Build Rules: |
| 308 | # |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 309 | #--------------------------------------------------------- |
| 310 | # Handle the LIBRARYNAME option - used when building libs... |
| 311 | #--------------------------------------------------------- |
Chris Lattner | e62dbe9 | 2002-07-23 17:56:16 +0000 | [diff] [blame] | 312 | # |
| 313 | # When libraries are built, they are allowed to optionally define the |
| 314 | # DONT_BUILD_RELINKED make variable, which, when defined, prevents a .o file |
| 315 | # from being built for the library. This .o files may then be linked to by a |
| 316 | # tool if the tool does not need (or want) the semantics a .a file provides |
| 317 | # (linking in only object files that are "needed"). If a library is never to |
| 318 | # be used in this way, it is better to define DONT_BUILD_RELINKED, and define |
| 319 | # BUILD_ARCHIVE instead. |
| 320 | # |
| 321 | # Some libraries must be built as .a files (libscalar for example) because if |
Chris Lattner | 1917e95 | 2002-07-31 21:32:05 +0000 | [diff] [blame] | 322 | # it's built as a .o file, then all of the constituent .o files in it will be |
Chris Lattner | e62dbe9 | 2002-07-23 17:56:16 +0000 | [diff] [blame] | 323 | # linked into tools (for example gccas) even if they only use one of the parts |
| 324 | # of it. For this reason, sometimes it's useful to use libraries as .a files. |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 325 | ########################################################################### |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 326 | |
Brian Gaeke | 8abff79 | 2004-01-22 22:53:48 +0000 | [diff] [blame] | 327 | # Install rule for making bytecode library directory if it does not exist. |
| 328 | # Trigger this by making libraries that need to be installed here depend on it. |
| 329 | $(DESTDIR)$(bytecode_libdir): |
| 330 | $(MKDIR) $@ |
| 331 | |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 332 | ifdef LIBRARYNAME |
Vikram S. Adve | 112a72c | 2001-07-15 13:16:47 +0000 | [diff] [blame] | 333 | |
Chris Lattner | 2a548c5 | 2002-09-16 22:36:42 +0000 | [diff] [blame] | 334 | # Make sure there isn't any extranous whitespace on the LIBRARYNAME option |
Chris Lattner | ccb4ebd | 2002-09-16 22:34:56 +0000 | [diff] [blame] | 335 | LIBRARYNAME := $(strip $(LIBRARYNAME)) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 336 | LIBNAME_LA := $(LIBDIR)/lib$(LIBRARYNAME).la |
| 337 | LIBNAME_A := $(LIBDIR)/lib$(LIBRARYNAME).a |
| 338 | LIBNAME_O := $(LIBDIR)/$(LIBRARYNAME).o |
| 339 | LIBNAME_BC := $(LIBDIR)/lib$(LIBRARYNAME).bc |
Chris Lattner | ccb4ebd | 2002-09-16 22:34:56 +0000 | [diff] [blame] | 340 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 341 | #------------------------------------------------------------------------------- |
| 342 | # Shared Library Targets |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 343 | # Modify the top level targets to build the desired libraries. |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 344 | #------------------------------------------------------------------------------- |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 345 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 346 | # Does the library want a shared library version built? |
| 347 | ifdef SHARED_LIBRARY |
| 348 | |
| 349 | all:: $(LIBNAME_LA) |
| 350 | |
| 351 | $(LIBNAME_LA): $(BUILT_SOURCES) $(ObjectsLO) $(LIBDIR)/.dir |
| 352 | @$(ECHO) Linking shared library $(notdir $@) |
| 353 | $(VERB) $(Link) -o $@ $(ObjectsLO) |
| 354 | $(VERB) $(LIBTOOL) --mode=install $(INSTALL) $@ $(LIBDIR) |
| 355 | @$(ECHO) Finished linking shared library $(LIBRARYNAME).la |
| 356 | clean:: |
| 357 | $(VERB) $(RM) -f $(LIBNAME_LA) |
| 358 | |
| 359 | install:: $(DESTDIR)$(libdir)/lib$(LIBRARYNAME)$(SHLIBEXT) |
| 360 | |
| 361 | $(DESTDIR)/lib/lib$(LIBRARYNAME)$(SHLIBEXT): $(LIBNAME_LA) |
| 362 | @$(ECHO) Installing shared library $(notdir $@) |
| 363 | $(VERB) $(MKDIR) $(DESTDIR) |
| 364 | $(VERB) $(LIBTOOL) --mode=install $(INSTALL) $(LIBNAME_LA) $(DESTDIR)$(libdir)/lib$(LIBRARYNAME)$(SHLIBEXT) |
| 365 | $(VERB) $(LIBTOOL) --finish $(DESTDIR)$(libdir) |
| 366 | endif |
| 367 | |
| 368 | # Does the library want a bytecode version built? |
| 369 | ifdef BYTECODE_LIBRARY |
| 370 | |
| 371 | ifdef EXPORTED_SYMBOL_LIST |
| 372 | BCLinkLib += -Xlinker -internalize-public-api-list=$(EXPORTED_SYMBOL_LIST) |
| 373 | else |
| 374 | ifdef EXPORTED_SYMBOL_FILE |
| 375 | BCLinkLib += -Xlinker -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE) |
| 376 | else |
| 377 | BCLinkLib += -Xlinker -disable-internalize |
| 378 | endif |
| 379 | endif |
| 380 | |
| 381 | all:: $(LIBNAME_BC) |
| 382 | |
| 383 | $(LIBNAME_BC): $(BUILT_SOURCES) $(ObjectsBC) $(LIBDIR)/.dir |
| 384 | @$(ECHO) Linking bytecode library $(notdir $@) |
| 385 | $(VERB) $(BCLinkLib) -o $@ $(ObjectsBC) |
| 386 | |
| 387 | clean:: |
| 388 | $(VERB) $(RM) -f $(LIBNAME_BC) |
| 389 | |
| 390 | install:: $(DESTDIR)$(bytecode_libdir)/lib$(LIBRARYNAME).bc |
Chris Lattner | 481cc7c | 2003-08-15 02:18:35 +0000 | [diff] [blame] | 391 | |
Brian Gaeke | 13f9932 | 2004-01-21 23:57:21 +0000 | [diff] [blame] | 392 | $(DESTDIR)$(bytecode_libdir)/lib$(LIBRARYNAME).bc: $(LIBNAME_BC) $(DESTDIR)$(bytecode_libdir) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 393 | @$(ECHO) Installing bytecode library $(notdir $@) |
| 394 | $(VERB)$(INSTALL) $< $@ |
| 395 | |
| 396 | endif |
Vikram S. Adve | 60f5606 | 2002-08-02 18:34:12 +0000 | [diff] [blame] | 397 | |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 398 | # Does the library want a .o version built? |
Chris Lattner | e62dbe9 | 2002-07-23 17:56:16 +0000 | [diff] [blame] | 399 | ifndef DONT_BUILD_RELINKED |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 400 | all:: $(LIBNAME_O) |
| 401 | |
| 402 | $(LIBNAME_O): $(BUILT_SOURCES) $(ObjectsO) $(LIBDIR)/.dir |
| 403 | @$(ECHO) Linking object $(notdir $@) |
| 404 | $(VERB) $(Relink) -o $@ $(ObjectsO) |
| 405 | |
| 406 | install:: $(DESTDIR)$(libdir)/$(LIBRARYNAME).o |
| 407 | |
| 408 | $(DESTDIR)$(libdir)/$(LIBRARYNAME).o: $(LIBNAME_O) |
| 409 | @$(ECHO) Installing object library $(notdir $@) |
| 410 | $(VERB) $(MKDIR) $(DESTDIR)$(libdir) |
| 411 | $(VERB) $(LIBTOOL) --mode=install $(INSTALL) $(LIBNAME_O) $(DESTDIR)$(libdir)/$(LIBRARYNAME).o |
| 412 | |
| 413 | clean:: |
| 414 | $(VERB) $(RM) -f $(LIBNAME_O) |
| 415 | |
Chris Lattner | e62dbe9 | 2002-07-23 17:56:16 +0000 | [diff] [blame] | 416 | endif |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 417 | |
| 418 | # Does the library want an archive version built? |
Chris Lattner | e62dbe9 | 2002-07-23 17:56:16 +0000 | [diff] [blame] | 419 | ifdef BUILD_ARCHIVE |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 420 | all:: $(LIBNAME_A) |
Chris Lattner | e62dbe9 | 2002-07-23 17:56:16 +0000 | [diff] [blame] | 421 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 422 | $(LIBNAME_A): $(BUILT_SOURCES) $(ObjectsO) $(LIBDIR)/.dir |
| 423 | @$(ECHO) Linking archive $(notdir $@) library |
Reid Spencer | 37130d2 | 2004-10-04 07:05:07 +0000 | [diff] [blame] | 424 | $(VERB)$(RM) -f $@ |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 425 | $(VERB) $(Archive) $@ $(ObjectsO) |
| 426 | $(VERB) $(Ranlib) $@ |
Vikram S. Adve | 41e7891 | 2002-09-20 14:03:13 +0000 | [diff] [blame] | 427 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 428 | clean:: |
| 429 | $(VERB) $(RM) -f $(LIBNAME_A) |
Vikram S. Adve | 112a72c | 2001-07-15 13:16:47 +0000 | [diff] [blame] | 430 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 431 | install:: $(DESTDIR)$(libdir)/lib$(LIBRARYNAME).a |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 432 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 433 | $(DESTDIR)$(libdir)/lib$(LIBRARYNAME).a: $(LIBNAME_A) |
Brian Gaeke | 6c09696 | 2004-02-09 17:38:52 +0000 | [diff] [blame] | 434 | $(MKDIR) $(DESTDIR)$(libdir) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 435 | $(VERB) $(LIBTOOL) --mode=install $(INSTALL) $(LIBNAME_A) $(DESTDIR)$(libdir)/lib$(LIBRARYNAME).a |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 436 | endif |
| 437 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 438 | # if LIBRARYNAME |
| 439 | endif |
| 440 | |
Chris Lattner | 1cbc29f | 2001-09-07 22:57:58 +0000 | [diff] [blame] | 441 | #------------------------------------------------------------------------ |
| 442 | # Handle the TOOLNAME option - used when building tool executables... |
| 443 | #------------------------------------------------------------------------ |
| 444 | # |
| 445 | # The TOOLNAME option should be used with a USEDLIBS variable that tells the |
Chris Lattner | e62dbe9 | 2002-07-23 17:56:16 +0000 | [diff] [blame] | 446 | # libraries (and the order of the libs) that should be linked to the |
| 447 | # tool. USEDLIBS should contain a list of library names (some with .a extension) |
| 448 | # that are automatically linked in as .o files unless the .a suffix is added. |
Chris Lattner | 1cbc29f | 2001-09-07 22:57:58 +0000 | [diff] [blame] | 449 | # |
| 450 | ifdef TOOLNAME |
| 451 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 452 | # TOOLLINKOPTSB to pass options to the linker like library search path etc |
| 453 | # Note that this is different from TOOLLINKOPTS, these options |
| 454 | # are passed to the linker *before* the USEDLIBS options are passed. |
| 455 | # e.g. usage TOOLLINKOPTSB = -L/home/xxx/lib |
| 456 | ifdef TOOLLINKOPTSB |
| 457 | Link += $(TOOLLINKOPTSB) |
Reid Spencer | 37130d2 | 2004-10-04 07:05:07 +0000 | [diff] [blame] | 458 | endif |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 459 | |
Chris Lattner | 1cbc29f | 2001-09-07 22:57:58 +0000 | [diff] [blame] | 460 | # TOOLEXENAME* - These compute the output filenames to generate... |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 461 | TOOLEXENAME := $(TOOLDIR)/$(TOOLNAME) |
Chris Lattner | 1cbc29f | 2001-09-07 22:57:58 +0000 | [diff] [blame] | 462 | |
| 463 | # USED_LIBS_OPTIONS - Compute the options line that add -llib1 -llib2, etc. |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 464 | PROJ_LIBS_OPTIONS := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS))) |
| 465 | PROJ_LIBS_OPTIONS := $(patsubst %.o, $(LIBDIR)/%.o, $(PROJ_LIBS_OPTIONS)) |
| 466 | LLVM_LIBS_OPTIONS := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS))) |
| 467 | LLVM_LIBS_OPTIONS := $(patsubst %.o, $(LLVMLIBDIR)/%.o, $(LLVM_LIBS_OPTIONS)) |
Dinakar Dhurjati | ffb55cd | 2003-05-29 16:18:20 +0000 | [diff] [blame] | 468 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 469 | PROJ_USED_LIBS := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS))) |
| 470 | LLVM_USED_LIBS := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS))) |
| 471 | PROJ_LIBS_PATHS := $(addprefix $(LIBDIR)/,$(PROJ_USED_LIBS)) |
| 472 | LLVM_LIBS_PATHS := $(addprefix $(LLVMLIBDIR)/,$(LLVM_USED_LIBS)) |
Dinakar Dhurjati | ffb55cd | 2003-05-29 16:18:20 +0000 | [diff] [blame] | 473 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 474 | LINK_OPTS := $(TOOLLINKOPTS) $(PROJ_LIBS_OPTIONS) $(LLVM_LIBS_OPTIONS) |
John Criswell | fe785bd | 2004-09-16 14:11:25 +0000 | [diff] [blame] | 475 | |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 476 | # |
| 477 | # Libtool link options: |
| 478 | # Ensure that all binaries have their symbols exported so that they can |
| 479 | # by dlsym'ed. |
| 480 | # |
Chris Lattner | 8d7dfb3 | 2003-01-22 16:13:31 +0000 | [diff] [blame] | 481 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 482 | # Handle compression libraries automatically |
| 483 | ifeq ($(HAVE_BZIP2),1) |
| 484 | LIBS += -lbz2 |
| 485 | endif |
| 486 | ifeq ($(HAVE_ZLIB),1) |
| 487 | LIBS += -lz |
| 488 | endif |
Dinakar Dhurjati | ffb55cd | 2003-05-29 16:18:20 +0000 | [diff] [blame] | 489 | |
Chris Lattner | 8d7dfb3 | 2003-01-22 16:13:31 +0000 | [diff] [blame] | 490 | # Tell make that we need to rebuild subdirectories before we can link the tool. |
| 491 | # This affects things like LLI which has library subdirectories. |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 492 | $(LIBS): $(addsuffix /.makeall, $(PARALLEL_DIRS)) |
Chris Lattner | 8d7dfb3 | 2003-01-22 16:13:31 +0000 | [diff] [blame] | 493 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 494 | all:: $(TOOLEXENAME) |
John Criswell | 2a6530f | 2003-06-27 16:58:44 +0000 | [diff] [blame] | 495 | |
Chris Lattner | 1cbc29f | 2001-09-07 22:57:58 +0000 | [diff] [blame] | 496 | clean:: |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 497 | $(VERB) $(RM) -f $(TOOLEXENAME) |
Chris Lattner | 1cbc29f | 2001-09-07 22:57:58 +0000 | [diff] [blame] | 498 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 499 | $(TOOLEXENAME): $(BUILT_SOURCES) $(ObjectsO) $(PROJ_LIBS_PATHS) $(LLVM_LIBS_PATHS) $(TOOLDIR)/.dir |
| 500 | @$(ECHO) Linking $(CONFIGURATION) executable $(TOOLNAME) $(STRIP_WARN_MSG) |
| 501 | $(VERB) $(Link) -o $@ $(ObjectsO) $(PROJ_LIBS_OPTIONS) $(LLVM_LIBS_OPTIONS) $(LIBS) |
| 502 | @$(ECHO) ======= Finished linking $(CONFIGURATION) executable $(TOOLNAME) $(STRIP_WARN_MSG) |
Chris Lattner | 1cbc29f | 2001-09-07 22:57:58 +0000 | [diff] [blame] | 503 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 504 | install:: $(TOOLEXENAME) |
| 505 | @$(ECHO) Installing $(TOOLNAME) |
| 506 | $(VERB) $(INSTALL) $(TOOLEXENAME) $(DESTDIR)/bin |
| 507 | endif |
Chris Lattner | 1cbc29f | 2001-09-07 22:57:58 +0000 | [diff] [blame] | 508 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 509 | ifndef DISABLE_AUTO_DEPENDENCIES |
Vikram S. Adve | 41e7891 | 2002-09-20 14:03:13 +0000 | [diff] [blame] | 510 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 511 | # Create .lo files in the OBJDIR directory from the .cpp and .c files... |
| 512 | $(OBJDIR)/%.lo: %.cpp $(OBJDIR)/.dir |
| 513 | @$(ECHO) "Compiling $(CONFIGURATION) $*.cpp For Shared Library" |
| 514 | $(VERB) if $(LTCXXCompile) -MD -MT $@ -MP -MF $(OBJDIR)/$*.Td $< -o $@ ; \ |
| 515 | then mv -f "$(OBJDIR)/$*.Td" "$(OBJDIR)/$*.d"; else rm -f "$(OBJDIR)/$*.Td"; exit 1; fi |
| 516 | |
| 517 | $(OBJDIR)/%.o: %.cpp $(OBJDIR)/.dir |
| 518 | @$(ECHO) "Compiling $(CONFIGURATION) $*.cpp For Archive" |
| 519 | $(VERB) if $(CXXCompile) -MD -MT $@ -MP -MF $(OBJDIR)/$*.Td $< -o $@ ; \ |
| 520 | then mv -f "$(OBJDIR)/$*.Td" "$(OBJDIR)/$*.d"; else rm -f "$(OBJDIR)/$*.Td"; exit 1; fi |
| 521 | |
| 522 | $(OBJDIR)/%.lo: %.c $(OBJDIR)/.dir |
| 523 | @$(ECHO) "Compiling $(CONFIGURATION) $*.c For Shared Library" |
| 524 | $(VERB) if $(LTCCompile) -MD -MT $@ -MP -MF $(OBJDIR)/$*.Td $< -o $@ ; \ |
| 525 | then mv -f "$(OBJDIR)/$*.Td" "$(OBJDIR)/$*.d"; else rm -f "$(OBJDIR)/$*.Td"; exit 1; fi |
| 526 | |
| 527 | $(OBJDIR)/%.o: %.c $(OBJDIR)/.dir |
| 528 | @$(ECHO) "Compiling $(CONFIGURATION) $*.c For Archive" |
| 529 | $(VERB) if $(CCompile) -MD -MT $@ -MP -MF $(OBJDIR)/$*.Td $< -o $@ ; \ |
| 530 | then mv -f "$(OBJDIR)/$*.Td" "$(OBJDIR)/$*.d"; else rm -f "$(OBJDIR)/$*.Td"; exit 1; fi |
| 531 | |
| 532 | # Create .bc files in the OBJDIR directory from .cpp and .c files... |
| 533 | $(OBJDIR)/%.bc: %.cpp $(OBJDIR)/.dir |
| 534 | @$(ECHO) "Compiling $(CONFIGURATION) $*.cpp to bytecode" |
| 535 | $(VERB) if $(BCCXXCompile) -MD -MT $@ -MP -MF "$(OBJDIR)/$*.Td" $< -o $@ ; \ |
| 536 | then mv -f "$(OBJDIR)/$*.Td" "$(OBJDIR)/$*.d"; else rm -f "$(OBJDIR)/$*.Td"; exit 1; fi |
| 537 | |
| 538 | $(OBJDIR)/%.bc: %.c $(OBJDIR)/.dir |
| 539 | @$(ECHO) "Compiling $(CONFIGURATION) $*.c to bytecode" |
| 540 | $(VERB) if $(BCCCompile) -MD -MT $@ -MP -MF "$(OBJDIR)/$*.Td" $< -o $@ ; \ |
| 541 | then mv -f "$(OBJDIR)/$*.Td" "$(OBJDIR)/$*.d"; else rm -f "$(OBJDIR)/$*.Tpo"; exit 1; fi |
| 542 | |
| 543 | else |
| 544 | |
| 545 | $(OBJDIR)/%.lo: %.cpp $(OBJDIR)/.dir |
| 546 | @$(ECHO) "Compiling $(CONFIGURATION) $*.cpp For Shared Library" |
| 547 | $(LTCXXCompile) $< -o $@ |
| 548 | |
| 549 | $(OBJDIR)/%.o: %.cpp $(OBJDIR)/.dir |
| 550 | @$(ECHO) "Compiling $(CONFIGURATION) $*.cpp For Archive" |
| 551 | $(CXXCompile) $< -o $@ |
| 552 | |
| 553 | $(OBJDIR)/%.lo: %.c $(OBJDIR)/.dir |
| 554 | @$(ECHO) "Compiling $(CONFIGURATION) $*.cpp For Shared Library" |
| 555 | $(LTCCompile) $< -o $@ |
| 556 | |
| 557 | $(OBJDIR)/%.o: %.c $(OBJDIR)/.dir |
| 558 | @$(ECHO) "Compiling $(CONFIGURATION) $*.cpp For Archive" |
| 559 | $(CCompile) $< -o $@ |
| 560 | |
| 561 | # Create .bc files in the OBJDIR directory from .cpp and .c files... |
| 562 | $(OBJDIR)/%.bc: %.cpp $(OBJDIR)/.dir |
| 563 | @$(ECHO) "Compiling $(CONFIGURATION) $*.cpp To Bytecode" |
| 564 | $(BCCompileCPP) $< -o $@ |
| 565 | |
| 566 | $(OBJDIR)/%.bc: %.c $(OBJDIR)/.dir |
| 567 | @$(ECHO) "Compiling $(CONFIGURATION) $*.c To Bytecode" |
| 568 | $(BCCompileC) $< -o $@ |
Brian Gaeke | 44909cf | 2003-12-10 00:26:28 +0000 | [diff] [blame] | 569 | |
Chris Lattner | 1cbc29f | 2001-09-07 22:57:58 +0000 | [diff] [blame] | 570 | endif |
| 571 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 572 | $(OBJDIR)/%.bc: %.ll $(OBJDIR)/.dir $(LLVMAS) |
| 573 | @$(ECHO) "Compiling $*.ll To Bytecode" |
Chris Lattner | 481cc7c | 2003-08-15 02:18:35 +0000 | [diff] [blame] | 574 | $(VERB) $(LLVMAS) $< -f -o $@ |
| 575 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 576 | ifdef TARGET |
| 577 | |
Misha Brukman | 8567ccf | 2004-10-22 22:18:27 +0000 | [diff] [blame] | 578 | TDFILES := $(strip $(wildcard $(BUILD_SRC_DIR)/*.td) $(BUILD_SRC_ROOT)/lib/Target/Target.td) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 579 | |
| 580 | $(BUILT_SOURCES): $(TDFILES) |
| 581 | |
| 582 | %GenRegisterNames.inc : %.td |
| 583 | @echo "Building $(<F) register names with tblgen" |
| 584 | $(VERB) $(TableGen) -gen-register-enums -o $@ $< |
| 585 | |
| 586 | %GenRegisterInfo.h.inc : %.td |
| 587 | @echo "Building $(<F) register information header with tblgen" |
| 588 | $(VERB) $(TableGen) -gen-register-desc-header -o $@ $< |
| 589 | |
| 590 | %GenRegisterInfo.inc : %.td |
| 591 | @echo "Building $(<F) register info implementation with tblgen" |
| 592 | $(VERB) $(TableGen) -gen-register-desc -o $@ $< |
| 593 | |
| 594 | %GenInstrNames.inc : %.td |
| 595 | @echo "Building $(<F) instruction names with tblgen" |
| 596 | $(VERB) $(TableGen) -gen-instr-enums -o $@ $< |
| 597 | |
| 598 | %GenInstrInfo.inc : %.td |
| 599 | @echo "Building $(<F) instruction information with tblgen" |
| 600 | $(VERB) $(TableGen) -gen-instr-desc -o $@ $< |
| 601 | |
| 602 | %GenAsmWriter.inc : %.td |
| 603 | @echo "Building $(<F) assembly writer with tblgen" |
| 604 | $(VERB) $(TableGen) -gen-asm-writer -o $@ $< |
| 605 | |
| 606 | %GenATTAsmWriter.inc : %.td |
| 607 | @echo "Building $(<F) AT&T assembly writer with tblgen" |
| 608 | $(VERB) $(TableGen) -gen-asm-writer -o $@ $< |
| 609 | |
| 610 | %GenIntelAsmWriter.inc : %.td |
| 611 | @echo "Building $(<F) Intel assembly writer with tblgen" |
| 612 | $(VERB) $(TableGen) -gen-asm-writer -asmwriternum=1 -o $@ $< |
| 613 | |
| 614 | %GenInstrSelector.inc: %.td |
| 615 | @echo "Building $(<F) instruction selector with tblgen" |
| 616 | $(VERB) $(TableGen) -gen-instr-selector -o $@ $< |
| 617 | |
| 618 | %GenCodeEmitter.inc:: %.td |
| 619 | @echo "Building $(<F) code emitter with tblgen" |
| 620 | $(VERB) $(TableGen) -gen-emitter -o $@ $< |
| 621 | |
| 622 | clean:: |
| 623 | $(VERB) rm -f *.inc |
| 624 | |
| 625 | endif |
Chris Lattner | 481cc7c | 2003-08-15 02:18:35 +0000 | [diff] [blame] | 626 | |
Chris Lattner | e899678 | 2003-01-16 22:44:19 +0000 | [diff] [blame] | 627 | # |
| 628 | # Rules for building lex/yacc files |
| 629 | # |
| 630 | LEX_FILES = $(filter %.l, $(Source)) |
| 631 | LEX_OUTPUT = $(LEX_FILES:%.l=%.cpp) |
| 632 | YACC_FILES = $(filter %.y, $(Source)) |
| 633 | YACC_OUTPUT = $(addprefix $(YACC_FILES:%.y=%), .h .cpp .output) |
| 634 | .PRECIOUS: $(LEX_OUTPUT) $(YACC_OUTPUT) |
| 635 | |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 636 | # Create a .cpp source file from a flex input file... this uses sed to cut down |
| 637 | # on the warnings emited by GCC... |
Chris Lattner | 6d131b4 | 2003-01-23 16:33:10 +0000 | [diff] [blame] | 638 | # |
| 639 | # The last line is a gross hack to work around flex aparently not being able to |
| 640 | # resize the buffer on a large token input. Currently, for uninitialized string |
| 641 | # buffers in LLVM we can generate very long tokens, so this is a hack around it. |
Chris Lattner | b7dc2b9 | 2003-08-15 20:00:47 +0000 | [diff] [blame] | 642 | # FIXME. (f.e. char Buffer[10000] ) |
Chris Lattner | 6d131b4 | 2003-01-23 16:33:10 +0000 | [diff] [blame] | 643 | # |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 644 | %.cpp: %.l |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 645 | @$(ECHO) Flexing $< |
Chris Lattner | 7bb107d | 2003-08-04 19:48:10 +0000 | [diff] [blame] | 646 | $(VERB) $(FLEX) -t $< | \ |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 647 | $(SED) '/^find_rule/d' | \ |
| 648 | $(SED) 's/void yyunput/inline void yyunput/' | \ |
| 649 | $(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \ |
| 650 | $(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' \ |
| 651 | > $@.tmp |
| 652 | $(VERB) cmp -s $@ $@.tmp > /dev/null || $(MV) -f $@.tmp $@ |
Chris Lattner | a328f88 | 2003-08-04 19:47:06 +0000 | [diff] [blame] | 653 | @# remove the output of flex if it didn't get moved over... |
| 654 | @rm -f $@.tmp |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 655 | |
| 656 | # Rule for building the bison parsers... |
Chris Lattner | 694c5df | 2003-05-15 21:28:55 +0000 | [diff] [blame] | 657 | %.c: %.y # Cancel built-in rules for yacc |
| 658 | %.h: %.y # Cancel built-in rules for yacc |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 659 | %.cpp %.h : %.y |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 660 | @$(ECHO) "Bisoning $*.y" |
John Criswell | 410d1b5 | 2003-09-09 20:57:03 +0000 | [diff] [blame] | 661 | $(VERB) $(BISON) -v -d -p $(<F:%Parser.y=%) -o $*.tab.c $< |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 662 | $(VERB) cmp -s $*.tab.c $*.cpp > /dev/null || $(MV) -f $*.tab.c $*.cpp |
| 663 | $(VERB) cmp -s $*.tab.h $*.h > /dev/null || $(MV) -f $*.tab.h $*.h |
Chris Lattner | a328f88 | 2003-08-04 19:47:06 +0000 | [diff] [blame] | 664 | @# If the files were not updated, don't leave them lying around... |
| 665 | @rm -f $*.tab.c $*.tab.h |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 666 | |
| 667 | # To create the directories... |
| 668 | %/.dir: |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 669 | $(VERB) $(MKDIR) $* > /dev/null |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 670 | @$(DATE) > $@ |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 671 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 672 | .PRECIOUS: $(OBJDIR)/.dir $(LIBDIR)/.dir $(TOOLDIR)/.dir $(LLVMLIBDIR)/.dir |
| 673 | .PRECIOUS: $(LLVMTOOLDIR)/.dir |
| 674 | |
Chris Lattner | 30440c6 | 2003-01-16 21:06:18 +0000 | [diff] [blame] | 675 | # To create postscript files from dot files... |
John Criswell | e0f9ac6 | 2003-10-02 19:02:02 +0000 | [diff] [blame] | 676 | ifneq ($(DOT),false) |
Chris Lattner | 30440c6 | 2003-01-16 21:06:18 +0000 | [diff] [blame] | 677 | %.ps: %.dot |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 678 | $(DOT) -Tps < $< > $@ |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 679 | else |
| 680 | %.ps: %.dot |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 681 | $(ECHO) "Cannot build $@: The program dot is not installed" |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 682 | endif |
Chris Lattner | 30440c6 | 2003-01-16 21:06:18 +0000 | [diff] [blame] | 683 | |
John Criswell | 7f33695 | 2003-09-06 14:44:17 +0000 | [diff] [blame] | 684 | # |
| 685 | # This rules ensures that header files that are removed still have a rule for |
| 686 | # which they can be "generated." This allows make to ignore them and |
| 687 | # reproduce the dependency lists. |
| 688 | # |
John Criswell | 4b6e5d1 | 2003-09-18 18:37:08 +0000 | [diff] [blame] | 689 | %.h:: ; |
John Criswell | 7f33695 | 2003-09-06 14:44:17 +0000 | [diff] [blame] | 690 | |
Chris Lattner | 172b648 | 2002-09-22 02:47:15 +0000 | [diff] [blame] | 691 | # 'make clean' nukes the tree |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 692 | clean:: |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 693 | $(VERB) $(RM) -rf $(OBJDIR) |
Brian Gaeke | 9d3cd40 | 2004-01-21 19:53:11 +0000 | [diff] [blame] | 694 | $(VERB) $(RM) -f core core.[0-9][0-9]* *.o *.d *~ *.flc |
| 695 | ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set |
| 696 | $(VERB) $(RM) -f *$(SHLIBEXT) |
| 697 | endif |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 698 | $(VERB) $(RM) -f $(LEX_OUTPUT) $(YACC_OUTPUT) |
| 699 | |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 700 | ########################################################################### |
| 701 | # C/C++ Dependencies |
| 702 | # Define variables and rules that generate header file dependencies |
| 703 | # from C/C++ source files. |
| 704 | ########################################################################### |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 705 | |
Chris Lattner | 33ad24a | 2003-08-22 14:10:16 +0000 | [diff] [blame] | 706 | ifndef DISABLE_AUTO_DEPENDENCIES |
| 707 | |
Chris Lattner | 694c5df | 2003-05-15 21:28:55 +0000 | [diff] [blame] | 708 | # If dependencies were generated for the file that included this file, |
Misha Brukman | 36bc642 | 2003-08-21 22:02:18 +0000 | [diff] [blame] | 709 | # include the dependencies now... |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 710 | # |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 711 | |
John Criswell | 410d1b5 | 2003-09-09 20:57:03 +0000 | [diff] [blame] | 712 | SourceBaseNames := $(basename $(Source)) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 713 | SourceDepend := $(SourceBaseNames:%=$(BUILD_OBJ_DIR)/$(CONFIGURATION)/%.d) |
Misha Brukman | 4f7a8cf | 2003-11-09 21:36:19 +0000 | [diff] [blame] | 714 | |
John Criswell | bd08280 | 2003-10-07 14:16:44 +0000 | [diff] [blame] | 715 | # |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 716 | # Include dependencies generated from C/C++ source files, but not if we |
| 717 | # are cleaning (this example taken from the GNU Make Manual). |
| 718 | # |
| 719 | ifneq ($(MAKECMDGOALS),clean) |
John Criswell | d741bcf | 2003-08-12 18:51:51 +0000 | [diff] [blame] | 720 | ifneq ($(MAKECMDGOALS),distclean) |
Chris Lattner | 15444a9 | 2003-08-29 14:07:02 +0000 | [diff] [blame] | 721 | -include /dev/null $(SourceDepend) |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 722 | endif |
John Criswell | d741bcf | 2003-08-12 18:51:51 +0000 | [diff] [blame] | 723 | endif |
Chris Lattner | 1ddb6b6 | 2003-08-18 17:27:40 +0000 | [diff] [blame] | 724 | |
Chris Lattner | 33ad24a | 2003-08-22 14:10:16 +0000 | [diff] [blame] | 725 | endif # ifndef DISABLE_AUTO_DEPENDENCIES |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 726 | |
| 727 | ############################################################################### |
| 728 | # PRECONDITIONS - that which must be built/checked first |
| 729 | ############################################################################### |
| 730 | |
| 731 | OBJMKFILE := $(BUILD_OBJ_DIR)/Makefile |
| 732 | SRCMKFILE := $(BUILD_SRC_DIR)/Makefile |
| 733 | CONFIGURE := $(LLVM_SRC_ROOT)/configure |
| 734 | CONFIG_STATUS := $(LLVM_OBJ_ROOT)/config.status |
| 735 | MAKE_CONFIG_IN := $(LLVM_SRC_ROOT)/Makefile.config.in |
| 736 | MAKE_CONFIG := $(LLVM_OBJ_ROOT)/Makefile.config |
| 737 | |
| 738 | #------------------------------------------------------------------------ |
| 739 | # List of the preconditions |
| 740 | preconditions: $(CONFIG_STATUS) $(MAKE_CONFIG) $(OBJMKFILE) |
| 741 | |
| 742 | all dist distcheck install:: $(BUILT_SOURCES) |
| 743 | |
| 744 | clean:: |
| 745 | $(VERB) $(RM) -f $(BUILT_SOURCES) |
| 746 | |
| 747 | #------------------------------------------------------------------------ |
| 748 | # Make sure we're not using a stale configuration |
| 749 | .PRECIOUS: $(CONFIG_STATUS) |
| 750 | $(CONFIG_STATUS): $(CONFIGURE) |
| 751 | @$(ECHO) Reconfiguring with $@ |
| 752 | $(VERB) $(CONFIG_STATUS) --recheck |
| 753 | |
| 754 | #------------------------------------------------------------------------ |
| 755 | # Make sure the configuration makefile is up to date |
| 756 | $(MAKE_CONFIG): $(MAKE_CONFIG_IN) |
| 757 | @$(ECHO) Regenerating $@ |
| 758 | $(VERB) cd $(LLVM_OBJ_ROOT) ; $(CONFIG_STATUS) Makefile.config |
| 759 | $(VERB) $(MAKE) $(MAKEFLAGS) $(MAKECMDGOALS) |
| 760 | @exit 0; |
| 761 | |
| 762 | #------------------------------------------------------------------------ |
| 763 | # If the Makefile in the source tree has been updated, copy it over into the |
| 764 | # build tree. |
Reid Spencer | e53e397 | 2004-10-22 23:06:30 +0000 | [diff] [blame^] | 765 | ifneq ($(OBJMKFILE),$(SRCMKFILE)) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 766 | .PRECIOUS: $(OBJMKFILE) |
| 767 | $(OBJMKFILE): $(SRCMKFILE) |
| 768 | @$(ECHO) "Updating Makefile from : $(dir $<)" |
| 769 | $(VERB) $(MKDIR) $(@D) |
| 770 | $(VERB) cp -f $< $@ |
| 771 | $(VERB) $(MAKE) $(MAKEFLAGS) $(MAKECMDGOALS) |
| 772 | @exit 0; |
Reid Spencer | e53e397 | 2004-10-22 23:06:30 +0000 | [diff] [blame^] | 773 | endif |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 774 | |
| 775 | ############################################################################### |
| 776 | # MISCELLANEOUS - utility targets |
| 777 | ############################################################################### |
| 778 | |
| 779 | #------------------------------------------------------------------------ |
| 780 | # Print out the directories used for building |
| 781 | printvars: |
| 782 | @$(ECHO) "BUILD_SRC_ROOT: " $(BUILD_SRC_ROOT) |
| 783 | @$(ECHO) "BUILD_SRC_DIR : " $(BUILD_SRC_DIR) |
| 784 | @$(ECHO) "BUILD_OBJ_ROOT: " $(BUILD_OBJ_ROOT) |
| 785 | @$(ECHO) "BUILD_OBJ_DIR : " $(BUILD_OBJ_DIR) |
| 786 | @$(ECHO) "LLVM_SRC_ROOT : " $(LLVM_SRC_ROOT) |
| 787 | @$(ECHO) "LLVM_OBJ_ROOT : " $(LLVM_OBJ_ROOT) |
| 788 | @$(ECHO) "CONFIGURATION : " $(CONFIGURATION) |
| 789 | @$(ECHO) "OBJDIR: " $(OBJDIR) |
| 790 | @$(ECHO) "LIBDIR: " $(LIBDIR) |
| 791 | @$(ECHO) "TOOLDIR: " $(TOOLDIR) |
| 792 | @$(ECHO) "TDFILES:" '$(TDFILES)' |
| 793 | @$(ECHO) "CXXCompile: " '$(CXXCompile)' |
| 794 | @$(ECHO) "CCompile: " '$(CCompile)' |