Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 1 | #---------------------------------------------------------------------- |
| 2 | # Clients fill in the source files to build |
| 3 | #---------------------------------------------------------------------- |
| 4 | # C_SOURCES := main.c |
| 5 | # CXX_SOURCES := |
| 6 | # OBJC_SOURCES := |
| 7 | # OBJCXX_SOURCES := |
| 8 | # DYLIB_C_SOURCES := |
Johnny Chen | e9f9770 | 2012-01-11 01:42:58 +0000 | [diff] [blame] | 9 | # DYLIB_CXX_SOURCES := |
| 10 | # |
| 11 | # Specifying DYLIB_ONLY has the effect of building dylib only, skipping |
| 12 | # the building of the a.out executable program. For example, |
| 13 | # DYLIB_ONLY := YES |
| 14 | # |
Johnny Chen | 64a7e74 | 2012-01-17 00:58:08 +0000 | [diff] [blame] | 15 | # Also might be of interest: |
Johnny Chen | 4876b5f | 2012-01-11 01:59:55 +0000 | [diff] [blame] | 16 | # FRAMEWORK_INCLUDES (Darwin only) := |
| 17 | # CFLAGS_EXTRAS := |
| 18 | # LD_EXTRAS := |
Johnny Chen | 64a7e74 | 2012-01-17 00:58:08 +0000 | [diff] [blame] | 19 | # |
| 20 | # And test/functionalities/archives/Makefile: |
| 21 | # MAKE_DSYM := NO |
| 22 | # ARCHIVE_NAME := libfoo.a |
| 23 | # ARCHIVE_C_SOURCES := a.c b.c |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 24 | |
| 25 | # Uncomment line below for debugging shell commands |
| 26 | # SHELL = /bin/sh -x |
| 27 | |
| 28 | #---------------------------------------------------------------------- |
Johnny Chen | 6c17c08 | 2010-09-16 20:54:06 +0000 | [diff] [blame] | 29 | # If ARCH is not defined, default to x86_64. |
Peter Collingbourne | 518f03d | 2011-06-20 19:06:04 +0000 | [diff] [blame] | 30 | # If OS is not defined, use 'uname -s' to determine the OS name. |
Johnny Chen | 6c17c08 | 2010-09-16 20:54:06 +0000 | [diff] [blame] | 31 | #---------------------------------------------------------------------- |
| 32 | ifeq "$(ARCH)" "" |
| 33 | ARCH = x86_64 |
| 34 | endif |
| 35 | |
Peter Collingbourne | 518f03d | 2011-06-20 19:06:04 +0000 | [diff] [blame] | 36 | ifeq "$(OS)" "" |
| 37 | OS = $(shell uname -s) |
| 38 | endif |
| 39 | |
Johnny Chen | 6c17c08 | 2010-09-16 20:54:06 +0000 | [diff] [blame] | 40 | #---------------------------------------------------------------------- |
Johnny Chen | 597cbbb | 2011-08-23 21:54:10 +0000 | [diff] [blame] | 41 | # CC defaults to clang. |
Johnny Chen | 4ab4a9b | 2011-08-24 18:12:53 +0000 | [diff] [blame] | 42 | # |
| 43 | # If you change the defaults of CC, be sure to also change it in the file |
| 44 | # test/plugins/builder_base.py, which provides a Python way to return the |
| 45 | # value of the make variable CC -- getCompiler(). |
| 46 | # |
Johnny Chen | 6055b44 | 2011-01-14 20:55:13 +0000 | [diff] [blame] | 47 | # See also these functions: |
| 48 | # o cxx_compiler |
| 49 | # o cxx_linker |
Johnny Chen | d43e208 | 2011-01-14 20:46:49 +0000 | [diff] [blame] | 50 | #---------------------------------------------------------------------- |
Johnny Chen | 597cbbb | 2011-08-23 21:54:10 +0000 | [diff] [blame] | 51 | CC ?= clang |
Johnny Chen | d43e208 | 2011-01-14 20:46:49 +0000 | [diff] [blame] | 52 | ifeq "$(CC)" "cc" |
Johnny Chen | 597cbbb | 2011-08-23 21:54:10 +0000 | [diff] [blame] | 53 | CC = clang |
Johnny Chen | d43e208 | 2011-01-14 20:46:49 +0000 | [diff] [blame] | 54 | endif |
| 55 | |
| 56 | #---------------------------------------------------------------------- |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 57 | # Change any build/tool options needed |
| 58 | #---------------------------------------------------------------------- |
Peter Collingbourne | 518f03d | 2011-06-20 19:06:04 +0000 | [diff] [blame] | 59 | CFLAGS ?= -gdwarf-2 -O0 |
Johnny Chen | beac8f9 | 2012-01-10 00:41:11 +0000 | [diff] [blame] | 60 | CFLAGS += $(FRAMEWORK_INCLUDES) $(CFLAGS_EXTRAS) |
Peter Collingbourne | 518f03d | 2011-06-20 19:06:04 +0000 | [diff] [blame] | 61 | ifeq "$(OS)" "Darwin" |
| 62 | CFLAGS += -arch $(ARCH) |
Greg Clayton | 3bffb08 | 2011-12-10 02:15:28 +0000 | [diff] [blame] | 63 | DS := dsymutil |
Peter Collingbourne | 518f03d | 2011-06-20 19:06:04 +0000 | [diff] [blame] | 64 | DSFLAGS = |
| 65 | DSYM = $(EXE).dSYM |
Johnny Chen | fe14162 | 2012-01-12 23:09:42 +0000 | [diff] [blame] | 66 | AR := libtool |
| 67 | ARFLAGS := -static -o |
Peter Collingbourne | 518f03d | 2011-06-20 19:06:04 +0000 | [diff] [blame] | 68 | endif |
| 69 | |
Johnny Chen | 53e2edb | 2011-08-09 20:07:16 +0000 | [diff] [blame] | 70 | CXXFLAGS +=$(CFLAGS) |
| 71 | LD = $(CC) |
| 72 | LDFLAGS ?= $(CFLAGS) |
Johnny Chen | 45872c0 | 2012-04-13 00:13:35 +0000 | [diff] [blame] | 73 | LDFLAGS += $(LD_EXTRAS) -arch $(ARCH) |
Johnny Chen | 53e2edb | 2011-08-09 20:07:16 +0000 | [diff] [blame] | 74 | OBJECTS = |
| 75 | EXE ?= a.out |
| 76 | |
Peter Collingbourne | 518f03d | 2011-06-20 19:06:04 +0000 | [diff] [blame] | 77 | ifneq "$(DYLIB_NAME)" "" |
| 78 | ifeq "$(OS)" "Darwin" |
| 79 | DYLIB_FILENAME = lib$(DYLIB_NAME).dylib |
| 80 | else |
| 81 | DYLIB_FILENAME = lib$(DYLIB_NAME).so |
| 82 | endif |
| 83 | endif |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 84 | |
Johnny Chen | bdb4efc | 2011-01-14 18:19:53 +0000 | [diff] [blame] | 85 | # Function that returns the counterpart C++ compiler, given $(CC) as arg. |
| 86 | cxx_compiler = $(if $(findstring clang,$(1)), $(subst clang,clang++,$(1)), $(if $(findstring llvm-gcc,$(1)), $(subst llvm-gcc,llvm-g++,$(1)), $(subst gcc,g++,$(1)))) |
| 87 | |
| 88 | # Function that returns the C++ linker, given $(CC) as arg. |
Greg Clayton | d50d238 | 2012-01-10 00:00:15 +0000 | [diff] [blame] | 89 | cxx_linker = $(if $(findstring clang,$(1)), $(subst clang,clang++,$(1)), $(if $(findstring llvm-gcc,$(1)), $(subst llvm-gcc,llvm-g++,$(1)), $(subst gcc,g++,$(1)))) |
Johnny Chen | 832d233 | 2010-09-30 01:22:34 +0000 | [diff] [blame] | 90 | |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 91 | #---------------------------------------------------------------------- |
| 92 | # dylib settings |
| 93 | #---------------------------------------------------------------------- |
| 94 | ifneq "$(strip $(DYLIB_C_SOURCES))" "" |
| 95 | DYLIB_OBJECTS +=$(strip $(DYLIB_C_SOURCES:.c=.o)) |
| 96 | endif |
| 97 | |
Sean Callanan | 7277284 | 2012-02-22 23:57:45 +0000 | [diff] [blame] | 98 | ifneq "$(strip $(DYLIB_OBJC_SOURCES))" "" |
| 99 | DYLIB_OBJECTS +=$(strip $(DYLIB_OBJC_SOURCES:.m=.o)) |
| 100 | endif |
| 101 | |
Greg Clayton | d50d238 | 2012-01-10 00:00:15 +0000 | [diff] [blame] | 102 | ifneq "$(strip $(DYLIB_CXX_SOURCES))" "" |
| 103 | DYLIB_OBJECTS +=$(strip $(DYLIB_CXX_SOURCES:.cpp=.o)) |
| 104 | CXX = $(call cxx_compiler,$(CC)) |
| 105 | LD = $(call cxx_linker,$(CC)) |
| 106 | endif |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 107 | |
| 108 | #---------------------------------------------------------------------- |
| 109 | # Check if we have any C source files |
| 110 | #---------------------------------------------------------------------- |
| 111 | ifneq "$(strip $(C_SOURCES))" "" |
| 112 | OBJECTS +=$(strip $(C_SOURCES:.c=.o)) |
| 113 | endif |
| 114 | |
| 115 | #---------------------------------------------------------------------- |
| 116 | # Check if we have any C++ source files |
| 117 | #---------------------------------------------------------------------- |
| 118 | ifneq "$(strip $(CXX_SOURCES))" "" |
| 119 | OBJECTS +=$(strip $(CXX_SOURCES:.cpp=.o)) |
Johnny Chen | 832d233 | 2010-09-30 01:22:34 +0000 | [diff] [blame] | 120 | CXX = $(call cxx_compiler,$(CC)) |
Johnny Chen | bdb4efc | 2011-01-14 18:19:53 +0000 | [diff] [blame] | 121 | LD = $(call cxx_linker,$(CC)) |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 122 | endif |
| 123 | |
| 124 | #---------------------------------------------------------------------- |
| 125 | # Check if we have any ObjC source files |
| 126 | #---------------------------------------------------------------------- |
| 127 | ifneq "$(strip $(OBJC_SOURCES))" "" |
| 128 | OBJECTS +=$(strip $(OBJC_SOURCES:.m=.o)) |
| 129 | LDFLAGS +=-lobjc |
| 130 | endif |
| 131 | |
| 132 | #---------------------------------------------------------------------- |
| 133 | # Check if we have any ObjC++ source files |
| 134 | #---------------------------------------------------------------------- |
| 135 | ifneq "$(strip $(OBJCXX_SOURCES))" "" |
| 136 | OBJECTS +=$(strip $(OBJCXX_SOURCES:.mm=.o)) |
Johnny Chen | 832d233 | 2010-09-30 01:22:34 +0000 | [diff] [blame] | 137 | CXX = $(call cxx_compiler,$(CC)) |
Johnny Chen | bdb4efc | 2011-01-14 18:19:53 +0000 | [diff] [blame] | 138 | LD = $(call cxx_linker,$(CC)) |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 139 | ifeq $(findstring lobjc,$(LDFLAGS)) "" |
| 140 | LDFLAGS +=-lobjc |
| 141 | endif |
| 142 | endif |
| 143 | |
Johnny Chen | fe14162 | 2012-01-12 23:09:42 +0000 | [diff] [blame] | 144 | #---------------------------------------------------------------------- |
| 145 | # Check if we have any C source files for archive |
| 146 | #---------------------------------------------------------------------- |
| 147 | ifneq "$(strip $(ARCHIVE_C_SOURCES))" "" |
| 148 | ARCHIVE_OBJECTS +=$(strip $(ARCHIVE_C_SOURCES:.c=.o)) |
| 149 | endif |
| 150 | |
| 151 | #---------------------------------------------------------------------- |
| 152 | # Check if we have any C++ source files for archive |
| 153 | #---------------------------------------------------------------------- |
| 154 | ifneq "$(strip $(ARCHIVE_CXX_SOURCES))" "" |
| 155 | ARCHIVE_OBJECTS +=$(strip $(ARCHIVE_CXX_SOURCES:.cpp=.o)) |
| 156 | CXX = $(call cxx_compiler,$(CC)) |
| 157 | LD = $(call cxx_linker,$(CC)) |
| 158 | endif |
| 159 | |
| 160 | #---------------------------------------------------------------------- |
| 161 | # Check if we have any ObjC source files for archive |
| 162 | #---------------------------------------------------------------------- |
| 163 | ifneq "$(strip $(ARCHIVE_OBJC_SOURCES))" "" |
| 164 | ARCHIVE_OBJECTS +=$(strip $(ARCHIVE_OBJC_SOURCES:.m=.o)) |
| 165 | LDFLAGS +=-lobjc |
| 166 | endif |
| 167 | |
| 168 | #---------------------------------------------------------------------- |
| 169 | # Check if we have any ObjC++ source files for archive |
| 170 | #---------------------------------------------------------------------- |
| 171 | ifneq "$(strip $(ARCHIVE_OBJCXX_SOURCES))" "" |
| 172 | ARCHIVE_OBJECTS +=$(strip $(ARCHIVE_OBJCXX_SOURCES:.mm=.o)) |
| 173 | CXX = $(call cxx_compiler,$(CC)) |
| 174 | LD = $(call cxx_linker,$(CC)) |
| 175 | ifeq $(findstring lobjc,$(LDFLAGS)) "" |
| 176 | LDFLAGS +=-lobjc |
| 177 | endif |
| 178 | endif |
| 179 | |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 180 | |
| 181 | #---------------------------------------------------------------------- |
Johnny Chen | beac8f9 | 2012-01-10 00:41:11 +0000 | [diff] [blame] | 182 | # DYLIB_ONLY variable can be used to skip the building of a.out. |
| 183 | # See the sections below regarding dSYM file as well as the building of |
| 184 | # EXE from all the objects. |
| 185 | #---------------------------------------------------------------------- |
| 186 | |
| 187 | #---------------------------------------------------------------------- |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 188 | # Make the dSYM file from the executable if $(MAKE_DSYM) != "NO" |
| 189 | #---------------------------------------------------------------------- |
Peter Collingbourne | 518f03d | 2011-06-20 19:06:04 +0000 | [diff] [blame] | 190 | ifeq "$(OS)" "Darwin" |
Johnny Chen | 9101639 | 2011-06-20 20:08:26 +0000 | [diff] [blame] | 191 | ifneq "$(MAKE_DSYM)" "NO" |
Johnny Chen | beac8f9 | 2012-01-10 00:41:11 +0000 | [diff] [blame] | 192 | ifeq "$(DYLIB_ONLY)" "" |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 193 | $(DSYM) : $(EXE) |
| 194 | $(DS) $(DSFLAGS) -o "$(DSYM)" "$(EXE)" |
Johnny Chen | 9101639 | 2011-06-20 20:08:26 +0000 | [diff] [blame] | 195 | endif |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 196 | endif |
Johnny Chen | beac8f9 | 2012-01-10 00:41:11 +0000 | [diff] [blame] | 197 | endif |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 198 | |
| 199 | #---------------------------------------------------------------------- |
| 200 | # Compile the executable from all the objects. |
| 201 | #---------------------------------------------------------------------- |
Johnny Chen | beac8f9 | 2012-01-10 00:41:11 +0000 | [diff] [blame] | 202 | ifneq "$(DYLIB_NAME)" "" |
| 203 | ifeq "$(DYLIB_ONLY)" "" |
Johnny Chen | fe14162 | 2012-01-12 23:09:42 +0000 | [diff] [blame] | 204 | $(EXE) : $(OBJECTS) $(ARCHIVE_NAME) $(DYLIB_FILENAME) |
| 205 | $(LD) $(LDFLAGS) $(OBJECTS) $(ARCHIVE_NAME) -L. -l$(DYLIB_NAME) -o "$(EXE)" |
Johnny Chen | beac8f9 | 2012-01-10 00:41:11 +0000 | [diff] [blame] | 206 | else |
| 207 | EXE = $(DYLIB_FILENAME) |
| 208 | endif |
| 209 | else |
Johnny Chen | fe14162 | 2012-01-12 23:09:42 +0000 | [diff] [blame] | 210 | $(EXE) : $(OBJECTS) $(ARCHIVE_NAME) |
| 211 | $(LD) $(LDFLAGS) $(OBJECTS) $(ARCHIVE_NAME) -o "$(EXE)" |
| 212 | endif |
| 213 | |
| 214 | #---------------------------------------------------------------------- |
| 215 | # Make the archive |
| 216 | #---------------------------------------------------------------------- |
| 217 | ifneq "$(ARCHIVE_NAME)" "" |
| 218 | ifeq "$(OS)" "Darwin" |
| 219 | $(ARCHIVE_NAME) : $(ARCHIVE_OBJECTS) |
| 220 | $(AR) $(ARFLAGS) $(ARCHIVE_NAME) $(ARCHIVE_OBJECTS) |
| 221 | $(RM) $(ARCHIVE_OBJECTS) |
| 222 | else |
| 223 | $(ARCHIVE_NAME) : $(foreach ar_obj,$(ARCHIVE_OBJECTS),$(ARCHIVE_NAME)($(ar_obj))) |
| 224 | endif |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 225 | endif |
| 226 | |
| 227 | #---------------------------------------------------------------------- |
| 228 | # Make the dylib |
| 229 | #---------------------------------------------------------------------- |
Peter Collingbourne | 518f03d | 2011-06-20 19:06:04 +0000 | [diff] [blame] | 230 | $(DYLIB_FILENAME) : $(DYLIB_OBJECTS) |
| 231 | ifeq "$(OS)" "Darwin" |
| 232 | $(LD) $(LDFLAGS) $(DYLIB_OBJECTS) -install_name "@executable_path/$(DYLIB_FILENAME)" -dynamiclib -o "$(DYLIB_FILENAME)" |
| 233 | else |
| 234 | $(LD) $(LDFLAGS) $(DYLIB_OBJECTS) -shared -o "$(DYLIB_FILENAME)" |
| 235 | endif |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 236 | |
| 237 | #---------------------------------------------------------------------- |
| 238 | # Automatic variables based on items already entered. Below we create |
| 239 | # an objects lists from the list of sources by replacing all entries |
| 240 | # that end with .c with .o, and we also create a list of prerequisite |
| 241 | # files by replacing all .c files with .d. |
| 242 | #---------------------------------------------------------------------- |
| 243 | PREREQS := $(OBJECTS:.o=.d) |
Johnny Chen | e3dc0f0 | 2010-08-24 16:35:00 +0000 | [diff] [blame] | 244 | ifneq "$(DYLIB_NAME)" "" |
| 245 | DYLIB_PREREQS := $(DYLIB_OBJECTS:.o=.d) |
| 246 | endif |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 247 | |
| 248 | #---------------------------------------------------------------------- |
| 249 | # Rule for Generating Prerequisites Automatically using .d files and |
| 250 | # the compiler -MM option. The -M option will list all system headers, |
| 251 | # and the -MM option will list all non-system dependencies. |
| 252 | #---------------------------------------------------------------------- |
| 253 | %.d: %.c |
| 254 | @set -e; rm -f $@; \ |
Johnny Chen | 189bff1 | 2011-08-04 20:44:56 +0000 | [diff] [blame] | 255 | $(CC) -M $(CFLAGS) $< > $@.$$$$; \ |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 256 | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ |
| 257 | rm -f $@.$$$$ |
| 258 | |
| 259 | %.d: %.cpp |
| 260 | @set -e; rm -f $@; \ |
Johnny Chen | 189bff1 | 2011-08-04 20:44:56 +0000 | [diff] [blame] | 261 | $(CC) -M $(CXXFLAGS) $< > $@.$$$$; \ |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 262 | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ |
| 263 | rm -f $@.$$$$ |
| 264 | |
| 265 | %.d: %.m |
| 266 | @set -e; rm -f $@; \ |
Johnny Chen | 189bff1 | 2011-08-04 20:44:56 +0000 | [diff] [blame] | 267 | $(CC) -M $(CFLAGS) $< > $@.$$$$; \ |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 268 | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ |
| 269 | rm -f $@.$$$$ |
| 270 | |
| 271 | %.d: %.mm |
| 272 | @set -e; rm -f $@; \ |
Johnny Chen | 189bff1 | 2011-08-04 20:44:56 +0000 | [diff] [blame] | 273 | $(CC) -M $(CXXFLAGS) $< > $@.$$$$; \ |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 274 | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ |
| 275 | rm -f $@.$$$$ |
| 276 | |
| 277 | #---------------------------------------------------------------------- |
| 278 | # Include all of the makefiles for each source file so we don't have |
| 279 | # to manually track all of the prerequisites for each source file. |
| 280 | #---------------------------------------------------------------------- |
| 281 | sinclude $(PREREQS) |
Johnny Chen | e3dc0f0 | 2010-08-24 16:35:00 +0000 | [diff] [blame] | 282 | ifneq "$(DYLIB_NAME)" "" |
| 283 | sinclude $(DYLIB_PREREQS) |
| 284 | endif |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 285 | |
| 286 | .PHONY: clean |
| 287 | dsym: $(DSYM) |
| 288 | all: $(EXE) $(DSYM) |
Johnny Chen | e1030cd | 2010-09-27 20:44:46 +0000 | [diff] [blame] | 289 | clean:: |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 290 | ifeq "$(DYLIB_NAME)" "" |
Johnny Chen | fe14162 | 2012-01-12 23:09:42 +0000 | [diff] [blame] | 291 | rm -rf "$(EXE)" "$(DSYM)" $(OBJECTS) $(PREREQS) $(ARCHIVE_NAME) $(ARCHIVE_OBJECTS) |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 292 | else |
Johnny Chen | fe14162 | 2012-01-12 23:09:42 +0000 | [diff] [blame] | 293 | rm -rf "$(EXE)" "$(DSYM)" $(OBJECTS) $(PREREQS) $(ARCHIVE_NAME) $(ARCHIVE_OBJECTS) $(DYLIB_OBJECTS) $(DYLIB_PREREQS) $(DYLIB_FILENAME) $(DYLIB_FILENAME).dSYM |
Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 294 | endif |
Johnny Chen | fa38041 | 2011-01-14 21:18:12 +0000 | [diff] [blame] | 295 | |
| 296 | #---------------------------------------------------------------------- |
| 297 | # From http://blog.melski.net/tag/debugging-makefiles/ |
| 298 | # |
| 299 | # Usage: make print-CC print-CXX print-LD |
| 300 | #---------------------------------------------------------------------- |
| 301 | print-%: |
| 302 | @echo '$*=$($*)' |
| 303 | @echo ' origin = $(origin $*)' |
| 304 | @echo ' flavor = $(flavor $*)' |
| 305 | @echo ' value = $(value $*)' |
Johnny Chen | 8b2c321 | 2011-01-28 17:22:29 +0000 | [diff] [blame] | 306 | |
| 307 | |
| 308 | ### Local Variables: ### |
| 309 | ### mode:makefile ### |
| 310 | ### End: ### |