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 | # |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 10 | # This file is included by all of the LLVM makefiles. For details on how to use |
| 11 | # it properly, please see the document MakefileGuide.html in the docs directory. |
Chris Lattner | af06a08 | 2003-08-15 03:02:52 +0000 | [diff] [blame] | 12 | # |
Vikram S. Adve | d60aede | 2002-07-09 12:04:21 +0000 | [diff] [blame] | 13 | #===-----------------------------------------------------------------------==== |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 14 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 15 | ################################################################################ |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 16 | # TARGETS: Define standard targets that can be invoked |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 17 | ################################################################################ |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 18 | |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 19 | #-------------------------------------------------------------------- |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 20 | # Define the various target sets |
| 21 | #-------------------------------------------------------------------- |
Chris Lattner | 7dc0282 | 2004-12-03 21:05:57 +0000 | [diff] [blame] | 22 | RecursiveTargets := all clean clean-all install uninstall install-bytecode |
Reid Spencer | 9e8d54a | 2004-12-06 05:35:13 +0000 | [diff] [blame] | 23 | LocalTargets := all-local clean-local clean-all-local check-local \ |
Reid Spencer | 44cb1b3 | 2004-12-03 20:08:48 +0000 | [diff] [blame] | 24 | install-local printvars uninstall-local \ |
| 25 | install-bytecode-local |
Reid Spencer | 9e8d54a | 2004-12-06 05:35:13 +0000 | [diff] [blame] | 26 | TopLevelTargets := check dist dist-check dist-clean tags dist-gzip dist-bzip2 \ |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 27 | dist-zip |
| 28 | UserTargets := $(RecursiveTargets) $(LocalTargets) $(TopLevelTargets) |
| 29 | InternalTargets := preconditions distdir dist-hook |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 30 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 31 | ################################################################################ |
Reid Spencer | 9411c64 | 2004-10-26 22:26:33 +0000 | [diff] [blame] | 32 | # INITIALIZATION: Basic things the makefile needs |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 33 | ################################################################################ |
| 34 | |
| 35 | #-------------------------------------------------------------------- |
| 36 | # Set the VPATH so that we can find source files. |
| 37 | #-------------------------------------------------------------------- |
| 38 | VPATH=$(BUILD_SRC_DIR) |
Reid Spencer | 9411c64 | 2004-10-26 22:26:33 +0000 | [diff] [blame] | 39 | |
| 40 | #-------------------------------------------------------------------- |
| 41 | # Reset the list of suffixes we know how to build |
| 42 | #-------------------------------------------------------------------- |
| 43 | .SUFFIXES: |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 44 | .SUFFIXES: .c .cpp .h .hpp .y .l .lo .o .a .bc .td .ps .dot |
| 45 | .SUFFIXES: $(SHLIBEXT) $(SUFFIXES) |
Reid Spencer | 9411c64 | 2004-10-26 22:26:33 +0000 | [diff] [blame] | 46 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 47 | #-------------------------------------------------------------------- |
| 48 | # Mark all of these targets as phony to avoid implicit rule search |
| 49 | #-------------------------------------------------------------------- |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 50 | .PHONY: $(UserTargets) $(InternalTargets) |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 51 | |
| 52 | #-------------------------------------------------------------------- |
Reid Spencer | 9411c64 | 2004-10-26 22:26:33 +0000 | [diff] [blame] | 53 | # Make sure all the user-target rules are double colon rules and |
| 54 | # they are defined first. |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 55 | #-------------------------------------------------------------------- |
| 56 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 57 | $(UserTargets):: |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 58 | |
Reid Spencer | 9411c64 | 2004-10-26 22:26:33 +0000 | [diff] [blame] | 59 | ################################################################################ |
| 60 | # PRECONDITIONS: that which must be built/checked first |
| 61 | ################################################################################ |
| 62 | |
Reid Spencer | 44cb1b3 | 2004-12-03 20:08:48 +0000 | [diff] [blame] | 63 | SrcMakefiles := $(filter %Makefile %Makefile.tests,\ |
Reid Spencer | 023c446 | 2004-11-17 19:08:44 +0000 | [diff] [blame] | 64 | $(wildcard $(BUILD_SRC_DIR)/Makefile*)) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 65 | ObjMakefiles := $(subst $(BUILD_SRC_DIR),$(BUILD_OBJ_DIR),$(SrcMakefiles)) |
| 66 | ConfigureScript := $(LLVM_SRC_ROOT)/configure |
| 67 | ConfigStatusScript := $(LLVM_OBJ_ROOT)/config.status |
| 68 | MakefileConfigIn := $(LLVM_SRC_ROOT)/Makefile.config.in |
| 69 | MakefileConfig := $(LLVM_OBJ_ROOT)/Makefile.config |
| 70 | PreConditions := $(ConfigStatusScript) $(MakefileConfig) $(ObjMakefiles) |
Reid Spencer | 9411c64 | 2004-10-26 22:26:33 +0000 | [diff] [blame] | 71 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 72 | preconditions : $(PreConditions) |
Reid Spencer | 9411c64 | 2004-10-26 22:26:33 +0000 | [diff] [blame] | 73 | |
| 74 | #------------------------------------------------------------------------ |
| 75 | # Make sure the BUILT_SOURCES are built first |
| 76 | #------------------------------------------------------------------------ |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 77 | $(filter-out clean clean-local,UserTargets):: $(BUILT_SOURCES) |
Reid Spencer | 9411c64 | 2004-10-26 22:26:33 +0000 | [diff] [blame] | 78 | |
| 79 | clean-local:: |
| 80 | ifneq ($(strip $(BUILT_SOURCES)),) |
Reid Spencer | ca5fe8f | 2004-11-02 16:56:15 +0000 | [diff] [blame] | 81 | -$(Verb) $(RM) -f $(BUILT_SOURCES) |
Reid Spencer | 9411c64 | 2004-10-26 22:26:33 +0000 | [diff] [blame] | 82 | endif |
| 83 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 84 | $(BUILT_SOURCES) : $(ObjMakefiles) |
Reid Spencer | 80f0ef7 | 2004-10-28 00:41:43 +0000 | [diff] [blame] | 85 | |
Reid Spencer | 9411c64 | 2004-10-26 22:26:33 +0000 | [diff] [blame] | 86 | #------------------------------------------------------------------------ |
| 87 | # Make sure we're not using a stale configuration |
| 88 | #------------------------------------------------------------------------ |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 89 | .PRECIOUS: $(ConfigStatusScript) |
| 90 | $(ConfigStatusScript): $(ConfigureScript) |
| 91 | $(Echo) Reconfiguring with $< |
Reid Spencer | 7d27700 | 2004-11-29 12:37:44 +0000 | [diff] [blame] | 92 | $(Verb) cd $(BUILD_OBJ_ROOT) && \ |
| 93 | $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \ |
| 94 | $(ConfigStatusScript) |
Reid Spencer | 9411c64 | 2004-10-26 22:26:33 +0000 | [diff] [blame] | 95 | |
| 96 | #------------------------------------------------------------------------ |
| 97 | # Make sure the configuration makefile is up to date |
| 98 | #------------------------------------------------------------------------ |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 99 | $(MakefileConfig): $(MakefileConfigIn) $(ConfigStatusScript) |
| 100 | $(Echo) Regenerating $@ |
| 101 | $(Verb) cd $(LLVM_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.config |
Reid Spencer | 9411c64 | 2004-10-26 22:26:33 +0000 | [diff] [blame] | 102 | |
| 103 | #------------------------------------------------------------------------ |
| 104 | # If the Makefile in the source tree has been updated, copy it over into the |
| 105 | # build tree. But, only do this if the source and object makefiles differ |
| 106 | #------------------------------------------------------------------------ |
| 107 | ifneq ($(BUILD_OBJ_DIR),$(BUILD_SRC_DIR)) |
| 108 | |
Reid Spencer | 023c446 | 2004-11-17 19:08:44 +0000 | [diff] [blame] | 109 | Makefile: $(BUILD_SRC_DIR)/Makefile |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 110 | $(Echo) "Updating Makefile" |
| 111 | $(Verb) $(MKDIR) $(@D) |
| 112 | $(Verb) cp -f $< $@ |
Reid Spencer | 9411c64 | 2004-10-26 22:26:33 +0000 | [diff] [blame] | 113 | |
| 114 | # Copy the Makefile.* files unless we're in the root directory which avoids |
| 115 | # the copying of Makefile.config.in or other things that should be explicitly |
| 116 | # taken care of. |
Reid Spencer | 9411c64 | 2004-10-26 22:26:33 +0000 | [diff] [blame] | 117 | $(BUILD_OBJ_DIR)/Makefile% : $(BUILD_SRC_DIR)/Makefile% |
Reid Spencer | 8660678 | 2004-10-26 23:10:00 +0000 | [diff] [blame] | 118 | @case '$?' in \ |
| 119 | *Makefile.rules) ;; \ |
| 120 | *.in) ;; \ |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 121 | *) $(Echo) "Updating $(@F)" ; \ |
Reid Spencer | 8660678 | 2004-10-26 23:10:00 +0000 | [diff] [blame] | 122 | $(MKDIR) $(@D) ; \ |
| 123 | cp -f $< $@ ;; \ |
| 124 | esac |
| 125 | |
Reid Spencer | 9411c64 | 2004-10-26 22:26:33 +0000 | [diff] [blame] | 126 | endif |
| 127 | |
| 128 | #------------------------------------------------------------------------ |
| 129 | # Set up the basic dependencies |
| 130 | #------------------------------------------------------------------------ |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 131 | $(UserTargets):: $(PreConditions) |
Reid Spencer | 9411c64 | 2004-10-26 22:26:33 +0000 | [diff] [blame] | 132 | |
| 133 | all:: all-local |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 134 | clean:: clean-local |
Reid Spencer | 3d65949 | 2004-11-02 16:36:03 +0000 | [diff] [blame] | 135 | clean-all:: clean-local clean-all-local |
Reid Spencer | 9411c64 | 2004-10-26 22:26:33 +0000 | [diff] [blame] | 136 | install:: install-local |
| 137 | uninstall:: uninstall-local |
Reid Spencer | 9411c64 | 2004-10-26 22:26:33 +0000 | [diff] [blame] | 138 | install-local:: all-local |
Reid Spencer | 44cb1b3 | 2004-12-03 20:08:48 +0000 | [diff] [blame] | 139 | install-bytecode:: install-bytecode-local |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 140 | |
| 141 | ############################################################################### |
| 142 | # VARIABLES: Set up various variables based on configuration data |
| 143 | ############################################################################### |
| 144 | |
| 145 | #-------------------------------------------------------------------- |
| 146 | # Variables derived from configuration we are building |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 147 | #-------------------------------------------------------------------- |
| 148 | |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 149 | ifdef ENABLE_PROFILING |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 150 | BuildMode := Profile |
Reid Spencer | 519799e | 2004-12-08 04:34:51 +0000 | [diff] [blame] | 151 | CXX.Flags := -O3 -DNDEBUG -felide-constructors -finline-functions -pg |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 152 | C.Flags := -O3 -DNDEBUG -pg |
| 153 | LD.Flags := -O3 -DNDEBUG -pg |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 154 | else |
| 155 | ifdef ENABLE_OPTIMIZED |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 156 | BuildMode := Release |
Reid Spencer | 519799e | 2004-12-08 04:34:51 +0000 | [diff] [blame] | 157 | CXX.Flags := -O3 -DNDEBUG -finline-functions \ |
Reid Spencer | 2e2035b | 2004-12-08 04:26:23 +0000 | [diff] [blame] | 158 | -felide-constructors -fomit-frame-pointer |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 159 | C.Flags := -O3 -DNDEBUG -fomit-frame-pointer |
| 160 | LD.Flags := -O3 -DNDEBUG |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 161 | else |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 162 | BuildMode := Debug |
Reid Spencer | 519799e | 2004-12-08 04:34:51 +0000 | [diff] [blame] | 163 | CXX.Flags := -g -D_DEBUG |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 164 | C.Flags := -g -D_DEBUG |
| 165 | LD.Flags := -g -D_DEBUG |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 166 | KEEP_SYMBOLS := 1 |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 167 | endif |
| 168 | endif |
| 169 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 170 | CXX.Flags += $(CXXFLAGS) |
| 171 | C.Flags += $(CFLAGS) |
| 172 | CPP.Flags += $(CPPFLAGS) |
| 173 | LD.Flags += $(LDFLAGS) |
| 174 | AR.Flags := cru |
| 175 | LibTool.Flags := --tag=CXX |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 176 | |
| 177 | #-------------------------------------------------------------------- |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 178 | # Directory locations |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 179 | #-------------------------------------------------------------------- |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 180 | ObjDir := $(BUILD_OBJ_DIR)/$(BuildMode) |
Reid Spencer | 815cbcf | 2004-11-18 10:03:46 +0000 | [diff] [blame] | 181 | LibDir := $(BUILD_OBJ_ROOT)/$(BuildMode)/lib |
Reid Spencer | 9a5acaf | 2004-11-18 20:04:39 +0000 | [diff] [blame] | 182 | ToolDir := $(BUILD_OBJ_ROOT)/$(BuildMode)/bin |
Reid Spencer | 815cbcf | 2004-11-18 10:03:46 +0000 | [diff] [blame] | 183 | ExmplDir := $(BUILD_OBJ_ROOT)/$(BuildMode)/examples |
| 184 | LLVMLibDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib |
Reid Spencer | 9a5acaf | 2004-11-18 20:04:39 +0000 | [diff] [blame] | 185 | LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/bin |
Reid Spencer | 815cbcf | 2004-11-18 10:03:46 +0000 | [diff] [blame] | 186 | LExmplDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/examples |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 187 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 188 | #-------------------------------------------------------------------- |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 189 | # Full Paths To Compiled Tools and Utilities |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 190 | #-------------------------------------------------------------------- |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 191 | EchoCmd := $(ECHO) llvm[$(MAKELEVEL)]: |
| 192 | Echo := @$(EchoCmd) |
| 193 | ifndef LIBTOOL |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 194 | LIBTOOL := $(LLVM_OBJ_ROOT)/mklib |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 195 | endif |
| 196 | ifndef LLVMAS |
| 197 | LLVMAS := $(LLVMToolDir)/llvm-as$(EXEEXT) |
| 198 | endif |
| 199 | ifndef BURG |
| 200 | BURG := $(LLVMToolDir)/burg$(EXEEXT) |
| 201 | endif |
| 202 | ifndef TBLGEN |
| 203 | TBLGEN := $(LLVMToolDir)/tblgen$(EXEEXT) |
| 204 | endif |
Chris Lattner | 478b3b4 | 2004-11-29 19:47:58 +0000 | [diff] [blame] | 205 | ifndef GCCAS |
| 206 | GCCAS := $(LLVMToolDir)/gccas$(EXEEXT) |
| 207 | endif |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 208 | ifndef GCCLD |
| 209 | GCCLD := $(LLVMToolDir)/gccld$(EXEEXT) |
| 210 | endif |
| 211 | ifndef LLVMGCC |
| 212 | LLVMGCC := PATH=$(LLVMToolDir):$(PATH) $(LLVMGCCDIR)/bin/gcc |
| 213 | endif |
| 214 | ifndef LLVMGXX |
| 215 | LLVMGXX := PATH=$(LLVMToolDir):$(PATH) $(LLVMGCCDIR)/bin/g++ |
| 216 | endif |
Alkis Evlogimenos | 7e80cd9 | 2004-12-13 17:44:14 +0000 | [diff] [blame] | 217 | ifndef LDIS |
| 218 | LLVMDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT) |
| 219 | endif |
| 220 | ifndef LLI |
| 221 | LLI := $(LLVMToolDir)/lli$(EXEEXT) |
| 222 | endif |
| 223 | ifndef LOPT |
| 224 | LOPT := $(LLVMToolDir)/lopt$(EXEEXT) |
| 225 | endif |
Dinakar Dhurjati | ffb55cd | 2003-05-29 16:18:20 +0000 | [diff] [blame] | 226 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 227 | #-------------------------------------------------------------------- |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 228 | # Adjust to user's request |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 229 | #-------------------------------------------------------------------- |
Dinakar Dhurjati | ffb55cd | 2003-05-29 16:18:20 +0000 | [diff] [blame] | 230 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 231 | # Adjust LIBTOOL flags for shared libraries, or not. |
John Criswell | 82f4a5a | 2003-07-31 20:58:51 +0000 | [diff] [blame] | 232 | ifndef SHARED_LIBRARY |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 233 | LibTool.Flags += --tag=disable-shared |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 234 | else |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 235 | LD.Flags += -rpath $(LibDir) |
John Criswell | 82f4a5a | 2003-07-31 20:58:51 +0000 | [diff] [blame] | 236 | endif |
| 237 | |
Reid Spencer | cceed9f | 2004-11-08 17:32:12 +0000 | [diff] [blame] | 238 | ifdef TOOL_VERBOSE |
| 239 | C.Flags += -v |
| 240 | CXX.Flags += -v |
| 241 | LD.Flags += -v |
Reid Spencer | cceed9f | 2004-11-08 17:32:12 +0000 | [diff] [blame] | 242 | VERBOSE := 1 |
| 243 | endif |
| 244 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 245 | # Adjust settings for verbose mode |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 246 | ifndef VERBOSE |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 247 | Verb := @ |
| 248 | LibTool.Flags += --silent |
| 249 | AR.Flags += >/dev/null 2>/dev/null |
| 250 | ConfigureScriptFLAGS += >$(BUILD_OBJ_DIR)/configure.out 2>&1 |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 251 | else |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 252 | ConfigureScriptFLAGS := |
Misha Brukman | b5f096f | 2002-09-12 16:05:39 +0000 | [diff] [blame] | 253 | endif |
| 254 | |
Vikram S. Adve | feeae58 | 2002-09-18 11:55:13 +0000 | [diff] [blame] | 255 | # By default, strip symbol information from executable |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 256 | ifndef KEEP_SYMBOLS |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 257 | Strip := $(PLATFORMSTRIPOPTS) |
| 258 | StripWarnMsg := "(without symbols)" |
Vikram S. Adve | feeae58 | 2002-09-18 11:55:13 +0000 | [diff] [blame] | 259 | endif |
| 260 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 261 | # Adjust linker flags for building an executable |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 262 | ifdef TOOLNAME |
Reid Spencer | 815cbcf | 2004-11-18 10:03:46 +0000 | [diff] [blame] | 263 | ifdef EXAMPLE_TOOL |
| 264 | LD.Flags += -rpath $(ExmplDir) -export-dynamic |
| 265 | else |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 266 | LD.Flags += -rpath $(ToolDir) -export-dynamic |
Dinakar Dhurjati | 87ea8aa | 2003-10-29 14:28:35 +0000 | [diff] [blame] | 267 | endif |
Reid Spencer | 815cbcf | 2004-11-18 10:03:46 +0000 | [diff] [blame] | 268 | endif |
Dinakar Dhurjati | 87ea8aa | 2003-10-29 14:28:35 +0000 | [diff] [blame] | 269 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 270 | #---------------------------------------------------------- |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 271 | # Options To Invoke Tools |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 272 | #---------------------------------------------------------- |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 273 | |
| 274 | CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused |
| 275 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 276 | LD.Flags += -L$(LibDir) -L$(LLVMLibDir) |
| 277 | CPP.Flags += -I$(BUILD_OBJ_DIR) \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 278 | -I$(BUILD_SRC_DIR) \ |
| 279 | -I$(BUILD_SRC_ROOT)/include \ |
| 280 | -I$(BUILD_OBJ_ROOT)/include \ |
| 281 | -I$(LLVM_OBJ_ROOT)/include \ |
| 282 | -I$(LLVM_SRC_ROOT)/include \ |
| 283 | -D_GNU_SOURCE -D__STDC_LIMIT_MACROS |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 284 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 285 | Compile.C = $(CC) $(CPP.Flags) $(CompileCommonOpts) -c $(C.Flags) |
| 286 | LTCompile.C = $(LIBTOOL) $(LibTool.Flags) --mode=compile $(Compile.C) |
| 287 | BCCompile.C = $(LLVMGCC) $(CPP.Flags) $(CompileCommonOpts) $(C.Flags) -c |
| 288 | Compile.CXX = $(CXX) $(CPP.Flags) $(CompileCommonOpts) $(CXX.Flags) -c |
| 289 | LTCompile.CXX = $(LIBTOOL) $(LibTool.Flags) --mode=compile $(Compile.CXX) |
| 290 | BCCompile.CXX = $(LLVMGXX) $(CPP.Flags) $(CompileCommonOpts) $(CXX.Flags) -c |
| 291 | Link = $(LIBTOOL) $(LibTool.Flags) --mode=link $(CXX) $(CPP.Flags) \ |
| 292 | $(CompileCommonOpts) $(LD.Flags) $(Strip) |
| 293 | Relink = $(LIBTOOL) $(LibTool.Flags) --mode=link $(CXX) $(CPP.Flags) \ |
Reid Spencer | a69b1ea | 2004-10-28 09:15:28 +0000 | [diff] [blame] | 294 | $(CompileCommonOpts) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 295 | LTInstall = $(LIBTOOL) $(LibTool.Flags) --mode=install $(INSTALL) |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 296 | Burg = $(BURG) -I $(BUILD_SRC_DIR) |
| 297 | TableGen = $(TBLGEN) -I $(BUILD_SRC_DIR) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 298 | Archive = $(AR) $(AR.Flags) |
Reid Spencer | 9a2f137 | 2004-12-02 09:28:21 +0000 | [diff] [blame] | 299 | LArchive = $(LLVMToolDir)/llvm-ar rcsf |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 300 | ifdef RANLIB |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 301 | Ranlib = $(RANLIB) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 302 | else |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 303 | Ranlib = ranlib |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 304 | endif |
| 305 | |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 306 | #---------------------------------------------------------- |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 307 | # Get the list of source files and compute object file |
| 308 | # names from them. |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 309 | #---------------------------------------------------------- |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 310 | ifdef FAKE_SOURCES |
| 311 | Sources := |
| 312 | FakeSources := $(FAKE_SOURCES) |
| 313 | ifdef BUILT_SOURCES |
| 314 | FakeSources += $(filter %.cpp %.c %.cc %.y %.l,$(BUILT_SOURCES)) |
| 315 | endif |
| 316 | BaseNameSources := $(sort $(basename $(FakeSources))) |
| 317 | ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o) |
| 318 | ObjectsLO := $(BaseNameSources:%=$(ObjDir)/%.lo) |
| 319 | ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 320 | else |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 321 | ifndef SOURCES |
| 322 | Sources := $(notdir $(wildcard $(BUILD_SRC_DIR)/*.cpp \ |
| 323 | $(BUILD_SRC_DIR)/*.cc $(BUILD_SRC_DIR)/*.c $(BUILD_SRC_DIR)/*.y \ |
| 324 | $(BUILD_SRC_DIR)/*.l)) |
| 325 | else |
| 326 | Sources := $(SOURCES) |
| 327 | endif |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 328 | |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 329 | ifdef BUILT_SOURCES |
| 330 | Sources += $(filter %.cpp %.c %.cc %.y %.l,$(BUILT_SOURCES)) |
| 331 | endif |
Vikram S. Adve | 112a72c | 2001-07-15 13:16:47 +0000 | [diff] [blame] | 332 | |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 333 | BaseNameSources := $(sort $(basename $(Sources))) |
| 334 | ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o) |
| 335 | ObjectsLO := $(BaseNameSources:%=$(ObjDir)/%.lo) |
| 336 | ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc) |
| 337 | endif |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 338 | |
| 339 | ############################################################################### |
| 340 | # DIRECTORIES: Handle recursive descent of directory structure |
| 341 | ############################################################################### |
John Criswell | 82f4a5a | 2003-07-31 20:58:51 +0000 | [diff] [blame] | 342 | |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 343 | #--------------------------------------------------------- |
Reid Spencer | a69b1ea | 2004-10-28 09:15:28 +0000 | [diff] [blame] | 344 | # Provide rules to make install dirs. This must be early |
| 345 | # in the file so they get built before dependencies |
| 346 | #--------------------------------------------------------- |
| 347 | |
| 348 | $(bindir): |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 349 | $(Verb) $(MKDIR) $(bindir) |
Chris Lattner | e4cb90f | 2004-11-01 06:14:59 +0000 | [diff] [blame] | 350 | |
Reid Spencer | a69b1ea | 2004-10-28 09:15:28 +0000 | [diff] [blame] | 351 | $(libdir): |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 352 | $(Verb) $(MKDIR) $(libdir) |
Reid Spencer | a69b1ea | 2004-10-28 09:15:28 +0000 | [diff] [blame] | 353 | |
Reid Spencer | ab3690b | 2004-12-13 07:38:07 +0000 | [diff] [blame] | 354 | $(includedir): |
| 355 | $(Verb) $(MKDIR) $(includedir) |
Reid Spencer | a69b1ea | 2004-10-28 09:15:28 +0000 | [diff] [blame] | 356 | |
| 357 | $(sysconfdir): |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 358 | $(Verb) $(MKDIR) $(sysconfdir) |
Reid Spencer | a69b1ea | 2004-10-28 09:15:28 +0000 | [diff] [blame] | 359 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 360 | # To create other directories, as needed, and timestamp their creation |
| 361 | %/.dir: |
| 362 | $(Verb) $(MKDIR) $* > /dev/null |
Reid Spencer | fbbf307 | 2004-11-29 05:00:33 +0000 | [diff] [blame] | 363 | $(Verb) $(DATE) > $@ |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 364 | |
Reid Spencer | 815cbcf | 2004-11-18 10:03:46 +0000 | [diff] [blame] | 365 | .PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir |
| 366 | .PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir |
Reid Spencer | a69b1ea | 2004-10-28 09:15:28 +0000 | [diff] [blame] | 367 | |
| 368 | #--------------------------------------------------------- |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 369 | # Handle the DIRS options for sequential construction |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 370 | #--------------------------------------------------------- |
| 371 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 372 | SubDirs := |
Anand Shukla | 7c7a07e | 2002-09-18 04:29:30 +0000 | [diff] [blame] | 373 | ifdef DIRS |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 374 | SubDirs += $(DIRS) |
| 375 | $(RecursiveTargets):: |
| 376 | $(Verb) for dir in $(DIRS); do \ |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 377 | if [ ! -f $$dir/Makefile ]; then \ |
| 378 | $(MKDIR) $$dir; \ |
| 379 | cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ |
| 380 | fi; \ |
Reid Spencer | a23c066 | 2004-12-08 22:58:34 +0000 | [diff] [blame] | 381 | if [ ! -f $$dir/LLVM_DO_NOT_BUILD ]; then \ |
| 382 | ($(MAKE) -C $$dir $@ ) || exit 1; \ |
| 383 | fi ; \ |
Chris Lattner | f1ffd99 | 2002-09-17 23:35:02 +0000 | [diff] [blame] | 384 | done |
Anand Shukla | 7c7a07e | 2002-09-18 04:29:30 +0000 | [diff] [blame] | 385 | endif |
Chris Lattner | a8abc22 | 2002-09-18 03:22:27 +0000 | [diff] [blame] | 386 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 387 | #--------------------------------------------------------- |
| 388 | # Handle the EXPERIMENTAL_DIRS options ensuring success |
| 389 | # after each directory is built. |
| 390 | #--------------------------------------------------------- |
| 391 | ifdef EXPERIMENTAL_DIRS |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 392 | $(RecursiveTargets):: |
| 393 | $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \ |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 394 | if [ ! -f $$dir/Makefile ]; then \ |
| 395 | $(MKDIR) $$dir; \ |
| 396 | cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ |
| 397 | fi; \ |
Reid Spencer | a23c066 | 2004-12-08 22:58:34 +0000 | [diff] [blame] | 398 | if [ ! -f $$dir/LLVM_DO_NOT_BUILD ]; then \ |
| 399 | ($(MAKE) -C $$dir $@ ) || exit 0; \ |
| 400 | fi ; \ |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 401 | done |
| 402 | endif |
Chris Lattner | a8abc22 | 2002-09-18 03:22:27 +0000 | [diff] [blame] | 403 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 404 | #--------------------------------------------------------- |
| 405 | # Handle the PARALLEL_DIRS options for parallel construction |
| 406 | #--------------------------------------------------------- |
| 407 | ifdef PARALLEL_DIRS |
| 408 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 409 | SubDirs += $(PARALLEL_DIRS) |
| 410 | |
Reid Spencer | 44cb1b3 | 2004-12-03 20:08:48 +0000 | [diff] [blame] | 411 | # Unfortunately, this list must be maintained if new recursive targets are added |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 412 | all :: $(addsuffix /.makeall ,$(PARALLEL_DIRS)) |
| 413 | clean :: $(addsuffix /.makeclean ,$(PARALLEL_DIRS)) |
Reid Spencer | ca5fe8f | 2004-11-02 16:56:15 +0000 | [diff] [blame] | 414 | clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS)) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 415 | install :: $(addsuffix /.makeinstall ,$(PARALLEL_DIRS)) |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 416 | uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS)) |
Reid Spencer | 44cb1b3 | 2004-12-03 20:08:48 +0000 | [diff] [blame] | 417 | install-bytecode :: $(addsuffix /.makeinstall-bytecode,$(PARALLEL_DIRS)) |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 418 | |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 419 | ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T)) |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 420 | |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 421 | $(ParallelTargets) : |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 422 | $(Verb) if [ ! -f $(@D)/Makefile ]; then \ |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 423 | $(MKDIR) $(@D); \ |
| 424 | cp $(BUILD_SRC_DIR)/$(@D)/Makefile $(@D)/Makefile; \ |
John Criswell | b3866b6 | 2003-11-25 19:32:22 +0000 | [diff] [blame] | 425 | fi; \ |
Reid Spencer | a23c066 | 2004-12-08 22:58:34 +0000 | [diff] [blame] | 426 | if [ ! -f $$dir/LLVM_DO_NOT_BUILD ]; then \ |
| 427 | $(MAKE) -C $(@D) $(subst $(@D)/.make,,$@) ; \ |
| 428 | fi |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 429 | endif |
| 430 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 431 | #--------------------------------------------------------- |
| 432 | # Handle the OPTIONAL_DIRS options for directores that may |
| 433 | # or may not exist. |
| 434 | #--------------------------------------------------------- |
John Criswell | 2a6530f | 2003-06-27 16:58:44 +0000 | [diff] [blame] | 435 | ifdef OPTIONAL_DIRS |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 436 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 437 | SubDirs += $(OPTIONAL_DIRS) |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 438 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 439 | $(RecursiveTargets):: |
| 440 | $(Verb) for dir in $(OPTIONAL_DIRS); do \ |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 441 | if [ -d $(BUILD_SRC_DIR)/$$dir ]; then\ |
| 442 | if [ ! -f $$dir/Makefile ]; then \ |
| 443 | $(MKDIR) $$dir; \ |
| 444 | cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ |
| 445 | fi; \ |
Reid Spencer | a23c066 | 2004-12-08 22:58:34 +0000 | [diff] [blame] | 446 | if [ ! -f $$dir/LLVM_DO_NOT_BUILD ]; then \ |
| 447 | ($(MAKE) -C$$dir $@ ) || exit 1; \ |
| 448 | fi ; \ |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 449 | fi \ |
John Criswell | 2a6530f | 2003-06-27 16:58:44 +0000 | [diff] [blame] | 450 | done |
| 451 | endif |
| 452 | |
Reid Spencer | fc94508 | 2004-08-20 09:20:05 +0000 | [diff] [blame] | 453 | #--------------------------------------------------------- |
| 454 | # Handle the CONFIG_FILES options |
| 455 | #--------------------------------------------------------- |
| 456 | ifdef CONFIG_FILES |
Reid Spencer | fc94508 | 2004-08-20 09:20:05 +0000 | [diff] [blame] | 457 | |
Reid Spencer | c6dcc6a | 2004-10-28 07:57:28 +0000 | [diff] [blame] | 458 | install-local:: $(sysconfdir) $(CONFIG_FILES) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 459 | $(Echo) Installing Configuration Files To $(sysconfdir) |
| 460 | $(Verb)for file in $(CONFIG_FILES); do \ |
Reid Spencer | 1b426ab | 2004-11-23 05:59:53 +0000 | [diff] [blame] | 461 | if test -f $(BUILD_OBJ_DIR)/$${file} ; then \ |
| 462 | $(INSTALL) $(BUILD_OBJ_DIR)/$${file} $(sysconfdir) ; \ |
| 463 | elif test -f $(BUILD_SRC_DIR)/$${file} ; then \ |
| 464 | $(INSTALL) $(BUILD_SRC_DIR)/$${file} $(sysconfdir) ; \ |
| 465 | else \ |
| 466 | $(ECHO) Error: cannot find config file $${file}. ; \ |
| 467 | fi \ |
Reid Spencer | fc94508 | 2004-08-20 09:20:05 +0000 | [diff] [blame] | 468 | done |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 469 | |
Reid Spencer | c6dcc6a | 2004-10-28 07:57:28 +0000 | [diff] [blame] | 470 | uninstall-local:: |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 471 | $(Echo) Uninstalling Configuration Files From $(sysconfdir) |
| 472 | $(Verb)for file in $(CONFIG_FILES); do \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 473 | $(RM) -f $(sysconfdir)/$${file} ; \ |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 474 | done |
| 475 | |
Reid Spencer | fc94508 | 2004-08-20 09:20:05 +0000 | [diff] [blame] | 476 | endif |
| 477 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 478 | ############################################################################### |
| 479 | # Library Build Rules: Four ways to build a library |
| 480 | ############################################################################### |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 481 | |
Reid Spencer | 7980ea4 | 2004-12-05 05:17:22 +0000 | [diff] [blame] | 482 | #--------------------------------------------------------- |
| 483 | # Bytecode Module Targets: |
| 484 | # If the user set MODULE_NAME then they want to build a |
| 485 | # bytecode module from the sources. We compile all the |
| 486 | # sources and link it together into a single bytecode |
| 487 | # module. |
| 488 | #--------------------------------------------------------- |
| 489 | |
| 490 | ifdef MODULE_NAME |
| 491 | |
| 492 | Module := $(LibDir)/$(MODULE_NAME).bc |
| 493 | LinkModule := $(LLVMGCC) -shared -nostdlib |
| 494 | |
| 495 | ifdef EXPORTED_SYMBOL_FILE |
| 496 | LinkMOdule += -Xlinker -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE) |
| 497 | endif |
| 498 | |
| 499 | $(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(GCCLD) |
| 500 | $(Echo) Building $(BuildMOde) Bytecode Module $(notdir $@) |
| 501 | $(Verb) $(LinkModule) -o $@ $(ObjectsBC) |
| 502 | |
| 503 | all-local:: $(Module) |
| 504 | |
| 505 | clean-local:: |
| 506 | ifneq ($(strip $(Module)),) |
| 507 | -$(Verb) $(RM) -f $(Module) |
| 508 | endif |
| 509 | |
Reid Spencer | ab3690b | 2004-12-13 07:38:07 +0000 | [diff] [blame] | 510 | ifdef BYTECODE_DESTINATION |
| 511 | ModuleDestDir := $(BYTECODE_DESTINATION) |
| 512 | else |
| 513 | ModuleDestDir := $(BYTECODE_DESTINATION) |
| 514 | endif |
Reid Spencer | 7980ea4 | 2004-12-05 05:17:22 +0000 | [diff] [blame] | 515 | |
Reid Spencer | ab3690b | 2004-12-13 07:38:07 +0000 | [diff] [blame] | 516 | DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc |
| 517 | |
| 518 | install-module:: $(DestModule) |
Reid Spencer | 7980ea4 | 2004-12-05 05:17:22 +0000 | [diff] [blame] | 519 | install-local:: $(DestModule) |
| 520 | |
Reid Spencer | ab3690b | 2004-12-13 07:38:07 +0000 | [diff] [blame] | 521 | $(DestModule): $(ModuleDestDir) $(Module) |
Reid Spencer | 7980ea4 | 2004-12-05 05:17:22 +0000 | [diff] [blame] | 522 | $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule) |
| 523 | $(Verb) $(INSTALL) $(Module) $@ |
| 524 | |
| 525 | uninstall-local:: |
| 526 | $(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule) |
| 527 | -$(Verb) $(RM) -f $(DestModule) |
| 528 | |
| 529 | endif |
Brian Gaeke | 8abff79 | 2004-01-22 22:53:48 +0000 | [diff] [blame] | 530 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 531 | # if we're building a library ... |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 532 | ifdef LIBRARYNAME |
Vikram S. Adve | 112a72c | 2001-07-15 13:16:47 +0000 | [diff] [blame] | 533 | |
Chris Lattner | 2a548c5 | 2002-09-16 22:36:42 +0000 | [diff] [blame] | 534 | # Make sure there isn't any extranous whitespace on the LIBRARYNAME option |
Chris Lattner | ccb4ebd | 2002-09-16 22:34:56 +0000 | [diff] [blame] | 535 | LIBRARYNAME := $(strip $(LIBRARYNAME)) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 536 | LibName.LA := $(LibDir)/lib$(LIBRARYNAME).la |
| 537 | LibName.A := $(LibDir)/lib$(LIBRARYNAME).a |
| 538 | LibName.O := $(LibDir)/$(LIBRARYNAME).o |
Reid Spencer | 9a2f137 | 2004-12-02 09:28:21 +0000 | [diff] [blame] | 539 | LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca |
Chris Lattner | ccb4ebd | 2002-09-16 22:34:56 +0000 | [diff] [blame] | 540 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 541 | #--------------------------------------------------------- |
| 542 | # Shared Library Targets: |
| 543 | # If the user asked for a shared library to be built |
| 544 | # with the SHARED_LIBRARY variable, then we provide |
| 545 | # targets for building them. |
| 546 | #--------------------------------------------------------- |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 547 | ifdef SHARED_LIBRARY |
| 548 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 549 | all-local:: $(LibName.LA) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 550 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 551 | $(LibName.LA): $(BUILT_SOURCES) $(ObjectsLO) $(LibDir)/.dir |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 552 | $(Echo) Linking $(BuildMode) Shared Library $(LIBRARYNAME)$(SHLIBEXT) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 553 | $(Verb) $(Link) -o $@ $(ObjectsLO) |
| 554 | $(Verb) $(LTInstall) $@ $(LibDir) |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 555 | |
| 556 | clean-local:: |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 557 | ifneq ($(strip $(LibName.LA)),) |
Reid Spencer | ca5fe8f | 2004-11-02 16:56:15 +0000 | [diff] [blame] | 558 | -$(Verb) $(RM) -f $(LibName.LA) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 559 | endif |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 560 | |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 561 | DestSharedLib = $(libdir)/lib$(LIBRARYNAME)$(SHLIBEXT) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 562 | |
Reid Spencer | c6dcc6a | 2004-10-28 07:57:28 +0000 | [diff] [blame] | 563 | install-local:: $(DestSharedLib) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 564 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 565 | $(DestSharedLib): $(libdir) $(LibName.LA) |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 566 | $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 567 | $(Verb) $(LTInstall) $(LibName.LA) $(DestSharedLib) |
| 568 | $(Verb) $(LIBTOOL) --finish $(libdir) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 569 | |
Reid Spencer | c6dcc6a | 2004-10-28 07:57:28 +0000 | [diff] [blame] | 570 | uninstall-local:: |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 571 | $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib) |
Reid Spencer | 12d7951 | 2004-11-12 02:27:36 +0000 | [diff] [blame] | 572 | -$(Verb) $(RM) -f $(libdir)/lib$(LIBRARYNAME).* |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 573 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 574 | endif |
| 575 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 576 | #--------------------------------------------------------- |
| 577 | # Bytecode Library Targets: |
| 578 | # If the user asked for a bytecode library to be built |
| 579 | # with the BYTECODE_LIBRARY variable, then we provide |
| 580 | # targets for building them. |
| 581 | #--------------------------------------------------------- |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 582 | ifdef BYTECODE_LIBRARY |
| 583 | |
Reid Spencer | 776b805 | 2004-12-03 06:04:35 +0000 | [diff] [blame] | 584 | # make the C and C++ compilers strip debug info out of bytecode libraries. |
| 585 | BCCompile.C += -Wa,-strip-debug |
| 586 | BCCompile.CXX += -Wa,-strip-debug |
| 587 | |
Reid Spencer | 9a2f137 | 2004-12-02 09:28:21 +0000 | [diff] [blame] | 588 | all-local:: $(LibName.BCA) |
| 589 | |
| 590 | ifdef EXPORTED_SYMBOL_FILE |
| 591 | BCLinkLib = $(LLVMGCC) -shared -nostdlib -Xlinker \ |
| 592 | -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE) |
| 593 | |
| 594 | $(LibName.BCA): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(GCCLD) |
| 595 | $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \ |
| 596 | "(internalize)" |
Chris Lattner | b0ea864 | 2004-12-02 21:23:43 +0000 | [diff] [blame] | 597 | $(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).o $(ObjectsBC) |
Reid Spencer | efd6bb3 | 2004-12-13 03:59:35 +0000 | [diff] [blame] | 598 | $(Verb) $(RM) -f $@ |
Reid Spencer | 9a2f137 | 2004-12-02 09:28:21 +0000 | [diff] [blame] | 599 | $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).o |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 600 | else |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 601 | $(LibName.BCA): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir |
Reid Spencer | 9a2f137 | 2004-12-02 09:28:21 +0000 | [diff] [blame] | 602 | $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) |
Reid Spencer | efd6bb3 | 2004-12-13 03:59:35 +0000 | [diff] [blame] | 603 | $(Verb) $(RM) -f $@ |
Reid Spencer | 9a2f137 | 2004-12-02 09:28:21 +0000 | [diff] [blame] | 604 | $(Verb) $(LArchive) $@ $(ObjectsBC) |
| 605 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 606 | endif |
| 607 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 608 | clean-local:: |
Reid Spencer | 9a2f137 | 2004-12-02 09:28:21 +0000 | [diff] [blame] | 609 | ifneq ($(strip $(LibName.BCA)),) |
| 610 | -$(Verb) $(RM) -f $(LibName.BCA) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 611 | endif |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 612 | |
Reid Spencer | 8f094f3 | 2004-12-13 07:28:21 +0000 | [diff] [blame] | 613 | ifdef BYTECODE_DESTINATION |
| 614 | BytecodeDestDir := $(BYTECODE_DESTINATION) |
| 615 | else |
| 616 | BytecodeDestDir := $(libdir) |
| 617 | endif |
| 618 | |
| 619 | DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).a |
Reid Spencer | 9a2f137 | 2004-12-02 09:28:21 +0000 | [diff] [blame] | 620 | |
Reid Spencer | 44cb1b3 | 2004-12-03 20:08:48 +0000 | [diff] [blame] | 621 | install-bytecode-local:: $(DestBytecodeLib) |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 622 | |
Reid Spencer | c6dcc6a | 2004-10-28 07:57:28 +0000 | [diff] [blame] | 623 | install-local:: $(DestBytecodeLib) |
Chris Lattner | 481cc7c | 2003-08-15 02:18:35 +0000 | [diff] [blame] | 624 | |
Reid Spencer | 8f094f3 | 2004-12-13 07:28:21 +0000 | [diff] [blame] | 625 | $(DestBytecodeLib): $(BytecodeDestDir) $(LibName.BCA) |
Reid Spencer | 9a2f137 | 2004-12-02 09:28:21 +0000 | [diff] [blame] | 626 | $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib) |
| 627 | $(Verb) $(INSTALL) $(LibName.BCA) $@ |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 628 | |
Reid Spencer | c6dcc6a | 2004-10-28 07:57:28 +0000 | [diff] [blame] | 629 | uninstall-local:: |
Reid Spencer | 9a2f137 | 2004-12-02 09:28:21 +0000 | [diff] [blame] | 630 | $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib) |
Reid Spencer | ca5fe8f | 2004-11-02 16:56:15 +0000 | [diff] [blame] | 631 | -$(Verb) $(RM) -f $(DestBytecodeLib) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 632 | |
| 633 | endif |
Vikram S. Adve | 60f5606 | 2002-08-02 18:34:12 +0000 | [diff] [blame] | 634 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 635 | #--------------------------------------------------------- |
| 636 | # ReLinked Library Targets: |
| 637 | # If the user didn't explicitly forbid building a |
| 638 | # relinked then we provide targets for building them. |
| 639 | #--------------------------------------------------------- |
Chris Lattner | e62dbe9 | 2002-07-23 17:56:16 +0000 | [diff] [blame] | 640 | ifndef DONT_BUILD_RELINKED |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 641 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 642 | all-local:: $(LibName.O) |
| 643 | |
| 644 | $(LibName.O): $(BUILT_SOURCES) $(ObjectsO) $(LibDir)/.dir |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 645 | $(Echo) Linking $(BuildMode) Object Library $(notdir $@) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 646 | $(Verb) $(Relink) -o $@ $(ObjectsO) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 647 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 648 | clean-local:: |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 649 | ifneq ($(strip $(LibName.O)),) |
Reid Spencer | ca5fe8f | 2004-11-02 16:56:15 +0000 | [diff] [blame] | 650 | -$(Verb) $(RM) -f $(LibName.O) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 651 | endif |
| 652 | |
| 653 | DestRelinkedLib = $(libdir)/$(LIBRARYNAME).o |
| 654 | |
Reid Spencer | c6dcc6a | 2004-10-28 07:57:28 +0000 | [diff] [blame] | 655 | install-local:: $(DestRelinkedLib) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 656 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 657 | $(DestRelinkedLib): $(libdir) $(LibName.O) |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 658 | $(Echo) Installing $(BuildMode) Object Library $(DestRelinkedLib) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 659 | $(Verb) $(LTInstall) $(LibName.O) $(DestRelinkedLib) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 660 | |
Reid Spencer | c6dcc6a | 2004-10-28 07:57:28 +0000 | [diff] [blame] | 661 | uninstall-local:: |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 662 | $(Echo) Uninstalling $(BuildMode) Object Library $(DestRelinkedLib) |
Reid Spencer | ca5fe8f | 2004-11-02 16:56:15 +0000 | [diff] [blame] | 663 | -$(Verb) $(RM) -f $(DestRelinkedLib) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 664 | |
Chris Lattner | e62dbe9 | 2002-07-23 17:56:16 +0000 | [diff] [blame] | 665 | endif |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 666 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 667 | #--------------------------------------------------------- |
| 668 | # Archive Library Targets: |
| 669 | # If the user wanted a regular archive library built, |
| 670 | # then we provide targets for building them. |
| 671 | #--------------------------------------------------------- |
Chris Lattner | e62dbe9 | 2002-07-23 17:56:16 +0000 | [diff] [blame] | 672 | ifdef BUILD_ARCHIVE |
Chris Lattner | e62dbe9 | 2002-07-23 17:56:16 +0000 | [diff] [blame] | 673 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 674 | all-local:: $(LibName.A) |
| 675 | |
| 676 | $(LibName.A): $(BUILT_SOURCES) $(ObjectsO) $(LibDir)/.dir |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 677 | $(Echo) Building $(BuildMode) Archive Library $(notdir $@) |
Reid Spencer | ca5fe8f | 2004-11-02 16:56:15 +0000 | [diff] [blame] | 678 | -$(Verb) $(RM) -f $@ |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 679 | $(Verb) $(Archive) $@ $(ObjectsO) |
| 680 | $(Verb) $(Ranlib) $@ |
Vikram S. Adve | 41e7891 | 2002-09-20 14:03:13 +0000 | [diff] [blame] | 681 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 682 | clean-local:: |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 683 | ifneq ($(strip $(LibName.A)),) |
Reid Spencer | ca5fe8f | 2004-11-02 16:56:15 +0000 | [diff] [blame] | 684 | -$(Verb) $(RM) -f $(LibName.A) |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 685 | endif |
| 686 | |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 687 | DestArchiveLib := $(libdir)/lib$(LIBRARYNAME).a |
| 688 | |
Reid Spencer | c6dcc6a | 2004-10-28 07:57:28 +0000 | [diff] [blame] | 689 | install-local:: $(DestArchiveLib) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 690 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 691 | $(DestArchiveLib): $(libdir) $(LibName.A) |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 692 | $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 693 | $(Verb) $(MKDIR) $(libdir) |
| 694 | $(Verb) $(LTInstall) $(LibName.A) $(DestArchiveLib) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 695 | |
Reid Spencer | c6dcc6a | 2004-10-28 07:57:28 +0000 | [diff] [blame] | 696 | uninstall-local:: |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 697 | $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib) |
Reid Spencer | ca5fe8f | 2004-11-02 16:56:15 +0000 | [diff] [blame] | 698 | -$(Verb) $(RM) -f $(DestArchiveLib) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 699 | |
| 700 | endif |
| 701 | |
| 702 | # endif LIBRARYNAME |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 703 | endif |
| 704 | |
Reid Spencer | b1dd3dd | 2004-10-24 08:21:04 +0000 | [diff] [blame] | 705 | ############################################################################### |
| 706 | # Tool Build Rules: Build executable tool based on TOOLNAME option |
| 707 | ############################################################################### |
| 708 | |
Chris Lattner | 1cbc29f | 2001-09-07 22:57:58 +0000 | [diff] [blame] | 709 | ifdef TOOLNAME |
| 710 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 711 | #--------------------------------------------------------- |
Reid Spencer | 7c787c9 | 2004-11-29 07:17:07 +0000 | [diff] [blame] | 712 | # Handle the special "JIT" value for LLVM_LIBS which is a |
| 713 | # shorthand for a bunch of libraries that get the correct |
| 714 | # JIT support for a tool that runs JIT. |
| 715 | #--------------------------------------------------------- |
| 716 | ifeq ($(LLVMLIBS),JIT) |
| 717 | |
| 718 | # Make sure we can get our own symbols in the tool |
| 719 | Link += -dlopen self |
| 720 | |
| 721 | # Generic JIT libraries |
| 722 | JIT_LIBS := LLVMInterpreter LLVMJIT LLVMCodeGen LLVMExecutionEngine |
| 723 | |
| 724 | # You can enable the X86 JIT on a non-X86 host by setting the flag |
| 725 | # ENABLE_X86_JIT on the make command line. If not, it will still be |
| 726 | # enabled automagically on an X86 host. |
| 727 | ifeq ($(ARCH), x86) |
| 728 | ENABLE_X86_JIT = 1 |
| 729 | endif |
| 730 | |
| 731 | # What the X86 JIT requires |
| 732 | ifdef ENABLE_X86_JIT |
| 733 | JIT_LIBS += LLVMX86 LLVMSelectionDAG |
| 734 | endif |
| 735 | |
| 736 | # You can enable the SparcV9 JIT on a non-SparcV9 host by setting the flag |
| 737 | # ENABLE_SPARCV9_JIT on the make command line. If not, it will still be |
| 738 | # enabled automagically on an SparcV9 host. |
| 739 | ifeq ($(ARCH), Sparc) |
| 740 | ENABLE_SPARCV9_JIT = 1 |
| 741 | endif |
| 742 | |
| 743 | # What the Sparc JIT requires |
| 744 | ifdef ENABLE_SPARCV9_JIT |
| 745 | JIT_LIBS += LLVMSparcV9 LLVMSparcV9ModuloSched LLVMSparcV9InstrSched \ |
| 746 | LLVMSparcV9LiveVar LLVMInstrumentation.a LLVMProfilePaths \ |
| 747 | LLVMBCWriter LLVMTransforms.a LLVMipo.a LLVMipa.a \ |
| 748 | LLVMDataStructure.a LLVMSparcV9RegAlloc |
| 749 | endif |
| 750 | |
| 751 | # You can enable the PowerPC JIT on a non-PowerPC host by setting the flag |
| 752 | # ENABLE_PPC_JIT on the make command line. If not, it will still be |
| 753 | # enabled automagically on an PowerPC host. |
| 754 | ifeq ($(ARCH), PowerPC) |
| 755 | ENABLE_PPC_JIT = 1 |
| 756 | endif |
| 757 | |
| 758 | # What the PowerPC JIT requires |
| 759 | ifdef ENABLE_PPC_JIT |
| 760 | JIT_LIBS += LLVMPowerPC |
| 761 | endif |
| 762 | |
| 763 | LLVMLIBS := $(JIT_LIBS) LLVMScalarOpts LLVMAnalysis.a LLVMTransformUtils.a \ |
| 764 | LLVMBCReader LLVMCore LLVMSupport.a LLVMTarget.a LLVMbzip2 \ |
| 765 | LLVMSystem.a $(PLATFORMLIBDL) |
| 766 | endif |
| 767 | |
| 768 | #--------------------------------------------------------- |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 769 | # Set up variables for building a tool. |
| 770 | #--------------------------------------------------------- |
Reid Spencer | 815cbcf | 2004-11-18 10:03:46 +0000 | [diff] [blame] | 771 | ifdef EXAMPLE_TOOL |
| 772 | ToolBuildPath := $(ExmplDir)/$(TOOLNAME)$(EXEEXT) |
| 773 | else |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 774 | ToolBuildPath := $(ToolDir)/$(TOOLNAME)$(EXEEXT) |
Reid Spencer | 815cbcf | 2004-11-18 10:03:46 +0000 | [diff] [blame] | 775 | endif |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 776 | ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS))) |
| 777 | ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions)) |
| 778 | LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS))) |
| 779 | LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions)) |
| 780 | ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS))) |
| 781 | LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS))) |
| 782 | ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs)) |
| 783 | LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs)) |
Chris Lattner | 1cbc29f | 2001-09-07 22:57:58 +0000 | [diff] [blame] | 784 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 785 | #--------------------------------------------------------- |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 786 | # Tell make that we need to rebuild subdirectories before |
| 787 | # we can link the tool. This affects things like LLI which |
| 788 | # has library subdirectories. |
| 789 | #--------------------------------------------------------- |
| 790 | $(ToolBuildPath): $(addsuffix /.makeall, $(PARALLEL_DIRS)) |
Chris Lattner | 8d7dfb3 | 2003-01-22 16:13:31 +0000 | [diff] [blame] | 791 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 792 | #--------------------------------------------------------- |
| 793 | # Provide targets for building the tools |
| 794 | #--------------------------------------------------------- |
| 795 | all-local:: $(ToolBuildPath) |
John Criswell | 2a6530f | 2003-06-27 16:58:44 +0000 | [diff] [blame] | 796 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 797 | clean-local:: |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 798 | ifneq ($(strip $(ToolBuildPath)),) |
Reid Spencer | ca5fe8f | 2004-11-02 16:56:15 +0000 | [diff] [blame] | 799 | -$(Verb) $(RM) -f $(ToolBuildPath) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 800 | endif |
Chris Lattner | 1cbc29f | 2001-09-07 22:57:58 +0000 | [diff] [blame] | 801 | |
Reid Spencer | 815cbcf | 2004-11-18 10:03:46 +0000 | [diff] [blame] | 802 | ifdef EXAMPLE_TOOL |
| 803 | $(ToolBuildPath): $(ExmplDir)/.dir |
| 804 | else |
| 805 | $(ToolBuildPath): $(ToolDir)/.dir |
| 806 | endif |
| 807 | |
| 808 | $(ToolBuildPath): $(BUILT_SOURCES) $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 809 | $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 810 | $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \ |
| 811 | $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 812 | $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) $(StripWarnMsg) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 813 | |
| 814 | DestTool = $(bindir)/$(TOOLNAME) |
| 815 | |
Reid Spencer | c6dcc6a | 2004-10-28 07:57:28 +0000 | [diff] [blame] | 816 | install-local:: $(DestTool) |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 817 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 818 | $(DestTool): $(bindir) $(ToolBuildPath) |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 819 | $(Echo) Installing $(BuildMode) $(DestTool) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 820 | $(Verb) $(INSTALL) $(ToolBuildPath) $(DestTool) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 821 | |
Reid Spencer | c6dcc6a | 2004-10-28 07:57:28 +0000 | [diff] [blame] | 822 | uninstall-local:: |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 823 | $(Echo) Uninstalling $(BuildMode) $(DestTool) |
Reid Spencer | ca5fe8f | 2004-11-02 16:56:15 +0000 | [diff] [blame] | 824 | -$(Verb) $(RM) -f $(DestTool) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 825 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 826 | endif |
Chris Lattner | 1cbc29f | 2001-09-07 22:57:58 +0000 | [diff] [blame] | 827 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 828 | ############################################################################### |
| 829 | # Object Build Rules: Build object files based on sources |
| 830 | ############################################################################### |
| 831 | |
| 832 | # Provide rule sets for when dependency generation is enabled |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 833 | ifndef DISABLE_AUTO_DEPENDENCIES |
Vikram S. Adve | 41e7891 | 2002-09-20 14:03:13 +0000 | [diff] [blame] | 834 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 835 | #--------------------------------------------------------- |
| 836 | # Create .lo files in the ObjDir directory from the .cpp and .c files... |
| 837 | #--------------------------------------------------------- |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 838 | ifdef SHARED_LIBRARY |
| 839 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 840 | $(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 841 | $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)" |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 842 | $(Verb) if $(LTCompile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACXXd $< -o $@ ; \ |
| 843 | then $(MV) -f "$(ObjDir)/$*.LACXXd" "$(ObjDir)/$*.d"; \ |
| 844 | else $(RM) -f "$(ObjDir)/$*.LACXXd"; exit 1; fi |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 845 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 846 | $(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 847 | $(Echo) "Compiling $*.c for $(BuildMode) build (PIC)" |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 848 | $(Verb) if $(LTCompile.C) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACd $< -o $@ ; \ |
| 849 | then $(MV) -f "$(ObjDir)/$*.LACd" "$(ObjDir)/$*.d"; \ |
| 850 | else $(RM) -f "$(ObjDir)/$*.LACd"; exit 1; fi |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 851 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 852 | #--------------------------------------------------------- |
| 853 | # Create .o files in the ObjDir directory from the .cpp and .c files... |
| 854 | #--------------------------------------------------------- |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 855 | else |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 856 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 857 | $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 858 | $(Echo) "Compiling $*.cpp for $(BuildMode) build" |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 859 | $(Verb) if $(Compile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.CXXd $< -o $@ ; \ |
| 860 | then $(MV) -f "$(ObjDir)/$*.CXXd" "$(ObjDir)/$*.d"; \ |
| 861 | else $(RM) -f "$(ObjDir)/$*.CXXd"; exit 1; fi |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 862 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 863 | $(ObjDir)/%.o: %.c $(ObjDir)/.dir |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 864 | $(Echo) "Compiling $*.c for $(BuildMode) build" |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 865 | $(Verb) if $(Compile.C) -MD -MT $@ -MP -MF $(ObjDir)/$*.Cd $< -o $@ ; \ |
| 866 | then $(MV) -f "$(ObjDir)/$*.Cd" "$(ObjDir)/$*.d"; \ |
| 867 | else $(RM) -f "$(ObjDir)/$*.Cd"; exit 1; fi |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 868 | |
| 869 | endif |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 870 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 871 | #--------------------------------------------------------- |
| 872 | # Create .bc files in the ObjDir directory from .cpp and .c files... |
| 873 | #--------------------------------------------------------- |
Chris Lattner | 478b3b4 | 2004-11-29 19:47:58 +0000 | [diff] [blame] | 874 | $(ObjDir)/%.bc: %.cpp $(ObjDir)/.dir $(GCCAS) |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 875 | $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)" |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 876 | $(Verb) if $(BCCompile.CXX) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCXXd" $< -o $@ ; \ |
| 877 | then $(MV) -f "$(ObjDir)/$*.BCCXXd" "$(ObjDir)/$*.d"; \ |
| 878 | else $(RM) -f "$(ObjDir)/$*.BCCXXd"; exit 1; fi |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 879 | |
Chris Lattner | 478b3b4 | 2004-11-29 19:47:58 +0000 | [diff] [blame] | 880 | $(ObjDir)/%.bc: %.c $(ObjDir)/.dir $(GCCAS) |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 881 | $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)" |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 882 | $(Verb) if $(BCCompile.C) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCd" $< -o $@ ; \ |
| 883 | then $(MV) -f "$(ObjDir)/$*.BCCd" "$(ObjDir)/$*.d"; \ |
| 884 | else $(RM) -f "$(ObjDir)/$*.BCCd"; exit 1; fi |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 885 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 886 | # Provide alternate rule sets if dependencies are disabled |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 887 | else |
| 888 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 889 | ifdef SHARED_LIBRARY |
| 890 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 891 | $(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 892 | $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)" |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 893 | $(LTCompile.CXX) $< -o $@ |
| 894 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 895 | $(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 896 | $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)" |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 897 | $(LTCompile.C) $< -o $@ |
| 898 | |
| 899 | else |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 900 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 901 | $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 902 | $(Echo) "Compiling $*.cpp for $(BuildMode) build" |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 903 | $(Compile.CXX) $< -o $@ |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 904 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 905 | $(ObjDir)/%.o: %.c $(ObjDir)/.dir |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 906 | $(Echo) "Compiling $*.cpp for $(BuildMode) build" |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 907 | $(Compile.C) $< -o $@ |
| 908 | endif |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 909 | |
Chris Lattner | 478b3b4 | 2004-11-29 19:47:58 +0000 | [diff] [blame] | 910 | $(ObjDir)/%.bc: %.cpp $(ObjDir)/.dir $(GCCAS) |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 911 | $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)" |
Reid Spencer | 8676b7e | 2004-10-31 18:52:15 +0000 | [diff] [blame] | 912 | $(BCCompile.CXX) $< -o $@ |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 913 | |
Chris Lattner | 478b3b4 | 2004-11-29 19:47:58 +0000 | [diff] [blame] | 914 | $(ObjDir)/%.bc: %.c $(ObjDir)/.dir $(GCCAS) |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 915 | $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)" |
Reid Spencer | 8676b7e | 2004-10-31 18:52:15 +0000 | [diff] [blame] | 916 | $(BCCompile.C) $< -o $@ |
Brian Gaeke | 44909cf | 2003-12-10 00:26:28 +0000 | [diff] [blame] | 917 | |
Chris Lattner | 1cbc29f | 2001-09-07 22:57:58 +0000 | [diff] [blame] | 918 | endif |
| 919 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 920 | #--------------------------------------------------------- |
| 921 | # Provide rule to build .bc files from .ll sources, |
| 922 | # regardless of dependencies |
| 923 | #--------------------------------------------------------- |
| 924 | $(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS) |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 925 | $(Echo) "Compiling $*.ll for $(BuildMode) build" |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 926 | $(Verb) $(LLVMAS) $< -f -o $@ |
| 927 | |
| 928 | ############################################################################### |
| 929 | # TABLEGEN: Provide rules for running tblgen to produce *.inc files |
| 930 | ############################################################################### |
Chris Lattner | 481cc7c | 2003-08-15 02:18:35 +0000 | [diff] [blame] | 931 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 932 | ifdef TARGET |
| 933 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 934 | TDFiles := $(strip $(wildcard $(BUILD_SRC_DIR)/*.td) $(LLVM_SRC_ROOT)/lib/Target/Target.td) |
| 935 | INCFiles := $(filter %.inc,$(BUILT_SOURCES)) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 936 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 937 | $(INCFiles) : $(TBLGEN) $(TDFiles) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 938 | |
Reid Spencer | 1654448 | 2004-10-27 04:34:35 +0000 | [diff] [blame] | 939 | %GenRegisterNames.inc : %.td |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 940 | $(Echo) "Building $(<F) register names with tblgen" |
| 941 | $(Verb) $(TableGen) -gen-register-enums -o $@ $< |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 942 | |
Reid Spencer | 1654448 | 2004-10-27 04:34:35 +0000 | [diff] [blame] | 943 | %GenRegisterInfo.h.inc : %.td |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 944 | $(Echo) "Building $(<F) register information header with tblgen" |
| 945 | $(Verb) $(TableGen) -gen-register-desc-header -o $@ $< |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 946 | |
| 947 | %GenRegisterInfo.inc : %.td |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 948 | $(Echo) "Building $(<F) register info implementation with tblgen" |
| 949 | $(Verb) $(TableGen) -gen-register-desc -o $@ $< |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 950 | |
| 951 | %GenInstrNames.inc : %.td |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 952 | $(Echo) "Building $(<F) instruction names with tblgen" |
| 953 | $(Verb) $(TableGen) -gen-instr-enums -o $@ $< |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 954 | |
| 955 | %GenInstrInfo.inc : %.td |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 956 | $(Echo) "Building $(<F) instruction information with tblgen" |
| 957 | $(Verb) $(TableGen) -gen-instr-desc -o $@ $< |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 958 | |
| 959 | %GenAsmWriter.inc : %.td |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 960 | $(Echo) "Building $(<F) assembly writer with tblgen" |
| 961 | $(Verb) $(TableGen) -gen-asm-writer -o $@ $< |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 962 | |
| 963 | %GenATTAsmWriter.inc : %.td |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 964 | $(Echo) "Building $(<F) AT&T assembly writer with tblgen" |
| 965 | $(Verb) $(TableGen) -gen-asm-writer -o $@ $< |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 966 | |
| 967 | %GenIntelAsmWriter.inc : %.td |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 968 | $(Echo) "Building $(<F) Intel assembly writer with tblgen" |
| 969 | $(Verb) $(TableGen) -gen-asm-writer -asmwriternum=1 -o $@ $< |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 970 | |
| 971 | %GenInstrSelector.inc: %.td |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 972 | $(Echo) "Building $(<F) instruction selector with tblgen" |
| 973 | $(Verb) $(TableGen) -gen-instr-selector -o $@ $< |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 974 | |
| 975 | %GenCodeEmitter.inc:: %.td |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 976 | $(Echo) "Building $(<F) code emitter with tblgen" |
| 977 | $(Verb) $(TableGen) -gen-emitter -o $@ $< |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 978 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 979 | clean-local:: |
Reid Spencer | ca5fe8f | 2004-11-02 16:56:15 +0000 | [diff] [blame] | 980 | -$(Verb) $(RM) -f $(INCFiles) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 981 | |
| 982 | endif |
Chris Lattner | 481cc7c | 2003-08-15 02:18:35 +0000 | [diff] [blame] | 983 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 984 | ############################################################################### |
| 985 | # LEX AND YACC: Provide rules for generating sources with lex and yacc |
| 986 | ############################################################################### |
Chris Lattner | e899678 | 2003-01-16 22:44:19 +0000 | [diff] [blame] | 987 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 988 | #--------------------------------------------------------- |
| 989 | # Provide rules for generating a .cpp source file from |
| 990 | # (f)lex input sources. |
| 991 | #--------------------------------------------------------- |
| 992 | |
Reid Spencer | 3d65949 | 2004-11-02 16:36:03 +0000 | [diff] [blame] | 993 | LexFiles := $(filter %.l,$(Sources)) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 994 | |
Reid Spencer | 3d65949 | 2004-11-02 16:36:03 +0000 | [diff] [blame] | 995 | ifneq ($(LexFiles),) |
| 996 | |
| 997 | LexOutput := $(strip $(patsubst %.l,%.cpp,$(LexFiles))) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 998 | |
| 999 | .PRECIOUS: $(LexOutput) |
| 1000 | |
| 1001 | # Note the extra sed filtering here, used to cut down on the warnings emited |
| 1002 | # by GCC. The last line is a gross hack to work around flex aparently not |
| 1003 | # being able to resize the buffer on a large token input. Currently, for |
| 1004 | # uninitialized string buffers in LLVM we can generate very long tokens, so |
| 1005 | # this is a hack around it. |
Chris Lattner | b7dc2b9 | 2003-08-15 20:00:47 +0000 | [diff] [blame] | 1006 | # FIXME. (f.e. char Buffer[10000] ) |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1007 | %.cpp: %.l |
Reid Spencer | c2ef8cd | 2004-12-10 19:44:16 +0000 | [diff] [blame] | 1008 | $(Echo) Flexing $*.l |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1009 | $(Verb) $(FLEX) -t $< | \ |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 1010 | $(SED) 's/void yyunput/inline void yyunput/' | \ |
| 1011 | $(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \ |
| 1012 | $(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' \ |
Reid Spencer | 80f0ef7 | 2004-10-28 00:41:43 +0000 | [diff] [blame] | 1013 | > $@ |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1014 | |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 1015 | clean-local:: |
Reid Spencer | ca5fe8f | 2004-11-02 16:56:15 +0000 | [diff] [blame] | 1016 | -$(Verb) $(RM) -f $(LexOutput) |
Reid Spencer | 3d65949 | 2004-11-02 16:36:03 +0000 | [diff] [blame] | 1017 | $(Verb) $(RM) -f $(LexOutput) |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 1018 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1019 | endif |
| 1020 | |
| 1021 | #--------------------------------------------------------- |
| 1022 | # Provide rules for generating a .cpp and .h source files |
| 1023 | # from yacc (bison) input sources. |
| 1024 | #--------------------------------------------------------- |
| 1025 | |
Reid Spencer | 3d65949 | 2004-11-02 16:36:03 +0000 | [diff] [blame] | 1026 | YaccFiles := $(filter %.y,$(Sources)) |
| 1027 | ifneq ($(YaccFiles),) |
| 1028 | YaccOutput := $(addprefix $(patsubst %.y,%,$(YaccFiles)),.h .cpp .output) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1029 | |
| 1030 | .PRECIOUS: $(YaccOutput) |
| 1031 | |
| 1032 | # Cancel built-in rules for yacc |
| 1033 | %.c: %.y |
| 1034 | %.cpp: %.y |
| 1035 | %.h: %.y |
| 1036 | |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1037 | # Rule for building the bison parsers... |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1038 | %.cpp %.h : %.y |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1039 | $(Echo) "Bisoning $*.y" |
| 1040 | $(Verb) $(BISON) -v -d -p $(<F:%Parser.y=%) -o $*.tab.c $< |
| 1041 | $(Verb) $(MV) -f $*.tab.c $*.cpp |
| 1042 | $(Verb) $(MV) -f $*.tab.h $*.h |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1043 | |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 1044 | clean-local:: |
Reid Spencer | ca5fe8f | 2004-11-02 16:56:15 +0000 | [diff] [blame] | 1045 | -$(Verb) $(RM) -f $(YaccOutput) |
Reid Spencer | 3d65949 | 2004-11-02 16:36:03 +0000 | [diff] [blame] | 1046 | $(Verb) $(RM) -f $(YaccOutput) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1047 | endif |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1048 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1049 | ############################################################################### |
| 1050 | # OTHER RULES: Other rules needed |
| 1051 | ############################################################################### |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 1052 | |
Chris Lattner | 30440c6 | 2003-01-16 21:06:18 +0000 | [diff] [blame] | 1053 | # To create postscript files from dot files... |
John Criswell | e0f9ac6 | 2003-10-02 19:02:02 +0000 | [diff] [blame] | 1054 | ifneq ($(DOT),false) |
Chris Lattner | 30440c6 | 2003-01-16 21:06:18 +0000 | [diff] [blame] | 1055 | %.ps: %.dot |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 1056 | $(DOT) -Tps < $< > $@ |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 1057 | else |
| 1058 | %.ps: %.dot |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1059 | $(Echo) "Cannot build $@: The program dot is not installed" |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 1060 | endif |
Chris Lattner | 30440c6 | 2003-01-16 21:06:18 +0000 | [diff] [blame] | 1061 | |
John Criswell | 7f33695 | 2003-09-06 14:44:17 +0000 | [diff] [blame] | 1062 | # This rules ensures that header files that are removed still have a rule for |
| 1063 | # which they can be "generated." This allows make to ignore them and |
| 1064 | # reproduce the dependency lists. |
John Criswell | 4b6e5d1 | 2003-09-18 18:37:08 +0000 | [diff] [blame] | 1065 | %.h:: ; |
John Criswell | 7f33695 | 2003-09-06 14:44:17 +0000 | [diff] [blame] | 1066 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1067 | # Define clean-local to clean the current directory. Note that this uses a |
| 1068 | # very conservative approach ensuring that empty variables do not cause |
| 1069 | # errors or disastrous removal. |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 1070 | clean-local:: |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1071 | ifneq ($(strip $(ObjDir)),) |
Reid Spencer | ca5fe8f | 2004-11-02 16:56:15 +0000 | [diff] [blame] | 1072 | -$(Verb) $(RM) -rf $(ObjDir) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 1073 | endif |
Reid Spencer | ca5fe8f | 2004-11-02 16:56:15 +0000 | [diff] [blame] | 1074 | -$(Verb) $(RM) -f core core.[0-9][0-9]* *.o *.d *~ *.flc |
Brian Gaeke | 9d3cd40 | 2004-01-21 19:53:11 +0000 | [diff] [blame] | 1075 | ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set |
Reid Spencer | ca5fe8f | 2004-11-02 16:56:15 +0000 | [diff] [blame] | 1076 | -$(Verb) $(RM) -f *$(SHLIBEXT) |
Brian Gaeke | 9d3cd40 | 2004-01-21 19:53:11 +0000 | [diff] [blame] | 1077 | endif |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 1078 | |
Reid Spencer | 3d65949 | 2004-11-02 16:36:03 +0000 | [diff] [blame] | 1079 | clean-all-local:: |
Reid Spencer | ca5fe8f | 2004-11-02 16:56:15 +0000 | [diff] [blame] | 1080 | -$(Verb) $(RM) -rf Debug Release Profile |
Reid Spencer | 3d65949 | 2004-11-02 16:36:03 +0000 | [diff] [blame] | 1081 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1082 | # Build tags database for Emacs/Xemacs: |
Reid Spencer | 12d7951 | 2004-11-12 02:27:36 +0000 | [diff] [blame] | 1083 | tags:: TAGS CTAGS |
| 1084 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1085 | TAGS: |
Reid Spencer | 12d7951 | 2004-11-12 02:27:36 +0000 | [diff] [blame] | 1086 | find $(BUILD_SRC_ROOT)/include $(BUILD_SRC_ROOT)/lib \ |
| 1087 | $(BUILD_SRC_ROOT)/tools $(BUILD_SRC_ROOT)/examples \ |
| 1088 | $(BUILD_OBJ_ROOT)/include $(BUILD_OBJ_ROOT)/lib \ |
| 1089 | $(BUILD_OBJ_ROOT)/tools $(BUILD_OBJ_ROOT)/examples \ |
| 1090 | -name '*.cpp' -o -name '*.h' | \ |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1091 | $(ETAGS) $(ETAGSFLAGS) - |
| 1092 | |
Reid Spencer | 12d7951 | 2004-11-12 02:27:36 +0000 | [diff] [blame] | 1093 | CTAGS: |
| 1094 | find $(BUILD_SRC_ROOT)/include $(BUILD_SRC_ROOT)/lib \ |
| 1095 | $(BUILD_SRC_ROOT)/tools $(BUILD_SRC_ROOT)/examples \ |
| 1096 | $(BUILD_OBJ_ROOT)/include $(BUILD_OBJ_ROOT)/lib \ |
| 1097 | $(BUILD_OBJ_ROOT)/tools $(BUILD_OBJ_ROOT)/examples \ |
| 1098 | \( -name '*.cpp' -o -name '*.h' \) -print | \ |
| 1099 | ctags -ImtT -o $(BUILD_OBJ_ROOT)/CTAGS -L - |
| 1100 | |
| 1101 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 1102 | ############################################################################### |
| 1103 | # DEPENDENCIES: Include the dependency files if we should |
| 1104 | ############################################################################### |
Chris Lattner | 33ad24a | 2003-08-22 14:10:16 +0000 | [diff] [blame] | 1105 | ifndef DISABLE_AUTO_DEPENDENCIES |
| 1106 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 1107 | # If its not one of the cleaning targets |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1108 | ifneq ($strip($(filter-out clean clean-local dist-clean,$(MAKECMDGOALS))),) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 1109 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 1110 | # Get the list of dependency files |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1111 | DependFiles := $(basename $(filter %.cpp %.c %.cc, $(Sources))) |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 1112 | DependFiles := $(patsubst %,$(BUILD_OBJ_DIR)/$(BuildMode)/%.d,$(DependFiles)) |
Misha Brukman | 4f7a8cf | 2003-11-09 21:36:19 +0000 | [diff] [blame] | 1113 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 1114 | -include /dev/null $(DependFiles) |
| 1115 | |
John Criswell | d741bcf | 2003-08-12 18:51:51 +0000 | [diff] [blame] | 1116 | endif |
Chris Lattner | 1ddb6b6 | 2003-08-18 17:27:40 +0000 | [diff] [blame] | 1117 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1118 | endif |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 1119 | |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 1120 | ############################################################################### |
Reid Spencer | 9e8d54a | 2004-12-06 05:35:13 +0000 | [diff] [blame] | 1121 | # CHECK: Running the test suite |
| 1122 | ############################################################################### |
| 1123 | |
| 1124 | check:: |
| 1125 | $(Verb) if test -d "$(BUILD_OBJ_ROOT)/test" ; then \ |
| 1126 | if test -f "$(BUILD_OBJ_ROOT)/test/Makefile" ; then \ |
| 1127 | $(EchoCmd) Running test suite ; \ |
| 1128 | $(MAKE) -C $(BUILD_OBJ_ROOT)/test check-local \ |
| 1129 | TESTSUITE=$(TESTSUITE) ; \ |
| 1130 | else \ |
| 1131 | $(EchoCmd) No Makefile in test directory ; \ |
| 1132 | fi ; \ |
| 1133 | else \ |
| 1134 | $(EchoCmd) No test directory ; \ |
| 1135 | fi |
| 1136 | |
| 1137 | ############################################################################### |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1138 | # DISTRIBUTION: Handle construction of a distribution tarball |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 1139 | ############################################################################### |
| 1140 | |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1141 | #------------------------------------------------------------------------ |
| 1142 | # Define distribution related variables |
| 1143 | #------------------------------------------------------------------------ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 1144 | DistName := $(LLVM_TARBALL_NAME) |
| 1145 | DistDir := $(BUILD_OBJ_ROOT)/$(DistName) |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1146 | TopDistDir := $(BUILD_OBJ_ROOT)/$(DistName) |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 1147 | DistTarGZip := $(BUILD_OBJ_ROOT)/$(DistName).tar.gz |
| 1148 | DistZip := $(BUILD_OBJ_ROOT)/$(DistName).zip |
| 1149 | DistTarBZ2 := $(BUILD_OBJ_ROOT)/$(DistName).tar.bz2 |
| 1150 | DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \ |
| 1151 | ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \ |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1152 | Makefile.config.in configure autoconf |
| 1153 | DistOther := $(notdir $(wildcard \ |
| 1154 | $(BUILD_SRC_DIR)/*.h \ |
| 1155 | $(BUILD_SRC_DIR)/*.td \ |
| 1156 | $(BUILD_SRC_DIR)/*.def \ |
| 1157 | $(BUILD_SRC_DIR)/*.ll \ |
| 1158 | $(BUILD_SRC_DIR)/*.in)) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1159 | DistSubDirs := $(SubDirs) |
Reid Spencer | fbbf307 | 2004-11-29 05:00:33 +0000 | [diff] [blame] | 1160 | DistSources = $(Sources) $(EXTRA_DIST) |
| 1161 | DistFiles = $(DistAlways) $(DistSources) $(DistOther) |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 1162 | |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1163 | #------------------------------------------------------------------------ |
| 1164 | # We MUST build distribution with OBJ_DIR != SRC_DIR |
| 1165 | #------------------------------------------------------------------------ |
| 1166 | ifeq ($(BUILD_SRC_DIR),$(BUILD_OBJ_DIR)) |
| 1167 | dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip :: |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1168 | $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1169 | |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1170 | else |
| 1171 | |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1172 | #------------------------------------------------------------------------ |
| 1173 | # Prevent catastrophic remove |
| 1174 | #------------------------------------------------------------------------ |
| 1175 | ifeq ($(LLVM_TARBALL_NAME),) |
| 1176 | $(error LLVM_TARBALL_NAME is empty. Please rerun configure) |
| 1177 | endif |
| 1178 | |
| 1179 | #------------------------------------------------------------------------ |
| 1180 | # Prevent attempt to run dist targets from anywhere but the top level |
| 1181 | #------------------------------------------------------------------------ |
| 1182 | ifneq ($(LEVEL),.) |
| 1183 | |
| 1184 | dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip :: |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1185 | $(Echo) ERROR: You must run $@ from $(BUILD_OBJ_ROOT) |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1186 | |
| 1187 | else |
| 1188 | |
| 1189 | #------------------------------------------------------------------------ |
| 1190 | # Provide the top level targets |
| 1191 | #------------------------------------------------------------------------ |
| 1192 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1193 | dist-gzip:: $(DistTarGZip) |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1194 | |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 1195 | $(DistTarGZip) : $(TopDistDir)/.makedistdir |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1196 | $(Echo) Packing gzipped distribution tar file. |
Reid Spencer | fbbf307 | 2004-11-29 05:00:33 +0000 | [diff] [blame] | 1197 | $(Verb) cd $(BUILD_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \ |
| 1198 | $(GZIP) -c > "$(DistTarGZip)" |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1199 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1200 | dist-bzip2:: $(DistTarBZ2) |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1201 | |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 1202 | $(DistTarBZ2) : $(TopDistDir)/.makedistdir |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1203 | $(Echo) Packing bzipped distribution tar file. |
Reid Spencer | fbbf307 | 2004-11-29 05:00:33 +0000 | [diff] [blame] | 1204 | $(Verb) cd $(BUILD_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \ |
| 1205 | $(BZIP2) -c >$(DistTarBZ2) |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1206 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1207 | dist-zip:: $(DistZip) |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1208 | |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 1209 | $(DistZip) : $(TopDistDir)/.makedistdir |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1210 | $(Echo) Packing zipped distribution file. |
| 1211 | $(Verb) rm -f $(DistZip) |
| 1212 | $(Verb) cd $(BUILD_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName) |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1213 | |
| 1214 | dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1215 | $(Echo) ===== DISTRIBUTION PACKAGING SUCESSFUL ===== |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1216 | |
| 1217 | DistCheckDir := $(LLVM_OBJ_ROOT)/_distcheckdir |
| 1218 | |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 1219 | dist-check:: $(DistTarGZip) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1220 | $(Echo) Checking distribution tar file. |
| 1221 | $(Verb) if test -d $(DistCheckDir) ; then \ |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1222 | $(RM) -rf $(DistCheckDir) ; \ |
| 1223 | fi |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1224 | $(Verb) $(MKDIR) $(DistCheckDir) |
| 1225 | $(Verb) cd $(DistCheckDir) && \ |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1226 | $(MKDIR) $(DistCheckDir)/build && \ |
| 1227 | $(MKDIR) $(DistCheckDir)/install && \ |
| 1228 | gunzip -c $(DistTarGZip) | $(TAR) xf - && \ |
| 1229 | cd build && \ |
| 1230 | ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \ |
| 1231 | --srcdir=../$(DistName) --with-llvmgccdir="$(LLVMGCCDIR)" && \ |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 1232 | $(MAKE) all && \ |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1233 | $(MAKE) check && \ |
| 1234 | $(MAKE) install && \ |
| 1235 | $(MAKE) uninstall && \ |
| 1236 | $(MAKE) dist && \ |
| 1237 | $(MAKE) clean && \ |
| 1238 | $(MAKE) dist-clean && \ |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1239 | $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution ===== |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1240 | |
| 1241 | dist-clean:: |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1242 | $(Echo) Cleaning distribution files |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 1243 | -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) \ |
| 1244 | $(DistCheckDir) |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1245 | |
| 1246 | endif |
| 1247 | |
| 1248 | #------------------------------------------------------------------------ |
| 1249 | # Provide the recursive distdir target for building the distribution directory |
| 1250 | #------------------------------------------------------------------------ |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 1251 | distdir: $(DistDir)/.makedistdir |
| 1252 | $(DistDir)/.makedistdir: $(DistSources) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1253 | $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \ |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1254 | if test -d "$(DistDir)" ; then \ |
| 1255 | find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \ |
| 1256 | exit 1 ; \ |
| 1257 | fi ; \ |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 1258 | $(EchoCmd) Removing old $(DistDir) ; \ |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1259 | $(RM) -rf $(DistDir); \ |
Reid Spencer | 9e8d54a | 2004-12-06 05:35:13 +0000 | [diff] [blame] | 1260 | $(EchoCmd) Making 'all' to verify build ; \ |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 1261 | $(MAKE) all ; \ |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1262 | fi |
Reid Spencer | fbbf307 | 2004-11-29 05:00:33 +0000 | [diff] [blame] | 1263 | $(Echo) Building Distribution Directory $(DistDir) |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1264 | $(Verb) $(MKDIR) $(DistDir) |
| 1265 | $(Verb) srcdirstrip=`echo "$(BUILD_SRC_DIR)" | sed 's|.|.|g'`; \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 1266 | srcrootstrip=`echo "$(BUILD_SRC_ROOT)" | sed 's|.|.|g'`; \ |
| 1267 | for file in $(DistFiles) ; do \ |
| 1268 | case "$$file" in \ |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 1269 | $(BUILD_SRC_DIR)/*) \ |
| 1270 | file=`echo "$$file" | sed "s#^$$srcdirstrip/##"` \ |
| 1271 | ;; \ |
| 1272 | $(BUILD_SRC_ROOT)/*) \ |
| 1273 | file=`echo "$$file" | \ |
| 1274 | sed "s#^$$srcrootstrip/##"` \ |
| 1275 | ;; \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 1276 | esac; \ |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 1277 | if test -f "$(BUILD_SRC_DIR)/$$file" || \ |
| 1278 | test -d "$(BUILD_SRC_DIR)/$$file" ; then \ |
| 1279 | from_dir="$(BUILD_SRC_DIR)" ; \ |
| 1280 | elif test -f "$$file" || test -d "$$file" ; then \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 1281 | from_dir=. ; \ |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 1282 | fi ; \ |
| 1283 | to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'` ; \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 1284 | if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \ |
| 1285 | to_dir="$(DistDir)/$$dir"; \ |
| 1286 | $(MKDIR) "$$to_dir" ; \ |
| 1287 | else \ |
| 1288 | to_dir="$(DistDir)"; \ |
| 1289 | fi; \ |
| 1290 | mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \ |
| 1291 | if test -n "$$mid_dir" ; then \ |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1292 | $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 1293 | fi ; \ |
| 1294 | if test -d "$$from_dir/$$file"; then \ |
| 1295 | if test -d "$(BUILD_SRC_DIR)/$$file" && \ |
| 1296 | test "$$from_dir" != "$(BUILD_SRC_DIR)" ; then \ |
| 1297 | cp -pR "$(BUILD_SRC_DIR)/$$file" "$$to_dir" || exit 1; \ |
| 1298 | fi; \ |
| 1299 | cp -pR $$from_dir/$$file $$to_dir || exit 1; \ |
| 1300 | elif test -f "$$from_dir/$$file" ; then \ |
| 1301 | cp -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \ |
| 1302 | elif test -L "$$from_dir/$$file" ; then \ |
| 1303 | cp -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \ |
| 1304 | elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \ |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 1305 | $(EchoCmd) "===== WARNING: Distribution Source " \ |
| 1306 | "$$from_dir/$$file Not Found!" ; \ |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1307 | elif test "$(Verb)" != '@' ; then \ |
| 1308 | $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 1309 | fi; \ |
| 1310 | done |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1311 | $(Verb) for subdir in $(DistSubDirs) ; do \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 1312 | if test "$$subdir" \!= "." ; then \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 1313 | new_distdir="$(DistDir)/$$subdir" ; \ |
Reid Spencer | e45ebfa | 2004-10-26 07:09:33 +0000 | [diff] [blame] | 1314 | test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \ |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 1315 | ( cd $$subdir && $(MAKE) DistDir="$$new_distdir" distdir ) || \ |
| 1316 | exit 1; \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 1317 | fi; \ |
| 1318 | done |
Reid Spencer | 345235ca | 2004-12-04 22:34:09 +0000 | [diff] [blame] | 1319 | $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \ |
| 1320 | $(EchoCmd) Eliminating CVS directories from distribution ; \ |
| 1321 | $(RM) -rf `find $(TopDistDir) -type d -name CVS -print` ;\ |
| 1322 | $(MAKE) dist-hook ; \ |
| 1323 | $(FIND) $(TopDistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; \ |
| 1324 | -o ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; \ |
| 1325 | -o ! -type d ! -perm -400 -exec chmod a+r {} \; \ |
| 1326 | -o ! -type d ! -perm -444 -exec \ |
| 1327 | $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \ |
| 1328 | || chmod -R a+r $(DistDir) ; \ |
| 1329 | fi |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 1330 | |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1331 | # This is invoked by distdir target, define it as a no-op to avoid errors if not |
| 1332 | # defined by user. |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame] | 1333 | dist-hook:: |
| 1334 | |
Reid Spencer | e53e397 | 2004-10-22 23:06:30 +0000 | [diff] [blame] | 1335 | endif |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 1336 | |
| 1337 | ############################################################################### |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 1338 | # TOP LEVEL - targets only to apply at the top level directory |
| 1339 | ############################################################################### |
| 1340 | |
| 1341 | ifeq ($(LEVEL),.) |
| 1342 | |
| 1343 | #------------------------------------------------------------------------ |
Reid Spencer | 9e8d54a | 2004-12-06 05:35:13 +0000 | [diff] [blame] | 1344 | # Install support for the project's include files: |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 1345 | #------------------------------------------------------------------------ |
| 1346 | install-local:: |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1347 | $(Echo) Installing include files |
| 1348 | $(Verb) $(MKDIR) $(includedir) |
| 1349 | $(Verb) if [ -d "$(BUILD_SRC_ROOT)/include" ] ; then \ |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 1350 | cd $(BUILD_SRC_ROOT)/include && \ |
| 1351 | find . -path '*/Internal' -prune -o '(' -type f \ |
| 1352 | '!' '(' -name '*~' -o -name '.cvsignore' -o -name '.#*' ')' \ |
| 1353 | -print ')' | grep -v CVS | pax -rwdvpe $(includedir) ; \ |
| 1354 | fi |
| 1355 | |
| 1356 | uninstall-local:: |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1357 | $(Echo) Uninstalling include files |
| 1358 | $(Verb) if [ -d "$(BUILD_SRC_ROOT)/include" ] ; then \ |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 1359 | cd $(BUILD_SRC_ROOT)/include && \ |
| 1360 | $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \ |
| 1361 | '!' '(' -name '*~' -o -name '.cvsignore' -o -name '.#*' ')' \ |
| 1362 | -print ')' | grep -v CVS | sed 's#^#$(includedir)/#'` ; \ |
| 1363 | fi |
| 1364 | |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 1365 | endif |
| 1366 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 1367 | #------------------------------------------------------------------------ |
| 1368 | # Print out the directories used for building |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1369 | #------------------------------------------------------------------------ |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 1370 | printvars:: |
Reid Spencer | 9af3b29 | 2004-11-01 07:50:27 +0000 | [diff] [blame] | 1371 | $(Echo) "BuildMode : " '$(BuildMode)' |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1372 | $(Echo) "BUILD_SRC_ROOT : " '$(BUILD_SRC_ROOT)' |
| 1373 | $(Echo) "BUILD_SRC_DIR : " '$(BUILD_SRC_DIR)' |
| 1374 | $(Echo) "BUILD_OBJ_ROOT : " '$(BUILD_OBJ_ROOT)' |
| 1375 | $(Echo) "BUILD_OBJ_DIR : " '$(BUILD_OBJ_DIR)' |
| 1376 | $(Echo) "LLVM_SRC_ROOT : " '$(LLVM_SRC_ROOT)' |
| 1377 | $(Echo) "LLVM_OBJ_ROOT : " '$(LLVM_OBJ_ROOT)' |
| 1378 | $(Echo) "libdir : " '$(libdir)' |
| 1379 | $(Echo) "bindir : " '$(bindir)' |
| 1380 | $(Echo) "sysconfdir : " '$(sysconfdir)' |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1381 | $(Echo) "UserTargets : " '$(UserTargets)' |
| 1382 | $(Echo) "ObjMakefiles : " '$(ObjMakefiles)' |
| 1383 | $(Echo) "SrcMakefiles : " '$(SrcMakefiles)' |
| 1384 | $(Echo) "ObjDir : " '$(ObjDir)' |
| 1385 | $(Echo) "LibDir : " '$(LibDir)' |
| 1386 | $(Echo) "ToolDir : " '$(ToolDir)' |
Reid Spencer | 815cbcf | 2004-11-18 10:03:46 +0000 | [diff] [blame] | 1387 | $(Echo) "ExmplDir : " '$(ExmplDir)' |
Reid Spencer | 7980ea4 | 2004-12-05 05:17:22 +0000 | [diff] [blame] | 1388 | $(Echo) "Sources : " '$(Sources)' |
Reid Spencer | cc2d1e2 | 2004-10-30 09:19:36 +0000 | [diff] [blame] | 1389 | $(Echo) "TDFiles : " '$(TDFiles)' |
| 1390 | $(Echo) "INCFiles : " '$(INCFiles)' |
| 1391 | $(Echo) "Compile.CXX : " '$(Compile.CXX)' |
| 1392 | $(Echo) "Compile.C : " '$(Compile.C)' |
| 1393 | $(Echo) "Archive : " '$(Archive)' |
Reid Spencer | 3d65949 | 2004-11-02 16:36:03 +0000 | [diff] [blame] | 1394 | $(Echo) "YaccFiles : " '$(YaccFiles)' |
| 1395 | $(Echo) "LexFiles : " '$(LexFiles)' |
Reid Spencer | 7980ea4 | 2004-12-05 05:17:22 +0000 | [diff] [blame] | 1396 | $(Echo) "Module : " '$(Module)' |