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 | |
John Criswell | 2a6530f | 2003-06-27 16:58:44 +0000 | [diff] [blame] | 15 | # |
John Criswell | 7f33695 | 2003-09-06 14:44:17 +0000 | [diff] [blame] | 16 | # Set the VPATH so that we can find source files. |
John Criswell | 8bff509 | 2003-06-11 13:55:44 +0000 | [diff] [blame] | 17 | # |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 18 | VPATH=$(BUILD_SRC_DIR) |
John Criswell | 8bff509 | 2003-06-11 13:55:44 +0000 | [diff] [blame] | 19 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 20 | ############################################################################### |
| 21 | # TARGETS: Define standard targets that can be invoked |
| 22 | ############################################################################### |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 23 | |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 24 | #-------------------------------------------------------------------- |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 25 | # Define the various target sets |
| 26 | #-------------------------------------------------------------------- |
| 27 | RECURSIVE_TARGETS := all clean check install uninstall |
| 28 | LOCAL_TARGETS := all-local clean-local check-local install-local printvars\ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 29 | uninstall-local |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 30 | TOPLEV_TARGETS := dist dist-check dist-clean tags |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 31 | USER_TARGETS := $(RECURSIVE_TARGETS) $(LOCAL_TARGETS) $(TOPLEV_TARGETS) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 32 | INTERNAL_TARGETS := preconditions \ |
| 33 | install-config-dir install-shared-library install-bytecode-library \ |
| 34 | install-archive-library install-relinked-library install-tool \ |
| 35 | uninstall-config-dir uninstall-shared-library uninstall-bytecode-library \ |
| 36 | uninstall-archive-library uninstall-relinked-library uninstall-tool |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 37 | |
| 38 | #-------------------------------------------------------------------- |
| 39 | # Mark all of these targets as phony to avoid implicit rule search |
| 40 | #-------------------------------------------------------------------- |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 41 | .PHONY: $(USER_TARGETS) $(INTERNAL_TARGETS) |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 42 | |
| 43 | #-------------------------------------------------------------------- |
| 44 | # Make sure all the user-target rules are double colon rules and that |
| 45 | # the preconditions are run first. |
| 46 | #-------------------------------------------------------------------- |
| 47 | |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 48 | $(USER_TARGETS) :: preconditions |
| 49 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 50 | all :: all-local |
| 51 | check:: check-local |
| 52 | clean:: clean-local |
| 53 | install :: install-local |
| 54 | uninstall :: uninstall-local |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 55 | check-local :: all-local |
| 56 | install-local :: all-local |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 57 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 58 | ############################################################################### |
| 59 | # SUFFIXES: Reset the list of suffixes we know how to build |
| 60 | ############################################################################### |
| 61 | .SUFFIXES: |
| 62 | .SUFFIXES: .c .cpp .h .hpp .y .l .lo .o .a $(SHLIBEXT) .bc .td .ps .dot $(SUFFIXES) |
| 63 | |
| 64 | ############################################################################### |
| 65 | # VARIABLES: Set up various variables based on configuration data |
| 66 | ############################################################################### |
| 67 | |
| 68 | #-------------------------------------------------------------------- |
| 69 | # Variables derived from configuration we are building |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 70 | #-------------------------------------------------------------------- |
| 71 | |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 72 | ifdef ENABLE_PROFILING |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 73 | CONFIGURATION := Profile |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 74 | CXXFLAGS += -O3 -DNDEBUG -felide-constructors -finline-functions -pg |
| 75 | CFLAGS += -O3 -DNDEBUG -pg |
| 76 | LDFLAGS += -O3 -DNDEBUG -pg |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 77 | else |
| 78 | ifdef ENABLE_OPTIMIZED |
| 79 | CONFIGURATION := Release |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 80 | CXXFLAGS += -O3 -DNDEBUG -finline-functions -felide-constructors -fomit-frame-pointer |
| 81 | CFLAGS += -O3 -DNDEBUG -fomit-frame-pointer |
| 82 | LDFLAGS += -O3 -DNDEBUG |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 83 | else |
| 84 | CONFIGURATION := Debug |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 85 | CXXFLAGS += -g -D_DEBUG |
| 86 | CFLAGS += -g -D_DEBUG |
| 87 | LDFLAGS += -g -D_DEBUG |
| 88 | KEEP_SYMBOLS := 1 |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 89 | endif |
| 90 | endif |
| 91 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 92 | ARFLAGS := cru |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 93 | |
| 94 | #-------------------------------------------------------------------- |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 95 | # Directory locations |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 96 | #-------------------------------------------------------------------- |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 97 | OBJDIR := $(BUILD_OBJ_DIR)/$(CONFIGURATION) |
| 98 | LIBDIR := $(BUILD_OBJ_ROOT)/lib/$(CONFIGURATION) |
| 99 | TOOLDIR := $(BUILD_OBJ_ROOT)/tools/$(CONFIGURATION) |
| 100 | LLVMLIBDIR := $(LLVM_OBJ_ROOT)/lib/$(CONFIGURATION) |
| 101 | LLVMTOOLDIR := $(LLVM_OBJ_ROOT)/tools/$(CONFIGURATION) |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 102 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 103 | #-------------------------------------------------------------------- |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 104 | # Full Paths To Compiled Tools and Utilities |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 105 | #-------------------------------------------------------------------- |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 106 | LIBTOOL := $(LLVM_OBJ_ROOT)/mklib |
| 107 | LLVMAS := $(LLVMTOOLDIR)/llvm-as$(EXEEXT) |
| 108 | BURG := $(LLVMTOOLDIR)/burg$(EXEEXT) |
| 109 | TBLGEN := $(LLVMTOOLDIR)/tblgen$(EXEEXT) |
| 110 | GCCLD := $(LLVMTOOLDIR)/gccld$(EXEEXT) |
| 111 | LLVMGCC := PATH=$(LLVMTOOLDIR):$(PATH) $(LLVMGCCDIR)/bin/gcc |
| 112 | LLVMGXX := PATH=$(LLVMTOOLDIR):$(PATH) $(LLVMGCCDIR)/bin/g++ |
Dinakar Dhurjati | ffb55cd | 2003-05-29 16:18:20 +0000 | [diff] [blame] | 113 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 114 | # Need a better way to compute this. |
| 115 | LLVMGCCLIBDIR := $(dir $(shell $(LLVMGCC) -print-file-name=libgcc.a))/ |
Dinakar Dhurjati | ffb55cd | 2003-05-29 16:18:20 +0000 | [diff] [blame] | 116 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 117 | #-------------------------------------------------------------------- |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 118 | # Adjust to user's request |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 119 | #-------------------------------------------------------------------- |
Dinakar Dhurjati | ffb55cd | 2003-05-29 16:18:20 +0000 | [diff] [blame] | 120 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 121 | # Adjust LIBTOOL options for shared libraries, or not. |
John Criswell | 82f4a5a | 2003-07-31 20:58:51 +0000 | [diff] [blame] | 122 | ifndef SHARED_LIBRARY |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 123 | LIBTOOL += --tag=disable-shared |
| 124 | else |
| 125 | LDFLAGS += -rpath $(LIBDIR) |
John Criswell | 82f4a5a | 2003-07-31 20:58:51 +0000 | [diff] [blame] | 126 | endif |
| 127 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 128 | # Adjust settings for verbose mode |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 129 | ifndef VERBOSE |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 130 | VERB := @ |
| 131 | LIBTOOL += --silent |
| 132 | AR += >/dev/null 2>/dev/null |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 133 | CONFIGUREFLAGS += >$(BUILD_OBJ_DIR)/configure.out 2>&1 |
| 134 | else |
| 135 | CONFIGUREFLAGS := |
Misha Brukman | b5f096f | 2002-09-12 16:05:39 +0000 | [diff] [blame] | 136 | endif |
| 137 | |
Vikram S. Adve | feeae58 | 2002-09-18 11:55:13 +0000 | [diff] [blame] | 138 | # By default, strip symbol information from executable |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 139 | ifndef KEEP_SYMBOLS |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 140 | STRIP = $(PLATFORMSTRIPOPTS) |
| 141 | STRIP_WARN_MSG = "(without symbols)" |
Vikram S. Adve | feeae58 | 2002-09-18 11:55:13 +0000 | [diff] [blame] | 142 | endif |
| 143 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 144 | # Adjust linker flags for building an executable |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 145 | ifdef TOOLNAME |
| 146 | LDFLAGS += -rpath $(TOOLDIR) -export-dynamic $(TOOLLINKOPTS) |
| 147 | endif |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 148 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 149 | # Use TOOLLINKOPTSB to pass options to the linker like library search |
| 150 | # path etc. |
Dinakar Dhurjati | 87ea8aa | 2003-10-29 14:28:35 +0000 | [diff] [blame] | 151 | # Note that this is different from TOOLLINKOPTS, these options |
| 152 | # are passed to the linker *before* the USEDLIBS options are passed. |
| 153 | # e.g. usage TOOLLINKOPTSB = -L/home/xxx/lib |
| 154 | ifdef TOOLLINKOPTSB |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 155 | LDFLAGS += $(TOOLLINKOPTSB) |
Dinakar Dhurjati | 87ea8aa | 2003-10-29 14:28:35 +0000 | [diff] [blame] | 156 | endif |
| 157 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 158 | #---------------------------------------------------------- |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 159 | # Options To Invoke Tools |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 160 | #---------------------------------------------------------- |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 161 | |
| 162 | CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused |
| 163 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 164 | LDFLAGS += -L$(LIBDIR) -L$(LLVMLIBDIR) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 165 | CPPFLAGS += -I$(BUILD_OBJ_DIR) \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 166 | -I$(BUILD_SRC_DIR) \ |
| 167 | -I$(BUILD_SRC_ROOT)/include \ |
| 168 | -I$(BUILD_OBJ_ROOT)/include \ |
| 169 | -I$(LLVM_OBJ_ROOT)/include \ |
| 170 | -I$(LLVM_SRC_ROOT)/include \ |
| 171 | -D_GNU_SOURCE -D__STDC_LIMIT_MACROS |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 172 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 173 | Compile.C = $(CC) $(CPPFLAGS) $(CompileCommonOpts) -c $(CFLAGS) |
| 174 | Compile.CXX = $(CXX) $(CPPFLAGS) $(CompileCommonOpts) $(CXXFLAGS) -c |
| 175 | LTCompile.C = $(LIBTOOL) --mode=compile $(Compile.C) |
| 176 | LTCompile.CXX = $(LIBTOOL) --tag=CXX --mode=compile $(Compile.CXX) |
| 177 | BCCompile.CXX = $(LLVMGXX) $(CPPFLAGS) $(CompileCommonOpts) $(CXXFLAGS) -c |
| 178 | BCCompile.C = $(LLVMGCC) $(CPPFLAGS) $(CompileCommonOpts) $(CFLAGS) -c |
| 179 | Link = $(LIBTOOL) --tag=CXX --mode=link $(CXX) $(CPPFLAGS) \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 180 | $(CompileCommonOpts) $(LDFLAGS) $(STRIP) |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 181 | Relink = $(LIBTOOL) --tag=CXX --mode=link $(CXX) |
| 182 | BCLinkLib = $(LLVMGCC) -shared -nostdlib |
| 183 | Burg = $(BURG) -I $(BUILD_SRC_DIR) |
| 184 | TableGen = $(TBLGEN) -I $(BUILD_SRC_DIR) |
| 185 | Archive = $(AR) $(ARFLAGS) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 186 | ifdef RANLIB |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 187 | Ranlib = $(RANLIB) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 188 | else |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 189 | Ranlib = ranlib |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 190 | endif |
| 191 | |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 192 | #---------------------------------------------------------- |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 193 | # Get the list of source files |
| 194 | #---------------------------------------------------------- |
| 195 | ifndef SOURCES |
| 196 | SOURCES := $(notdir $(wildcard $(BUILD_SRC_DIR)/*.cpp \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 197 | $(BUILD_SRC_DIR)/*.cc $(BUILD_SRC_DIR)/*.c $(BUILD_SRC_DIR)/*.y \ |
| 198 | $(BUILD_SRC_DIR)/*.l)) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 199 | endif |
| 200 | |
| 201 | ifdef BUILT_SOURCES |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 202 | SOURCES += $(filter %.cpp %.c %.cc %.y %.l,$(BUILT_SOURCES)) |
Vikram S. Adve | ad9ea7e | 2002-10-14 16:40:04 +0000 | [diff] [blame] | 203 | endif |
Vikram S. Adve | 112a72c | 2001-07-15 13:16:47 +0000 | [diff] [blame] | 204 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 205 | #---------------------------------------------------------- |
| 206 | # Types of objects that can be built from sources |
| 207 | #---------------------------------------------------------- |
| 208 | BASENAME_SOURCES := $(sort $(basename $(SOURCES))) |
| 209 | ObjectsO := $(BASENAME_SOURCES:%=$(OBJDIR)/%.o) |
| 210 | ObjectsLO := $(BASENAME_SOURCES:%=$(OBJDIR)/%.lo) |
| 211 | ObjectsBC := $(BASENAME_SOURCES:%=$(OBJDIR)/%.bc) |
| 212 | |
| 213 | |
| 214 | ############################################################################### |
| 215 | # DIRECTORIES: Handle recursive descent of directory structure |
| 216 | ############################################################################### |
John Criswell | 82f4a5a | 2003-07-31 20:58:51 +0000 | [diff] [blame] | 217 | |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 218 | #--------------------------------------------------------- |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 219 | # Handle the DIRS options for sequential construction |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 220 | #--------------------------------------------------------- |
| 221 | |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 222 | SUBDIRS := |
Anand Shukla | 7c7a07e | 2002-09-18 04:29:30 +0000 | [diff] [blame] | 223 | ifdef DIRS |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 224 | SUBDIRS += $(DIRS) |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 225 | $(RECURSIVE_TARGETS):: |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 226 | $(VERB) for dir in $(DIRS); do \ |
| 227 | if [ ! -f $$dir/Makefile ]; then \ |
| 228 | $(MKDIR) $$dir; \ |
| 229 | cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ |
| 230 | fi; \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 231 | ($(MAKE) -C $$dir $@ ) || exit 1; \ |
Chris Lattner | f1ffd99 | 2002-09-17 23:35:02 +0000 | [diff] [blame] | 232 | done |
Anand Shukla | 7c7a07e | 2002-09-18 04:29:30 +0000 | [diff] [blame] | 233 | endif |
Chris Lattner | a8abc22 | 2002-09-18 03:22:27 +0000 | [diff] [blame] | 234 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 235 | #--------------------------------------------------------- |
| 236 | # Handle the EXPERIMENTAL_DIRS options ensuring success |
| 237 | # after each directory is built. |
| 238 | #--------------------------------------------------------- |
| 239 | ifdef EXPERIMENTAL_DIRS |
| 240 | $(RECURSIVE_TARGETS):: |
| 241 | $(VERB) for dir in $(EXPERIMENTAL_DIRS); do \ |
| 242 | if [ ! -f $$dir/Makefile ]; then \ |
| 243 | $(MKDIR) $$dir; \ |
| 244 | cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ |
| 245 | fi; \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 246 | ($(MAKE) -C $$dir $@ ) || exit 0; \ |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 247 | done |
| 248 | endif |
Chris Lattner | a8abc22 | 2002-09-18 03:22:27 +0000 | [diff] [blame] | 249 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 250 | #--------------------------------------------------------- |
| 251 | # Handle the PARALLEL_DIRS options for parallel construction |
| 252 | #--------------------------------------------------------- |
| 253 | ifdef PARALLEL_DIRS |
| 254 | |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 255 | SUBDIRS += $(PARALLEL_DIRS) |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 256 | # Unfortunately, this list must be maintained if new |
| 257 | # recursive targets are added. |
| 258 | all :: $(addsuffix /.makeall , $(PARALLEL_DIRS)) |
| 259 | clean :: $(addsuffix /.makeclean , $(PARALLEL_DIRS)) |
| 260 | check :: $(addsuffix /.makecheck , $(PARALLEL_DIRS)) |
| 261 | install :: $(addsuffix /.makeinstall , $(PARALLEL_DIRS)) |
| 262 | uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS)) |
| 263 | |
| 264 | Parallel_Targets := $(foreach T,$(RECURSIVE_TARGETS),%/.make$(T)) |
| 265 | |
| 266 | $(Parallel_Targets) : |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 267 | $(VERB) if [ ! -f $(@D)/Makefile ]; then \ |
| 268 | $(MKDIR) $(@D); \ |
| 269 | cp $(BUILD_SRC_DIR)/$(@D)/Makefile $(@D)/Makefile; \ |
John Criswell | b3866b6 | 2003-11-25 19:32:22 +0000 | [diff] [blame] | 270 | fi; \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 271 | $(MAKE) -C $(@D) $(subst $(@D)/.make,,$@) |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 272 | endif |
| 273 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 274 | #--------------------------------------------------------- |
| 275 | # Handle the OPTIONAL_DIRS options for directores that may |
| 276 | # or may not exist. |
| 277 | #--------------------------------------------------------- |
John Criswell | 2a6530f | 2003-06-27 16:58:44 +0000 | [diff] [blame] | 278 | ifdef OPTIONAL_DIRS |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 279 | |
| 280 | SUBDIRS += $(OPTIONAL_DIRS) |
| 281 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 282 | $(RECURSIVE_TARGETS):: |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 283 | $(VERB) for dir in $(OPTIONAL_DIRS); do \ |
| 284 | if [ -d $(BUILD_SRC_DIR)/$$dir ]; then\ |
| 285 | if [ ! -f $$dir/Makefile ]; then \ |
| 286 | $(MKDIR) $$dir; \ |
| 287 | cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ |
| 288 | fi; \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 289 | ($(MAKE) -C$$dir $@ ) || exit 1; \ |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 290 | fi \ |
John Criswell | 2a6530f | 2003-06-27 16:58:44 +0000 | [diff] [blame] | 291 | done |
| 292 | endif |
| 293 | |
Reid Spencer | fc94508 | 2004-08-20 09:20:05 +0000 | [diff] [blame] | 294 | #--------------------------------------------------------- |
| 295 | # Handle the CONFIG_FILES options |
| 296 | #--------------------------------------------------------- |
| 297 | ifdef CONFIG_FILES |
Reid Spencer | fc94508 | 2004-08-20 09:20:05 +0000 | [diff] [blame] | 298 | |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 299 | install-local:: install-config-dir |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 300 | |
| 301 | install-config-dir: $(sysconfdir) $(CONFIG_FILES) |
Reid Spencer | 37130d2 | 2004-10-04 07:05:07 +0000 | [diff] [blame] | 302 | $(VERB)$(ECHO) Installing Configuration Files To $(sysconfdir) |
| 303 | $(VERB)for file in $(CONFIG_FILES); do \ |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 304 | $(INSTALL) $(BUILD_SRC_DIR)/$${file} $(sysconfdir) ; \ |
Reid Spencer | fc94508 | 2004-08-20 09:20:05 +0000 | [diff] [blame] | 305 | done |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 306 | |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 307 | uninstall-local:: uninstall-config-dir |
| 308 | |
| 309 | uninstall-config-dir: |
| 310 | $(VERB)$(ECHO) Uninstalling Configuration Files From $(sysconfdir) |
| 311 | $(VERB)for file in $(CONFIG_FILES); do \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 312 | $(RM) -f $(sysconfdir)/$${file} ; \ |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 313 | done |
| 314 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 315 | $(sysconfdir): |
| 316 | $(MKDIR) $(sysconfdir) |
| 317 | |
Reid Spencer | fc94508 | 2004-08-20 09:20:05 +0000 | [diff] [blame] | 318 | endif |
| 319 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 320 | ############################################################################### |
| 321 | # Library Build Rules: Four ways to build a library |
| 322 | ############################################################################### |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 323 | |
Brian Gaeke | 8abff79 | 2004-01-22 22:53:48 +0000 | [diff] [blame] | 324 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 325 | # if we're building a library ... |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 326 | ifdef LIBRARYNAME |
Vikram S. Adve | 112a72c | 2001-07-15 13:16:47 +0000 | [diff] [blame] | 327 | |
Chris Lattner | 2a548c5 | 2002-09-16 22:36:42 +0000 | [diff] [blame] | 328 | # Make sure there isn't any extranous whitespace on the LIBRARYNAME option |
Chris Lattner | ccb4ebd | 2002-09-16 22:34:56 +0000 | [diff] [blame] | 329 | LIBRARYNAME := $(strip $(LIBRARYNAME)) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 330 | LIBNAME_LA := $(LIBDIR)/lib$(LIBRARYNAME).la |
| 331 | LIBNAME_A := $(LIBDIR)/lib$(LIBRARYNAME).a |
| 332 | LIBNAME_O := $(LIBDIR)/$(LIBRARYNAME).o |
| 333 | LIBNAME_BC := $(LIBDIR)/lib$(LIBRARYNAME).bc |
Chris Lattner | ccb4ebd | 2002-09-16 22:34:56 +0000 | [diff] [blame] | 334 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 335 | #--------------------------------------------------------- |
| 336 | # Shared Library Targets: |
| 337 | # If the user asked for a shared library to be built |
| 338 | # with the SHARED_LIBRARY variable, then we provide |
| 339 | # targets for building them. |
| 340 | #--------------------------------------------------------- |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 341 | ifdef SHARED_LIBRARY |
| 342 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 343 | all-local:: $(LIBNAME_LA) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 344 | |
| 345 | $(LIBNAME_LA): $(BUILT_SOURCES) $(ObjectsLO) $(LIBDIR)/.dir |
| 346 | @$(ECHO) Linking shared library $(notdir $@) |
| 347 | $(VERB) $(Link) -o $@ $(ObjectsLO) |
| 348 | $(VERB) $(LIBTOOL) --mode=install $(INSTALL) $@ $(LIBDIR) |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 349 | |
| 350 | clean-local:: |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 351 | ifneq ($(strip $(LIBNAME_LA)),) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 352 | $(VERB) $(RM) -f $(LIBNAME_LA) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 353 | endif |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 354 | |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 355 | DestSharedLib = $(libdir)/lib$(LIBRARYNAME)$(SHLIBEXT) |
| 356 | install-local:: install-shared-library |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 357 | |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 358 | install-shared-library: $(DestSharedLib) |
| 359 | |
| 360 | $(DestSharedLib): $(LIBNAME_LA) |
| 361 | @$(ECHO) Installing shared library $(DestSharedLib) |
| 362 | $(VERB) $(MKDIR) $(libdir) |
| 363 | $(VERB) $(LIBTOOL) --mode=install $(INSTALL) $(LIBNAME_LA) $(DestSharedLib) |
| 364 | $(VERB) $(LIBTOOL) --finish $(libdir) |
| 365 | |
| 366 | uninstall-local:: uninstall-shared-library |
| 367 | |
| 368 | uninstall-shared-library: |
| 369 | @$(ECHO) Uninstalling shared library $(DestSharedLib) |
| 370 | $(VERB) $(RM) -f $(DestSharedLib) |
| 371 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 372 | endif |
| 373 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 374 | #--------------------------------------------------------- |
| 375 | # Bytecode Library Targets: |
| 376 | # If the user asked for a bytecode library to be built |
| 377 | # with the BYTECODE_LIBRARY variable, then we provide |
| 378 | # targets for building them. |
| 379 | #--------------------------------------------------------- |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 380 | ifdef BYTECODE_LIBRARY |
| 381 | |
| 382 | ifdef EXPORTED_SYMBOL_LIST |
| 383 | BCLinkLib += -Xlinker -internalize-public-api-list=$(EXPORTED_SYMBOL_LIST) |
| 384 | else |
| 385 | ifdef EXPORTED_SYMBOL_FILE |
| 386 | BCLinkLib += -Xlinker -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE) |
| 387 | else |
| 388 | BCLinkLib += -Xlinker -disable-internalize |
| 389 | endif |
| 390 | endif |
| 391 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 392 | all-local:: $(LIBNAME_BC) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 393 | |
| 394 | $(LIBNAME_BC): $(BUILT_SOURCES) $(ObjectsBC) $(LIBDIR)/.dir |
| 395 | @$(ECHO) Linking bytecode library $(notdir $@) |
| 396 | $(VERB) $(BCLinkLib) -o $@ $(ObjectsBC) |
| 397 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 398 | clean-local:: |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 399 | ifneq ($(strip $(LIBNAME_BC)),) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 400 | $(VERB) $(RM) -f $(LIBNAME_BC) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 401 | endif |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 402 | |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 403 | DestBytecodeLib = $(bytecode_libdir)/lib$(LIBRARYNAME).bc |
| 404 | install-local:: install-bytecode-library |
Chris Lattner | 481cc7c | 2003-08-15 02:18:35 +0000 | [diff] [blame] | 405 | |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 406 | install-bytecode-library: $(DestBytecodeLib) |
| 407 | |
| 408 | $(DestBytecodeLib): $(LIBNAME_BC) $(bytecode_libdir) |
| 409 | @$(ECHO) Installing bytecode library $(DestBytecodeLib) |
| 410 | $(VERB) $(INSTALL) $< $@ |
| 411 | |
| 412 | uninstall-local:: uninstall-bytecode-library |
| 413 | |
| 414 | uninstall-bytecode-library: |
| 415 | @$(ECHO) Uninstalling bytecode library $(DestBytecodeLib) |
| 416 | $(VERB) $(RM) -f $(DestBytecodeLib) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 417 | |
| 418 | endif |
Vikram S. Adve | 60f5606 | 2002-08-02 18:34:12 +0000 | [diff] [blame] | 419 | |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 420 | # Does the library want a .o version built? |
Chris Lattner | e62dbe9 | 2002-07-23 17:56:16 +0000 | [diff] [blame] | 421 | ifndef DONT_BUILD_RELINKED |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 422 | all-local:: $(LIBNAME_O) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 423 | |
| 424 | $(LIBNAME_O): $(BUILT_SOURCES) $(ObjectsO) $(LIBDIR)/.dir |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 425 | @$(ECHO) Linking object library $(notdir $@) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 426 | $(VERB) $(Relink) -o $@ $(ObjectsO) |
| 427 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 428 | clean-local:: |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 429 | ifneq ($(strip $(LIBNAME_O)),) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 430 | $(VERB) $(RM) -f $(LIBNAME_O) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 431 | endif |
| 432 | |
| 433 | DestRelinkedLib = $(libdir)/$(LIBRARYNAME).o |
| 434 | |
| 435 | install-local:: install-relinked-library |
| 436 | |
| 437 | install-relinked-library: $(DestRelinkedLib) |
| 438 | |
| 439 | $(DestRelinkedLib): $(LIBNAME_O) |
| 440 | @$(ECHO) Installing object library $(DestRelinkedLib) |
| 441 | $(VERB) $(MKDIR) $(libdir) |
| 442 | $(VERB) $(LIBTOOL) --mode=install $(INSTALL) $(LIBNAME_O) $(DestRelinkedLib) |
| 443 | |
| 444 | uninstall-local:: uninstall-relinked-library |
| 445 | |
| 446 | uninstall-relinked-library: |
| 447 | @$(ECHO) Uninstalling object library $(DestRelinkedLib) |
| 448 | $(VERB) $(RM) -f $(DestRelinkedLib) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 449 | |
Chris Lattner | e62dbe9 | 2002-07-23 17:56:16 +0000 | [diff] [blame] | 450 | endif |
Chris Lattner | 760da06 | 2003-03-14 20:25:22 +0000 | [diff] [blame] | 451 | |
| 452 | # Does the library want an archive version built? |
Chris Lattner | e62dbe9 | 2002-07-23 17:56:16 +0000 | [diff] [blame] | 453 | ifdef BUILD_ARCHIVE |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 454 | all-local:: $(LIBNAME_A) |
Chris Lattner | e62dbe9 | 2002-07-23 17:56:16 +0000 | [diff] [blame] | 455 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 456 | $(LIBNAME_A): $(BUILT_SOURCES) $(ObjectsO) $(LIBDIR)/.dir |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 457 | @$(ECHO) Building archive library $(notdir $@) |
Reid Spencer | 37130d2 | 2004-10-04 07:05:07 +0000 | [diff] [blame] | 458 | $(VERB)$(RM) -f $@ |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 459 | $(VERB) $(Archive) $@ $(ObjectsO) |
| 460 | $(VERB) $(Ranlib) $@ |
Vikram S. Adve | 41e7891 | 2002-09-20 14:03:13 +0000 | [diff] [blame] | 461 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 462 | clean-local:: |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 463 | ifneq ($(strip $(LIBNAME_A)),) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 464 | $(VERB) $(RM) -f $(LIBNAME_A) |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 465 | endif |
| 466 | |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 467 | DestArchiveLib := $(libdir)/lib$(LIBRARYNAME).a |
| 468 | |
| 469 | install-local:: install-archive-library |
| 470 | |
| 471 | install-archive-library: $(DestArchiveLib) |
| 472 | |
| 473 | $(DestArchiveLib): $(LIBNAME_A) |
| 474 | @$(ECHO) Installing archive library $(DestArchiveLib) |
| 475 | $(VERB) $(MKDIR) $(libdir) |
| 476 | $(VERB) $(LIBTOOL) --mode=install $(INSTALL) $(LIBNAME_A) $(DestArchiveLib) |
| 477 | |
Reid Spencer | b1dd3dd | 2004-10-24 08:21:04 +0000 | [diff] [blame] | 478 | uninstall-local:: uninstall-archive-library |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 479 | |
| 480 | uninstall-archive-library: |
| 481 | @$(ECHO) Uninstalling archive library $(DestArchiveLib) |
| 482 | $(VERB) $(RM) -f $(DestArchiveLib) |
| 483 | |
| 484 | endif |
| 485 | |
| 486 | # endif LIBRARYNAME |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 487 | endif |
| 488 | |
Reid Spencer | b1dd3dd | 2004-10-24 08:21:04 +0000 | [diff] [blame] | 489 | ############################################################################### |
| 490 | # Tool Build Rules: Build executable tool based on TOOLNAME option |
| 491 | ############################################################################### |
| 492 | |
Chris Lattner | 1cbc29f | 2001-09-07 22:57:58 +0000 | [diff] [blame] | 493 | ifdef TOOLNAME |
| 494 | |
Reid Spencer | b1dd3dd | 2004-10-24 08:21:04 +0000 | [diff] [blame] | 495 | #--------------------------------------------------------- |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 496 | # TOOLLINKOPTSB to pass options to the linker like library search path etc |
| 497 | # Note that this is different from TOOLLINKOPTS, these options |
| 498 | # are passed to the linker *before* the USEDLIBS options are passed. |
| 499 | # e.g. usage TOOLLINKOPTSB = -L/home/xxx/lib |
Reid Spencer | b1dd3dd | 2004-10-24 08:21:04 +0000 | [diff] [blame] | 500 | #--------------------------------------------------------- |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 501 | ifdef TOOLLINKOPTSB |
| 502 | Link += $(TOOLLINKOPTSB) |
Reid Spencer | 37130d2 | 2004-10-04 07:05:07 +0000 | [diff] [blame] | 503 | endif |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 504 | |
Reid Spencer | b1dd3dd | 2004-10-24 08:21:04 +0000 | [diff] [blame] | 505 | # TOOLEXENAME - This is the output filenames to generate |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 506 | TOOLEXENAME := $(TOOLDIR)/$(TOOLNAME) |
Chris Lattner | 1cbc29f | 2001-09-07 22:57:58 +0000 | [diff] [blame] | 507 | |
Reid Spencer | b1dd3dd | 2004-10-24 08:21:04 +0000 | [diff] [blame] | 508 | # LIBS_OPTIONS - Compute the options lines that add -llib1 -llib2, etc. |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 509 | PROJ_LIBS_OPTIONS := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS))) |
| 510 | PROJ_LIBS_OPTIONS := $(patsubst %.o, $(LIBDIR)/%.o, $(PROJ_LIBS_OPTIONS)) |
| 511 | LLVM_LIBS_OPTIONS := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS))) |
| 512 | LLVM_LIBS_OPTIONS := $(patsubst %.o, $(LLVMLIBDIR)/%.o, $(LLVM_LIBS_OPTIONS)) |
Dinakar Dhurjati | ffb55cd | 2003-05-29 16:18:20 +0000 | [diff] [blame] | 513 | |
Reid Spencer | b1dd3dd | 2004-10-24 08:21:04 +0000 | [diff] [blame] | 514 | # USED_LIBS/LIBS_PATHS - Compute dependent library file paths |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 515 | PROJ_USED_LIBS := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS))) |
| 516 | LLVM_USED_LIBS := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS))) |
| 517 | PROJ_LIBS_PATHS := $(addprefix $(LIBDIR)/,$(PROJ_USED_LIBS)) |
| 518 | LLVM_LIBS_PATHS := $(addprefix $(LLVMLIBDIR)/,$(LLVM_USED_LIBS)) |
Dinakar Dhurjati | ffb55cd | 2003-05-29 16:18:20 +0000 | [diff] [blame] | 519 | |
Reid Spencer | b1dd3dd | 2004-10-24 08:21:04 +0000 | [diff] [blame] | 520 | # Concatenate all the optoins |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 521 | LINK_OPTS := $(TOOLLINKOPTS) $(PROJ_LIBS_OPTIONS) $(LLVM_LIBS_OPTIONS) |
John Criswell | fe785bd | 2004-09-16 14:11:25 +0000 | [diff] [blame] | 522 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 523 | # Handle compression libraries automatically |
| 524 | ifeq ($(HAVE_BZIP2),1) |
| 525 | LIBS += -lbz2 |
| 526 | endif |
| 527 | ifeq ($(HAVE_ZLIB),1) |
| 528 | LIBS += -lz |
| 529 | endif |
Dinakar Dhurjati | ffb55cd | 2003-05-29 16:18:20 +0000 | [diff] [blame] | 530 | |
Chris Lattner | 8d7dfb3 | 2003-01-22 16:13:31 +0000 | [diff] [blame] | 531 | # Tell make that we need to rebuild subdirectories before we can link the tool. |
| 532 | # This affects things like LLI which has library subdirectories. |
Reid Spencer | b1dd3dd | 2004-10-24 08:21:04 +0000 | [diff] [blame] | 533 | $(TOOLEXENAME): $(addsuffix /.makeall, $(PARALLEL_DIRS)) |
Chris Lattner | 8d7dfb3 | 2003-01-22 16:13:31 +0000 | [diff] [blame] | 534 | |
Reid Spencer | b1dd3dd | 2004-10-24 08:21:04 +0000 | [diff] [blame] | 535 | all-local:: $(TOOLEXENAME) |
John Criswell | 2a6530f | 2003-06-27 16:58:44 +0000 | [diff] [blame] | 536 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 537 | clean-local:: |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 538 | ifneq ($(strip $(TOOLEXENAME)),) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 539 | $(VERB) $(RM) -f $(TOOLEXENAME) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 540 | endif |
Chris Lattner | 1cbc29f | 2001-09-07 22:57:58 +0000 | [diff] [blame] | 541 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 542 | $(TOOLEXENAME): $(BUILT_SOURCES) $(ObjectsO) $(PROJ_LIBS_PATHS) $(LLVM_LIBS_PATHS) $(TOOLDIR)/.dir |
| 543 | @$(ECHO) Linking $(CONFIGURATION) executable $(TOOLNAME) $(STRIP_WARN_MSG) |
| 544 | $(VERB) $(Link) -o $@ $(ObjectsO) $(PROJ_LIBS_OPTIONS) $(LLVM_LIBS_OPTIONS) $(LIBS) |
| 545 | @$(ECHO) ======= Finished linking $(CONFIGURATION) executable $(TOOLNAME) $(STRIP_WARN_MSG) |
Chris Lattner | 1cbc29f | 2001-09-07 22:57:58 +0000 | [diff] [blame] | 546 | |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 547 | install-local:: install-tool |
| 548 | |
| 549 | DestTool = $(bindir)/$(TOOLNAME) |
| 550 | |
| 551 | install-tool: $(DestTool) |
| 552 | |
| 553 | $(DestTool): $(TOOLEXENAME) |
| 554 | @$(ECHO) Installing $(DestTool) |
| 555 | $(VERB) $(INSTALL) $(TOOLEXENAME) $(bindir) |
| 556 | |
| 557 | uninstall-local:: uninstall-tool |
| 558 | |
| 559 | uninstall-tool: |
| 560 | @$(ECHO) Uninstalling $(DestTool) |
| 561 | $(VERB) $(RM) -f $(DestTool) |
| 562 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 563 | endif |
Chris Lattner | 1cbc29f | 2001-09-07 22:57:58 +0000 | [diff] [blame] | 564 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 565 | ifndef DISABLE_AUTO_DEPENDENCIES |
Vikram S. Adve | 41e7891 | 2002-09-20 14:03:13 +0000 | [diff] [blame] | 566 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 567 | # Create .lo files in the OBJDIR directory from the .cpp and .c files... |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 568 | ifdef SHARED_LIBRARY |
| 569 | |
| 570 | $(OBJDIR)/%.lo $(OBJDIR)/%.o: %.cpp $(OBJDIR)/.dir |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 571 | @$(ECHO) "Compiling $(CONFIGURATION) $*.cpp For Shared Library" |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 572 | $(VERB) if $(LTCompile.CXX) -MD -MT $@ -MP -MF $(OBJDIR)/$*.LACXXd $< -o $@ ; \ |
| 573 | then $(MV) -f "$(OBJDIR)/$*.LACXXd" "$(OBJDIR)/$*.d"; \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 574 | else $(RM) -f "$(OBJDIR)/$*.LACXXd"; exit 1; fi |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 575 | |
| 576 | $(OBJDIR)/%.lo $(OBJDIR)/%.o: %.c $(OBJDIR)/.dir |
| 577 | @$(ECHO) "Compiling $(CONFIGURATION) $*.c For Shared Library" |
| 578 | $(VERB) if $(LTCompile.C) -MD -MT $@ -MP -MF $(OBJDIR)/$*.LACd $< -o $@ ; \ |
| 579 | then $(MV) -f "$(OBJDIR)/$*.LACd" "$(OBJDIR)/$*.d"; \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 580 | else $(RM) -f "$(OBJDIR)/$*.LACd"; exit 1; fi |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 581 | |
| 582 | else |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 583 | |
| 584 | $(OBJDIR)/%.o: %.cpp $(OBJDIR)/.dir |
| 585 | @$(ECHO) "Compiling $(CONFIGURATION) $*.cpp For Archive" |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 586 | $(VERB) if $(Compile.CXX) -MD -MT $@ -MP -MF $(OBJDIR)/$*.CXXd $< -o $@ ; \ |
| 587 | then $(MV) -f "$(OBJDIR)/$*.CXXd" "$(OBJDIR)/$*.d"; \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 588 | else $(RM) -f "$(OBJDIR)/$*.CXXd"; exit 1; fi |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 589 | |
| 590 | $(OBJDIR)/%.o: %.c $(OBJDIR)/.dir |
| 591 | @$(ECHO) "Compiling $(CONFIGURATION) $*.c For Archive" |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 592 | $(VERB) if $(Compile.C) -MD -MT $@ -MP -MF $(OBJDIR)/$*.Cd $< -o $@ ; \ |
| 593 | then $(MV) -f "$(OBJDIR)/$*.Cd" "$(OBJDIR)/$*.d"; \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 594 | else $(RM) -f "$(OBJDIR)/$*.Cd"; exit 1; fi |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 595 | |
| 596 | endif |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 597 | |
| 598 | # Create .bc files in the OBJDIR directory from .cpp and .c files... |
| 599 | $(OBJDIR)/%.bc: %.cpp $(OBJDIR)/.dir |
| 600 | @$(ECHO) "Compiling $(CONFIGURATION) $*.cpp to bytecode" |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 601 | $(VERB) if $(BCCompile.CXX) -MD -MT $@ -MP -MF "$(OBJDIR)/$*.BCCXXd" $< -o $@ ; \ |
| 602 | then $(MV) -f "$(OBJDIR)/$*.BCCXXd" "$(OBJDIR)/$*.d"; \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 603 | else $(RM) -f "$(OBJDIR)/$*.BCCXXd"; exit 1; fi |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 604 | |
| 605 | $(OBJDIR)/%.bc: %.c $(OBJDIR)/.dir |
| 606 | @$(ECHO) "Compiling $(CONFIGURATION) $*.c to bytecode" |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 607 | $(VERB) if $(BCCompile.C) -MD -MT $@ -MP -MF "$(OBJDIR)/$*.BCCd" $< -o $@ ; \ |
| 608 | then $(MV) -f "$(OBJDIR)/$*.BCCd" "$(OBJDIR)/$*.d"; \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 609 | else $(RM) -f "$(OBJDIR)/$*.BCCd"; exit 1; fi |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 610 | |
| 611 | else |
| 612 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 613 | ifdef SHARED_LIBRARY |
| 614 | |
| 615 | $(OBJDIR)/%.lo $(OBJDIR)/%.o: %.cpp $(OBJDIR)/.dir |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 616 | @$(ECHO) "Compiling $(CONFIGURATION) $*.cpp For Shared Library" |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 617 | $(LTCompile.CXX) $< -o $@ |
| 618 | |
| 619 | $(OBJDIR)/%.lo $(OBJDIR)/%.o: %.c $(OBJDIR)/.dir |
| 620 | @$(ECHO) "Compiling $(CONFIGURATION) $*.cpp For Shared Library" |
| 621 | $(LTCompile.C) $< -o $@ |
| 622 | |
| 623 | else |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 624 | |
| 625 | $(OBJDIR)/%.o: %.cpp $(OBJDIR)/.dir |
| 626 | @$(ECHO) "Compiling $(CONFIGURATION) $*.cpp For Archive" |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 627 | $(Compile.CXX) $< -o $@ |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 628 | |
| 629 | $(OBJDIR)/%.o: %.c $(OBJDIR)/.dir |
| 630 | @$(ECHO) "Compiling $(CONFIGURATION) $*.cpp For Archive" |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 631 | $(Compile.C) $< -o $@ |
| 632 | endif |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 633 | |
| 634 | # Create .bc files in the OBJDIR directory from .cpp and .c files... |
| 635 | $(OBJDIR)/%.bc: %.cpp $(OBJDIR)/.dir |
| 636 | @$(ECHO) "Compiling $(CONFIGURATION) $*.cpp To Bytecode" |
| 637 | $(BCCompileCPP) $< -o $@ |
| 638 | |
| 639 | $(OBJDIR)/%.bc: %.c $(OBJDIR)/.dir |
| 640 | @$(ECHO) "Compiling $(CONFIGURATION) $*.c To Bytecode" |
| 641 | $(BCCompileC) $< -o $@ |
Brian Gaeke | 44909cf | 2003-12-10 00:26:28 +0000 | [diff] [blame] | 642 | |
Chris Lattner | 1cbc29f | 2001-09-07 22:57:58 +0000 | [diff] [blame] | 643 | endif |
| 644 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 645 | $(OBJDIR)/%.bc: %.ll $(OBJDIR)/.dir $(LLVMAS) |
| 646 | @$(ECHO) "Compiling $*.ll To Bytecode" |
Chris Lattner | 481cc7c | 2003-08-15 02:18:35 +0000 | [diff] [blame] | 647 | $(VERB) $(LLVMAS) $< -f -o $@ |
| 648 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 649 | ifdef TARGET |
| 650 | |
Reid Spencer | c64b2b3 | 2004-10-23 08:19:37 +0000 | [diff] [blame] | 651 | TDFILES := $(strip $(wildcard $(BUILD_SRC_DIR)/*.td) $(LLVM_SRC_ROOT)/lib/Target/Target.td) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 652 | |
| 653 | $(BUILT_SOURCES): $(TDFILES) |
| 654 | |
| 655 | %GenRegisterNames.inc : %.td |
| 656 | @echo "Building $(<F) register names with tblgen" |
| 657 | $(VERB) $(TableGen) -gen-register-enums -o $@ $< |
| 658 | |
| 659 | %GenRegisterInfo.h.inc : %.td |
| 660 | @echo "Building $(<F) register information header with tblgen" |
| 661 | $(VERB) $(TableGen) -gen-register-desc-header -o $@ $< |
| 662 | |
| 663 | %GenRegisterInfo.inc : %.td |
| 664 | @echo "Building $(<F) register info implementation with tblgen" |
| 665 | $(VERB) $(TableGen) -gen-register-desc -o $@ $< |
| 666 | |
| 667 | %GenInstrNames.inc : %.td |
| 668 | @echo "Building $(<F) instruction names with tblgen" |
| 669 | $(VERB) $(TableGen) -gen-instr-enums -o $@ $< |
| 670 | |
| 671 | %GenInstrInfo.inc : %.td |
| 672 | @echo "Building $(<F) instruction information with tblgen" |
| 673 | $(VERB) $(TableGen) -gen-instr-desc -o $@ $< |
| 674 | |
| 675 | %GenAsmWriter.inc : %.td |
| 676 | @echo "Building $(<F) assembly writer with tblgen" |
| 677 | $(VERB) $(TableGen) -gen-asm-writer -o $@ $< |
| 678 | |
| 679 | %GenATTAsmWriter.inc : %.td |
| 680 | @echo "Building $(<F) AT&T assembly writer with tblgen" |
| 681 | $(VERB) $(TableGen) -gen-asm-writer -o $@ $< |
| 682 | |
| 683 | %GenIntelAsmWriter.inc : %.td |
| 684 | @echo "Building $(<F) Intel assembly writer with tblgen" |
| 685 | $(VERB) $(TableGen) -gen-asm-writer -asmwriternum=1 -o $@ $< |
| 686 | |
| 687 | %GenInstrSelector.inc: %.td |
| 688 | @echo "Building $(<F) instruction selector with tblgen" |
| 689 | $(VERB) $(TableGen) -gen-instr-selector -o $@ $< |
| 690 | |
| 691 | %GenCodeEmitter.inc:: %.td |
| 692 | @echo "Building $(<F) code emitter with tblgen" |
| 693 | $(VERB) $(TableGen) -gen-emitter -o $@ $< |
| 694 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 695 | clean-local:: |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 696 | $(VERB) rm -f *.inc |
| 697 | |
| 698 | endif |
Chris Lattner | 481cc7c | 2003-08-15 02:18:35 +0000 | [diff] [blame] | 699 | |
Chris Lattner | e899678 | 2003-01-16 22:44:19 +0000 | [diff] [blame] | 700 | # |
| 701 | # Rules for building lex/yacc files |
| 702 | # |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 703 | LEX_FILES = $(filter %.l, $(SOURCES)) |
Chris Lattner | e899678 | 2003-01-16 22:44:19 +0000 | [diff] [blame] | 704 | LEX_OUTPUT = $(LEX_FILES:%.l=%.cpp) |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 705 | YACC_FILES = $(filter %.y, $(SOURCES)) |
Chris Lattner | e899678 | 2003-01-16 22:44:19 +0000 | [diff] [blame] | 706 | YACC_OUTPUT = $(addprefix $(YACC_FILES:%.y=%), .h .cpp .output) |
| 707 | .PRECIOUS: $(LEX_OUTPUT) $(YACC_OUTPUT) |
| 708 | |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 709 | # Create a .cpp source file from a flex input file... this uses sed to cut down |
| 710 | # on the warnings emited by GCC... |
Chris Lattner | 6d131b4 | 2003-01-23 16:33:10 +0000 | [diff] [blame] | 711 | # |
| 712 | # The last line is a gross hack to work around flex aparently not being able to |
| 713 | # resize the buffer on a large token input. Currently, for uninitialized string |
| 714 | # buffers in LLVM we can generate very long tokens, so this is a hack around it. |
Chris Lattner | b7dc2b9 | 2003-08-15 20:00:47 +0000 | [diff] [blame] | 715 | # FIXME. (f.e. char Buffer[10000] ) |
Chris Lattner | 6d131b4 | 2003-01-23 16:33:10 +0000 | [diff] [blame] | 716 | # |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 717 | %.cpp: %.l |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 718 | @$(ECHO) Flexing $< |
Chris Lattner | 7bb107d | 2003-08-04 19:48:10 +0000 | [diff] [blame] | 719 | $(VERB) $(FLEX) -t $< | \ |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 720 | $(SED) '/^find_rule/d' | \ |
| 721 | $(SED) 's/void yyunput/inline void yyunput/' | \ |
| 722 | $(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \ |
| 723 | $(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' \ |
| 724 | > $@.tmp |
| 725 | $(VERB) cmp -s $@ $@.tmp > /dev/null || $(MV) -f $@.tmp $@ |
Chris Lattner | a328f88 | 2003-08-04 19:47:06 +0000 | [diff] [blame] | 726 | @# remove the output of flex if it didn't get moved over... |
| 727 | @rm -f $@.tmp |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 728 | |
| 729 | # Rule for building the bison parsers... |
Chris Lattner | 694c5df | 2003-05-15 21:28:55 +0000 | [diff] [blame] | 730 | %.c: %.y # Cancel built-in rules for yacc |
| 731 | %.h: %.y # Cancel built-in rules for yacc |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 732 | %.cpp %.h : %.y |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 733 | @$(ECHO) "Bisoning $*.y" |
John Criswell | 410d1b5 | 2003-09-09 20:57:03 +0000 | [diff] [blame] | 734 | $(VERB) $(BISON) -v -d -p $(<F:%Parser.y=%) -o $*.tab.c $< |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 735 | $(VERB) cmp -s $*.tab.c $*.cpp > /dev/null || $(MV) -f $*.tab.c $*.cpp |
| 736 | $(VERB) cmp -s $*.tab.h $*.h > /dev/null || $(MV) -f $*.tab.h $*.h |
Chris Lattner | a328f88 | 2003-08-04 19:47:06 +0000 | [diff] [blame] | 737 | @# If the files were not updated, don't leave them lying around... |
| 738 | @rm -f $*.tab.c $*.tab.h |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 739 | |
| 740 | # To create the directories... |
| 741 | %/.dir: |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 742 | $(VERB) $(MKDIR) $* > /dev/null |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 743 | @$(DATE) > $@ |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 744 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 745 | .PRECIOUS: $(OBJDIR)/.dir $(LIBDIR)/.dir $(TOOLDIR)/.dir $(LLVMLIBDIR)/.dir |
| 746 | .PRECIOUS: $(LLVMTOOLDIR)/.dir |
| 747 | |
Chris Lattner | 30440c6 | 2003-01-16 21:06:18 +0000 | [diff] [blame] | 748 | # To create postscript files from dot files... |
John Criswell | e0f9ac6 | 2003-10-02 19:02:02 +0000 | [diff] [blame] | 749 | ifneq ($(DOT),false) |
Chris Lattner | 30440c6 | 2003-01-16 21:06:18 +0000 | [diff] [blame] | 750 | %.ps: %.dot |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 751 | $(DOT) -Tps < $< > $@ |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 752 | else |
| 753 | %.ps: %.dot |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 754 | $(ECHO) "Cannot build $@: The program dot is not installed" |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 755 | endif |
Chris Lattner | 30440c6 | 2003-01-16 21:06:18 +0000 | [diff] [blame] | 756 | |
John Criswell | 7f33695 | 2003-09-06 14:44:17 +0000 | [diff] [blame] | 757 | # |
| 758 | # This rules ensures that header files that are removed still have a rule for |
| 759 | # which they can be "generated." This allows make to ignore them and |
| 760 | # reproduce the dependency lists. |
| 761 | # |
John Criswell | 4b6e5d1 | 2003-09-18 18:37:08 +0000 | [diff] [blame] | 762 | %.h:: ; |
John Criswell | 7f33695 | 2003-09-06 14:44:17 +0000 | [diff] [blame] | 763 | |
Chris Lattner | 172b648 | 2002-09-22 02:47:15 +0000 | [diff] [blame] | 764 | # 'make clean' nukes the tree |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 765 | clean-local:: |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 766 | ifneq ($(strip $(OBJDIR)),) |
Reid Spencer | 83cbcb9 | 2004-10-24 02:26:09 +0000 | [diff] [blame] | 767 | $(VERB) $(RM) -rf $(OBJDIR) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 768 | endif |
Brian Gaeke | 9d3cd40 | 2004-01-21 19:53:11 +0000 | [diff] [blame] | 769 | $(VERB) $(RM) -f core core.[0-9][0-9]* *.o *.d *~ *.flc |
| 770 | ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set |
| 771 | $(VERB) $(RM) -f *$(SHLIBEXT) |
| 772 | endif |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 773 | ifneq ($(strip $(LEX_OUTPUT)),) |
| 774 | $(VERB) $(RM) -f $(LEX_OUTPUT) |
| 775 | endif |
| 776 | ifneq ($(strip $(YACC_OUTPUT)),) |
| 777 | $(VERB) $(RM) -f $(YACC_OUTPUT) |
| 778 | endif |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 779 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 780 | ############################################################################### |
| 781 | # DEPENDENCIES: Include the dependency files if we should |
| 782 | ############################################################################### |
Chris Lattner | 33ad24a | 2003-08-22 14:10:16 +0000 | [diff] [blame] | 783 | ifndef DISABLE_AUTO_DEPENDENCIES |
| 784 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 785 | # If its not one of the cleaning targets |
| 786 | ifneq ($strip($(filter-out clean clean-local dist-clean, $(MAKECMDGOALS))),) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 787 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 788 | # Get the list of dependency files |
| 789 | DependFiles := $(basename $(filter %.cpp %.c %.cc, $(SOURCES))) |
| 790 | DependFiles := $(patsubst %,$(BUILD_OBJ_DIR)/$(CONFIGURATION)/%.d,$(DependFiles)) |
Misha Brukman | 4f7a8cf | 2003-11-09 21:36:19 +0000 | [diff] [blame] | 791 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 792 | -include /dev/null $(DependFiles) |
| 793 | |
John Criswell | d741bcf | 2003-08-12 18:51:51 +0000 | [diff] [blame] | 794 | endif |
Chris Lattner | 1ddb6b6 | 2003-08-18 17:27:40 +0000 | [diff] [blame] | 795 | |
Chris Lattner | 33ad24a | 2003-08-22 14:10:16 +0000 | [diff] [blame] | 796 | endif # ifndef DISABLE_AUTO_DEPENDENCIES |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 797 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 798 | ################################################################################ |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 799 | # PRECONDITIONS - that which must be built/checked first |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 800 | ################################################################################ |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 801 | |
| 802 | OBJMKFILE := $(BUILD_OBJ_DIR)/Makefile |
| 803 | SRCMKFILE := $(BUILD_SRC_DIR)/Makefile |
| 804 | CONFIGURE := $(LLVM_SRC_ROOT)/configure |
| 805 | CONFIG_STATUS := $(LLVM_OBJ_ROOT)/config.status |
| 806 | MAKE_CONFIG_IN := $(LLVM_SRC_ROOT)/Makefile.config.in |
| 807 | MAKE_CONFIG := $(LLVM_OBJ_ROOT)/Makefile.config |
| 808 | |
| 809 | #------------------------------------------------------------------------ |
| 810 | # List of the preconditions |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 811 | #------------------------------------------------------------------------ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 812 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 813 | preconditions: $(CONFIG_STATUS) $(MAKE_CONFIG) $(OBJMKFILE) |
| 814 | |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 815 | $(filter-out clean clean-local,USER_TARGETS):: $(BUILT_SOURCES) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 816 | |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 817 | clean-local:: |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 818 | ifneq ($(strip $(BUILT_SOURCES)),) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 819 | $(VERB) $(RM) -f $(BUILT_SOURCES) |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 820 | endif |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 821 | |
| 822 | #------------------------------------------------------------------------ |
| 823 | # Make sure we're not using a stale configuration |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 824 | #------------------------------------------------------------------------ |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 825 | .PRECIOUS: $(CONFIG_STATUS) |
| 826 | $(CONFIG_STATUS): $(CONFIGURE) |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 827 | @$(ECHO) Reconfiguring with $< |
| 828 | $(VERB) $(CONFIG_STATUS) --recheck $(CONFIGUREFLAGS) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 829 | |
| 830 | #------------------------------------------------------------------------ |
| 831 | # Make sure the configuration makefile is up to date |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 832 | #------------------------------------------------------------------------ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 833 | $(MAKE_CONFIG): $(MAKE_CONFIG_IN) $(CONFIG_STATUS) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 834 | @$(ECHO) Regenerating $@ |
| 835 | $(VERB) cd $(LLVM_OBJ_ROOT) ; $(CONFIG_STATUS) Makefile.config |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 836 | |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 837 | #------------------------------------------------------------------------ |
| 838 | # If the Makefile in the source tree has been updated, copy it over into the |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 839 | # build tree. But, only do this if the source and object makefiles differ |
| 840 | #------------------------------------------------------------------------ |
Reid Spencer | e53e397 | 2004-10-22 23:06:30 +0000 | [diff] [blame] | 841 | ifneq ($(OBJMKFILE),$(SRCMKFILE)) |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 842 | .PRECIOUS: $(OBJMKFILE) |
| 843 | $(OBJMKFILE): $(SRCMKFILE) |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 844 | @$(ECHO) "Updating Makefile from: $(dir $<)" |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 845 | $(VERB) $(MKDIR) $(@D) |
| 846 | $(VERB) cp -f $< $@ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 847 | endif |
| 848 | |
| 849 | ############################################################################### |
| 850 | # Handle construction of a distribution tarball |
| 851 | ############################################################################### |
| 852 | |
| 853 | .PHONY: dist dist-chck dist-clean distdir dist-gzip dist-bzip2 dist-zip |
| 854 | |
| 855 | ifeq ($(BUILD_SRC_DIR),$(BUILD_OBJ_DIR)) |
| 856 | |
| 857 | dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip :: |
| 858 | @$(ECHO) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR |
| 859 | |
| 860 | else |
| 861 | |
| 862 | ifeq ($(LLVM_TARBALL_NAME),) |
| 863 | $(error LLVM_TARBALL_NAME is empty) |
| 864 | endif |
| 865 | |
| 866 | ifneq ($(LEVEL),.) |
| 867 | |
| 868 | dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip :: |
| 869 | @$(ECHO) ERROR: You must run $@ from $(BUILD_OBJ_ROOT) |
| 870 | |
| 871 | DistTopCheck := |
| 872 | |
| 873 | else |
| 874 | |
| 875 | DistTopCheck := check |
| 876 | |
| 877 | dist-gzip: distdir |
| 878 | @$(ECHO) Packing gzipped distribution tar file. |
| 879 | $(VERB) $(TAR) chf - "$(TopDistDir)" | gzip -c > "$(DistTarGZip)" |
| 880 | |
| 881 | dist-bzip2: distdir |
| 882 | @$(ECHO) Packing bzipped distribution tar file. |
| 883 | $(VERB) $(TAR) chf - $(DistName) | $(BZIP2) -c >$(DistTarBZ2) |
| 884 | |
| 885 | dist-zip: distdir |
| 886 | @$(ECHO) Packing zipped distribution file. |
| 887 | $(VERB) rm -f $(DistZip) |
| 888 | $(VERB) $(ZIP) -rq $(DistZip) $(DistName) |
| 889 | |
| 890 | dist :: distdir |
| 891 | @$(ECHO) Packing gzipped distribution tar file. |
| 892 | $(VERB) $(TAR) chf - $(DistName) | $(GZIP) -c >$(DistTarGZip) |
| 893 | @$(ECHO) Packing bzipped distribution tar file. |
| 894 | $(VERB) $(TAR) chf - $(DistName) | $(BZIP2) -c >$(DistTarBZ2) |
| 895 | @$(ECHO) Packing zipped distribution file. |
| 896 | $(VERB) rm -f $(DistZip) |
| 897 | $(VERB) $(ZIP) -rq $(DistZip) $(DistName) |
| 898 | @$(ECHO) ===== DISTRIBUTION PACKAGING SUCESSFUL ===== |
| 899 | |
| 900 | dist-check:: dist |
| 901 | |
| 902 | dist-clean:: |
| 903 | @$(ECHO) Cleaning distribution files |
| 904 | $(VERB) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) |
| 905 | |
| 906 | endif |
| 907 | |
| 908 | DistName := $(LLVM_TARBALL_NAME) |
| 909 | DistDir := $(BUILD_OBJ_ROOT)/$(DistName) |
| 910 | TopDistDir := $(DistDir) |
| 911 | DistTarGZip := $(BUILD_OBJ_ROOT)/$(DistName).tar.gz |
| 912 | DistZip := $(BUILD_OBJ_ROOT)/$(DistName).zip |
| 913 | DistTarBZ2 := $(BUILD_OBJ_ROOT)/$(DistName).tar.bz2 |
| 914 | DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \ |
| 915 | ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \ |
| 916 | Makefile.config.in |
| 917 | DistSources := $(filter-out projects,$(SOURCES) $(EXTRA_DIST)) |
| 918 | DistSubDirs := $(filter-out projects,$(SUBDIRS)) |
| 919 | DistFiles := $(DistAlways) $(DistSources) |
| 920 | RmDistDir := { test ! -d $(DistDir) || { \ |
| 921 | find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' \ |
| 922 | && rm -rf $(DistDir); }; } |
| 923 | |
| 924 | distdir : $(DistTopCheck) $(DistSources) |
| 925 | @$(ECHO) Building Distribution Directory $(DistDir) |
| 926 | $(VERB) $(RmDistDir) |
| 927 | $(VERB) $(MKDIR) $(DistDir) |
| 928 | $(VERB) srcdirstrip=`echo "$(BUILD_SRC_DIR)" | sed 's|.|.|g'`; \ |
| 929 | srcrootstrip=`echo "$(BUILD_SRC_ROOT)" | sed 's|.|.|g'`; \ |
| 930 | for file in $(DistFiles) ; do \ |
| 931 | case "$$file" in \ |
| 932 | $(BUILD_SRC_DIR)/*) file=`echo "$$file" | sed "s#^$$srcdirstrip/##"`;; \ |
| 933 | $(BUILD_SRC_ROOT)/*) file=`echo "$$file" | sed "s#^$srcrootstrip/#$(BUILD_OBJ_ROOT)/#"`;; \ |
| 934 | esac; \ |
| 935 | if test -f "$$file" || test -d "$$file" ; then \ |
| 936 | from_dir=. ; \ |
| 937 | else \ |
| 938 | from_dir=$(BUILD_SRC_DIR); \ |
| 939 | fi; \ |
| 940 | to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'`; \ |
| 941 | if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \ |
| 942 | to_dir="$(DistDir)/$$dir"; \ |
| 943 | $(MKDIR) "$$to_dir" ; \ |
| 944 | else \ |
| 945 | to_dir="$(DistDir)"; \ |
| 946 | fi; \ |
| 947 | mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \ |
| 948 | if test -n "$$mid_dir" ; then \ |
| 949 | $(MKDIR) "$$to_dir/$$mid_dir" ; \ |
| 950 | fi ; \ |
| 951 | if test -d "$$from_dir/$$file"; then \ |
| 952 | if test -d "$(BUILD_SRC_DIR)/$$file" && \ |
| 953 | test "$$from_dir" != "$(BUILD_SRC_DIR)" ; then \ |
| 954 | cp -pR "$(BUILD_SRC_DIR)/$$file" "$$to_dir" || exit 1; \ |
| 955 | fi; \ |
| 956 | cp -pR $$from_dir/$$file $$to_dir || exit 1; \ |
| 957 | elif test -f "$$from_dir/$$file" ; then \ |
| 958 | cp -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \ |
| 959 | elif test -L "$$from_dir/$$file" ; then \ |
| 960 | cp -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \ |
| 961 | elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \ |
| 962 | $(ECHO) "===== WARNING: Distribution Source $$from_dir/$$file Not Found!" ; \ |
| 963 | elif test "$(VERB)" != '@' ; then \ |
| 964 | $(ECHO) "Skipping non-existent $$from_dir/$$file" ; \ |
| 965 | fi; \ |
| 966 | done |
| 967 | $(VERB) for subdir in $(SUBDIRS) ; do \ |
| 968 | if test "$$subdir" \!= "." ; then \ |
| 969 | test -d "$(DistDir)/$$subdir" || $(MKDIR) "$(DistDir)/$$subdir" || exit 1; \ |
| 970 | new_distdir="$(DistDir)/$$subdir" ; \ |
| 971 | ( cd $$subdir && $(MAKE) DistDir="$$new_distdir" distdir ) || exit 1; \ |
| 972 | fi; \ |
| 973 | done |
| 974 | $(VERB) $(MAKE) DistDir="$(DistDir)" dist-hook |
| 975 | -$(VERB) find $(DistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ |
| 976 | ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ |
| 977 | ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ |
| 978 | ! -type d ! -perm -444 -exec $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \ |
| 979 | || chmod -R a+r $(DistDir) |
| 980 | |
| 981 | dist-hook:: |
| 982 | |
| 983 | |
Reid Spencer | e53e397 | 2004-10-22 23:06:30 +0000 | [diff] [blame] | 984 | endif |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 985 | |
| 986 | ############################################################################### |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 987 | # TOP LEVEL - targets only to apply at the top level directory |
| 988 | ############################################################################### |
| 989 | |
| 990 | ifeq ($(LEVEL),.) |
| 991 | |
| 992 | #------------------------------------------------------------------------ |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 993 | # Install support for project's include files: |
| 994 | #------------------------------------------------------------------------ |
| 995 | install-local:: |
| 996 | @$(ECHO) Installing include files |
| 997 | $(VERB) $(MKDIR) $(includedir) |
| 998 | $(VERB) if [ -d "$(BUILD_SRC_ROOT)/include" ] ; then \ |
| 999 | cd $(BUILD_SRC_ROOT)/include && \ |
| 1000 | find . -path '*/Internal' -prune -o '(' -type f \ |
| 1001 | '!' '(' -name '*~' -o -name '.cvsignore' -o -name '.#*' ')' \ |
| 1002 | -print ')' | grep -v CVS | pax -rwdvpe $(includedir) ; \ |
| 1003 | fi |
| 1004 | |
| 1005 | uninstall-local:: |
| 1006 | @$(ECHO) Uninstalling include files |
| 1007 | $(VERB) if [ -d "$(BUILD_SRC_ROOT)/include" ] ; then \ |
| 1008 | cd $(BUILD_SRC_ROOT)/include && \ |
| 1009 | $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \ |
| 1010 | '!' '(' -name '*~' -o -name '.cvsignore' -o -name '.#*' ')' \ |
| 1011 | -print ')' | grep -v CVS | sed 's#^#$(includedir)/#'` ; \ |
| 1012 | fi |
| 1013 | |
| 1014 | #------------------------------------------------------------------------ |
| 1015 | # Build tags database for Emacs/Xemacs: |
| 1016 | #------------------------------------------------------------------------ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 1017 | tags:: TAGS |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 1018 | |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 1019 | TAGS: |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 1020 | find include lib tools examples -name '*.cpp' -o -name '*.h' | $(ETAGS) $(ETAGSFLAGS) - |
| 1021 | |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 1022 | endif |
| 1023 | |
| 1024 | ############################################################################### |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 1025 | # MISCELLANEOUS - utility targets |
| 1026 | ############################################################################### |
| 1027 | |
| 1028 | #------------------------------------------------------------------------ |
| 1029 | # Print out the directories used for building |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 1030 | printvars:: |
Reid Spencer | 4d71b66 | 2004-10-22 21:01:56 +0000 | [diff] [blame] | 1031 | @$(ECHO) "BUILD_SRC_ROOT: " $(BUILD_SRC_ROOT) |
| 1032 | @$(ECHO) "BUILD_SRC_DIR : " $(BUILD_SRC_DIR) |
| 1033 | @$(ECHO) "BUILD_OBJ_ROOT: " $(BUILD_OBJ_ROOT) |
| 1034 | @$(ECHO) "BUILD_OBJ_DIR : " $(BUILD_OBJ_DIR) |
| 1035 | @$(ECHO) "LLVM_SRC_ROOT : " $(LLVM_SRC_ROOT) |
| 1036 | @$(ECHO) "LLVM_OBJ_ROOT : " $(LLVM_OBJ_ROOT) |
| 1037 | @$(ECHO) "CONFIGURATION : " $(CONFIGURATION) |
| 1038 | @$(ECHO) "OBJDIR: " $(OBJDIR) |
| 1039 | @$(ECHO) "LIBDIR: " $(LIBDIR) |
| 1040 | @$(ECHO) "TOOLDIR: " $(TOOLDIR) |
| 1041 | @$(ECHO) "TDFILES:" '$(TDFILES)' |
Reid Spencer | 3a561f5 | 2004-10-23 20:04:14 +0000 | [diff] [blame] | 1042 | @$(ECHO) "Compile.CXX: " '$(Compile.CXX)' |
| 1043 | @$(ECHO) "Compile.C: " '$(Compile.C)' |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 1044 | |
| 1045 | # This frivolous target provided for Resistor who requested that the makefiles |
| 1046 | # be hardened and that he get a "pony" after the makefiles (accidentally) |
| 1047 | # deleted his unix kernel. |
| 1048 | pony:: |
| 1049 | @wget -q \ |
Reid Spencer | 151f8ba | 2004-10-25 08:27:37 +0000 | [diff] [blame^] | 1050 | http://search.cpan.org/src/ASAVIGE/Acme-EyeDrops-1.40/lib/Acme/EyeDrops/pony2.eye \ |
| 1051 | -O /tmp/resistor.pony |
Reid Spencer | e5487ba | 2004-10-24 07:53:21 +0000 | [diff] [blame] | 1052 | @cat /tmp/resistor.pony |