| 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) := | 
| Robert Flack | 666a986 | 2015-03-24 12:41:20 +0000 | [diff] [blame] | 17 | # CFLAGS_EXTRAS += | 
| Johnny Chen | 4876b5f | 2012-01-11 01:59:55 +0000 | [diff] [blame] | 18 | # LD_EXTRAS := | 
| Michael Sartain | 802b055 | 2013-07-02 18:13:13 +0000 | [diff] [blame] | 19 | # SPLIT_DEBUG_SYMBOLS := YES | 
| Johnny Chen | 64a7e74 | 2012-01-17 00:58:08 +0000 | [diff] [blame] | 20 | # | 
|  | 21 | # And test/functionalities/archives/Makefile: | 
|  | 22 | # MAKE_DSYM := NO | 
|  | 23 | # ARCHIVE_NAME := libfoo.a | 
|  | 24 | # ARCHIVE_C_SOURCES := a.c b.c | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 25 |  | 
|  | 26 | # Uncomment line below for debugging shell commands | 
|  | 27 | # SHELL = /bin/sh -x | 
|  | 28 |  | 
| Zachary Turner | c782652 | 2014-08-13 17:44:53 +0000 | [diff] [blame] | 29 | THIS_FILE_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/ | 
|  | 30 | LLDB_BASE_DIR := $(THIS_FILE_DIR)../../ | 
|  | 31 |  | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 32 | #---------------------------------------------------------------------- | 
| Johnny Chen | 6c17c08 | 2010-09-16 20:54:06 +0000 | [diff] [blame] | 33 | # If ARCH is not defined, default to x86_64. | 
| Peter Collingbourne | 518f03d | 2011-06-20 19:06:04 +0000 | [diff] [blame] | 34 | # 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] | 35 | #---------------------------------------------------------------------- | 
|  | 36 | ifeq "$(ARCH)" "" | 
| Zachary Turner | e068d91 | 2014-12-01 23:13:41 +0000 | [diff] [blame] | 37 | ifeq "$(OS)" "Windows_NT" | 
|  | 38 | ARCH = x86 | 
|  | 39 | else | 
| Johnny Chen | 6c17c08 | 2010-09-16 20:54:06 +0000 | [diff] [blame] | 40 | ARCH = x86_64 | 
|  | 41 | endif | 
| Zachary Turner | e068d91 | 2014-12-01 23:13:41 +0000 | [diff] [blame] | 42 | endif | 
| Johnny Chen | 6c17c08 | 2010-09-16 20:54:06 +0000 | [diff] [blame] | 43 |  | 
| Peter Collingbourne | 518f03d | 2011-06-20 19:06:04 +0000 | [diff] [blame] | 44 | ifeq "$(OS)" "" | 
|  | 45 | OS = $(shell uname -s) | 
|  | 46 | endif | 
|  | 47 |  | 
| Johnny Chen | 6c17c08 | 2010-09-16 20:54:06 +0000 | [diff] [blame] | 48 | #---------------------------------------------------------------------- | 
| Johnny Chen | 597cbbb | 2011-08-23 21:54:10 +0000 | [diff] [blame] | 49 | # CC defaults to clang. | 
| Johnny Chen | 4ab4a9b | 2011-08-24 18:12:53 +0000 | [diff] [blame] | 50 | # | 
|  | 51 | # If you change the defaults of CC, be sure to also change it in the file | 
|  | 52 | # test/plugins/builder_base.py, which provides a Python way to return the | 
|  | 53 | # value of the make variable CC -- getCompiler(). | 
|  | 54 | # | 
| Johnny Chen | 6055b44 | 2011-01-14 20:55:13 +0000 | [diff] [blame] | 55 | # See also these functions: | 
|  | 56 | #   o cxx_compiler | 
|  | 57 | #   o cxx_linker | 
| Johnny Chen | d43e208 | 2011-01-14 20:46:49 +0000 | [diff] [blame] | 58 | #---------------------------------------------------------------------- | 
| Johnny Chen | 597cbbb | 2011-08-23 21:54:10 +0000 | [diff] [blame] | 59 | CC ?= clang | 
| Johnny Chen | d43e208 | 2011-01-14 20:46:49 +0000 | [diff] [blame] | 60 | ifeq "$(CC)" "cc" | 
| Johnny Chen | 597cbbb | 2011-08-23 21:54:10 +0000 | [diff] [blame] | 61 | CC = clang | 
| Johnny Chen | d43e208 | 2011-01-14 20:46:49 +0000 | [diff] [blame] | 62 | endif | 
|  | 63 |  | 
|  | 64 | #---------------------------------------------------------------------- | 
| Daniel Malea | 2745d84 | 2013-01-25 00:31:48 +0000 | [diff] [blame] | 65 | # ARCHFLAG is the flag used to tell the compiler which architecture | 
|  | 66 | # to compile for. The default is the flag that clang accepts. | 
|  | 67 | #---------------------------------------------------------------------- | 
|  | 68 | ARCHFLAG ?= -arch | 
|  | 69 |  | 
|  | 70 | #---------------------------------------------------------------------- | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 71 | # Change any build/tool options needed | 
|  | 72 | #---------------------------------------------------------------------- | 
| Peter Collingbourne | 518f03d | 2011-06-20 19:06:04 +0000 | [diff] [blame] | 73 | ifeq "$(OS)" "Darwin" | 
| Greg Clayton | 82625d3 | 2014-07-29 20:10:59 +0000 | [diff] [blame] | 74 | DS := $(shell xcrun -find -toolchain default dsymutil) | 
| Peter Collingbourne | 518f03d | 2011-06-20 19:06:04 +0000 | [diff] [blame] | 75 | DSFLAGS = | 
|  | 76 | DSYM = $(EXE).dSYM | 
| Johnny Chen | fe14162 | 2012-01-12 23:09:42 +0000 | [diff] [blame] | 77 | AR := libtool | 
|  | 78 | ARFLAGS := -static -o | 
| Daniel Malea | 2745d84 | 2013-01-25 00:31:48 +0000 | [diff] [blame] | 79 | else | 
|  | 80 | # On non-Apple platforms, -arch becomes -m | 
|  | 81 | ARCHFLAG := -m | 
|  | 82 |  | 
| Zachary Turner | c782652 | 2014-08-13 17:44:53 +0000 | [diff] [blame] | 83 | # i386, i686, x86 -> 32 | 
| Zachary Turner | 7c1bc2b | 2014-07-31 21:07:41 +0000 | [diff] [blame] | 84 | # amd64, x86_64, x64 -> 64 | 
| Ed Maste | 4fe0aba | 2014-02-20 18:40:01 +0000 | [diff] [blame] | 85 | ifeq "$(ARCH)" "amd64" | 
| Zachary Turner | 7c1bc2b | 2014-07-31 21:07:41 +0000 | [diff] [blame] | 86 | override ARCH := $(subst amd64,64,$(ARCH)) | 
| Ed Maste | 4fe0aba | 2014-02-20 18:40:01 +0000 | [diff] [blame] | 87 | endif | 
| Daniel Malea | 2745d84 | 2013-01-25 00:31:48 +0000 | [diff] [blame] | 88 | ifeq "$(ARCH)" "x86_64" | 
| Zachary Turner | 7c1bc2b | 2014-07-31 21:07:41 +0000 | [diff] [blame] | 89 | override ARCH := $(subst x86_64,64,$(ARCH)) | 
|  | 90 | endif | 
|  | 91 | ifeq "$(ARCH)" "x64" | 
|  | 92 | override ARCH := $(subst x64,64,$(ARCH)) | 
| Daniel Malea | 2745d84 | 2013-01-25 00:31:48 +0000 | [diff] [blame] | 93 | endif | 
| Zachary Turner | c782652 | 2014-08-13 17:44:53 +0000 | [diff] [blame] | 94 | ifeq "$(ARCH)" "x86" | 
|  | 95 | override ARCH := $(subst x86,32,$(ARCH)) | 
|  | 96 | endif | 
| Daniel Malea | 2745d84 | 2013-01-25 00:31:48 +0000 | [diff] [blame] | 97 | ifeq "$(ARCH)" "i386" | 
| Zachary Turner | 7c1bc2b | 2014-07-31 21:07:41 +0000 | [diff] [blame] | 98 | override ARCH := $(subst i386,32,$(ARCH)) | 
|  | 99 | endif | 
|  | 100 | ifeq "$(ARCH)" "i686" | 
|  | 101 | override ARCH := $(subst i686,32,$(ARCH)) | 
| Daniel Malea | 2745d84 | 2013-01-25 00:31:48 +0000 | [diff] [blame] | 102 | endif | 
| Justin Hibbits | 3cba1c2 | 2014-11-12 15:13:58 +0000 | [diff] [blame] | 103 | ifeq "$(ARCH)" "powerpc" | 
|  | 104 | override ARCH := $(subst powerpc,32,$(ARCH)) | 
|  | 105 | endif | 
|  | 106 | ifeq "$(ARCH)" "powerpc64" | 
|  | 107 | override ARCH := $(subst powerpc64,64,$(ARCH)) | 
|  | 108 | endif | 
| Tamas Berghammer | 1e209fc | 2015-03-13 11:36:47 +0000 | [diff] [blame] | 109 | ifeq "$(ARCH)" "aarch64" | 
|  | 110 | override ARCH := | 
|  | 111 | override ARCHFLAG := | 
|  | 112 | endif | 
| Michael Sartain | 802b055 | 2013-07-02 18:13:13 +0000 | [diff] [blame] | 113 |  | 
|  | 114 | ifeq "$(SPLIT_DEBUG_SYMBOLS)" "YES" | 
|  | 115 | DSYM = $(EXE).debug | 
|  | 116 | endif | 
| Peter Collingbourne | 518f03d | 2011-06-20 19:06:04 +0000 | [diff] [blame] | 117 | endif | 
|  | 118 |  | 
| Greg Clayton | e595c6b | 2013-02-28 18:47:39 +0000 | [diff] [blame] | 119 | CFLAGS ?= -g -O0 | 
| Zachary Turner | c782652 | 2014-08-13 17:44:53 +0000 | [diff] [blame] | 120 | CFLAGS += $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(CFLAGS_EXTRAS) -I$(LLDB_BASE_DIR)include | 
| Zachary Turner | 794e6a6 | 2015-03-13 21:51:11 +0000 | [diff] [blame] | 121 | CFLAGS += -include $(THIS_FILE_DIR)test_common.h | 
| Daniel Malea | 2745d84 | 2013-01-25 00:31:48 +0000 | [diff] [blame] | 122 |  | 
| Jim Ingham | 4b4b247 | 2014-03-13 02:47:14 +0000 | [diff] [blame] | 123 | # Use this one if you want to build one part of the result without debug information: | 
|  | 124 | CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(CFLAGS_EXTRAS) | 
|  | 125 |  | 
| Zachary Turner | c782652 | 2014-08-13 17:44:53 +0000 | [diff] [blame] | 126 | CXXFLAGS += -std=c++11 | 
|  | 127 | CXXFLAGS += $(CFLAGS) | 
| Johnny Chen | 53e2edb | 2011-08-09 20:07:16 +0000 | [diff] [blame] | 128 | LD = $(CC) | 
|  | 129 | LDFLAGS ?= $(CFLAGS) | 
| Daniel Malea | 2745d84 | 2013-01-25 00:31:48 +0000 | [diff] [blame] | 130 | LDFLAGS += $(LD_EXTRAS) | 
| Tamas Berghammer | 37099e8 | 2015-02-25 13:02:08 +0000 | [diff] [blame] | 131 | ifeq (,$(filter $(OS), Windows_NT Android)) | 
| Shawn Best | 954eae0 | 2014-11-14 19:41:33 +0000 | [diff] [blame] | 132 | ifeq "$(ENABLE_THREADS)" "YES" | 
|  | 133 | LDFLAGS += -lpthread | 
| Tamas Berghammer | 37099e8 | 2015-02-25 13:02:08 +0000 | [diff] [blame] | 134 | else | 
| Shawn Best | 954eae0 | 2014-11-14 19:41:33 +0000 | [diff] [blame] | 135 | ifeq "$(ENABLE_STD_THREADS)" "YES" | 
|  | 136 | # with the specific combination of Linux, g++, std=c++11, adding the | 
|  | 137 | # linker flag -lpthread, will cause a program to hang when a std::conditional_variable | 
|  | 138 | # is used in a program that links lldb (see bugzilla 21553) | 
|  | 139 | ifeq "$(OS)" "Linux" | 
|  | 140 | ifeq (,$(findstring gcc,$(CC))) | 
|  | 141 | # Linux, but not gcc | 
|  | 142 | LDFLAGS += -lpthread | 
|  | 143 | endif | 
|  | 144 | else | 
|  | 145 | LDFLAGS += -lpthread | 
|  | 146 | endif | 
|  | 147 | endif | 
|  | 148 | endif | 
| Zachary Turner | c782652 | 2014-08-13 17:44:53 +0000 | [diff] [blame] | 149 | endif | 
| Johnny Chen | 53e2edb | 2011-08-09 20:07:16 +0000 | [diff] [blame] | 150 | OBJECTS = | 
|  | 151 | EXE ?= a.out | 
|  | 152 |  | 
| Peter Collingbourne | 518f03d | 2011-06-20 19:06:04 +0000 | [diff] [blame] | 153 | ifneq "$(DYLIB_NAME)" "" | 
|  | 154 | ifeq "$(OS)" "Darwin" | 
|  | 155 | DYLIB_FILENAME = lib$(DYLIB_NAME).dylib | 
| Zachary Turner | 794e6a6 | 2015-03-13 21:51:11 +0000 | [diff] [blame] | 156 | else ifeq "$(OS)" "Windows_NT" | 
|  | 157 | DYLIB_FILENAME = $(DYLIB_NAME).dll | 
| Peter Collingbourne | 518f03d | 2011-06-20 19:06:04 +0000 | [diff] [blame] | 158 | else | 
|  | 159 | DYLIB_FILENAME = lib$(DYLIB_NAME).so | 
|  | 160 | endif | 
|  | 161 | endif | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 162 |  | 
| Johnny Chen | bdb4efc | 2011-01-14 18:19:53 +0000 | [diff] [blame] | 163 | # Function that returns the counterpart C++ compiler, given $(CC) as arg. | 
| Shawn Best | 1ecb68d | 2014-11-11 17:34:58 +0000 | [diff] [blame] | 164 | cxx_compiler_notdir = $(if $(findstring clang,$(1)), \ | 
|  | 165 | $(subst clang,clang++,$(1)), \ | 
|  | 166 | $(if $(findstring icc,$(1)), \ | 
|  | 167 | $(subst icc,icpc,$(1)), \ | 
|  | 168 | $(if $(findstring llvm-gcc,$(1)), \ | 
|  | 169 | $(subst llvm-gcc,llvm-g++,$(1)), \ | 
|  | 170 | $(if $(findstring gcc,$(1)), \ | 
|  | 171 | $(subst gcc,g++,$(1)), \ | 
|  | 172 | $(subst cc,c++,$(1)))))) | 
| Greg Clayton | b39751b | 2013-11-22 21:05:25 +0000 | [diff] [blame] | 173 | cxx_compiler = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_compiler_notdir,$(notdir $(1)))),$(call cxx_compiler_notdir,$(1))) | 
| Johnny Chen | bdb4efc | 2011-01-14 18:19:53 +0000 | [diff] [blame] | 174 |  | 
|  | 175 | # Function that returns the C++ linker, given $(CC) as arg. | 
| Shawn Best | 1ecb68d | 2014-11-11 17:34:58 +0000 | [diff] [blame] | 176 | cxx_linker_notdir = $(if $(findstring clang,$(1)), \ | 
|  | 177 | $(subst clang,clang++,$(1)), \ | 
|  | 178 | $(if $(findstring icc,$(1)), \ | 
|  | 179 | $(subst icc,icpc,$(1)), \ | 
|  | 180 | $(if $(findstring llvm-gcc,$(1)), \ | 
|  | 181 | $(subst llvm-gcc,llvm-g++,$(1)), \ | 
|  | 182 | $(if $(findstring gcc,$(1)), \ | 
|  | 183 | $(subst gcc,g++,$(1)), \ | 
|  | 184 | $(subst cc,c++,$(1)))))) | 
| Greg Clayton | b39751b | 2013-11-22 21:05:25 +0000 | [diff] [blame] | 185 | cxx_linker = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_linker_notdir,$(notdir $(1)))),$(call cxx_linker_notdir,$(1))) | 
| Johnny Chen | 832d233 | 2010-09-30 01:22:34 +0000 | [diff] [blame] | 186 |  | 
| Tamas Berghammer | dcc8e59 | 2015-04-02 11:09:28 +0000 | [diff] [blame^] | 187 | OBJCOPY = objcopy | 
|  | 188 |  | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 189 | #---------------------------------------------------------------------- | 
| Zachary Turner | e068d91 | 2014-12-01 23:13:41 +0000 | [diff] [blame] | 190 | # Windows specific options | 
| Zachary Turner | c782652 | 2014-08-13 17:44:53 +0000 | [diff] [blame] | 191 | #---------------------------------------------------------------------- | 
|  | 192 | ifeq "$(OS)" "Windows_NT" | 
|  | 193 | ifneq (,$(findstring clang,$(CC))) | 
| Zachary Turner | e068d91 | 2014-12-01 23:13:41 +0000 | [diff] [blame] | 194 | # Clang for Windows doesn't support C++ Exceptions | 
| Zachary Turner | c782652 | 2014-08-13 17:44:53 +0000 | [diff] [blame] | 195 | CXXFLAGS += -fno-exceptions | 
| Zachary Turner | c782652 | 2014-08-13 17:44:53 +0000 | [diff] [blame] | 196 | CXXFLAGS += -D_HAS_EXCEPTIONS=0 | 
| Zachary Turner | e068d91 | 2014-12-01 23:13:41 +0000 | [diff] [blame] | 197 | # The MSVC linker doesn't understand long section names | 
|  | 198 | # generated by the clang compiler. | 
|  | 199 | LDFLAGS += -fuse-ld=lld | 
| Zachary Turner | c782652 | 2014-08-13 17:44:53 +0000 | [diff] [blame] | 200 | endif | 
|  | 201 | endif | 
|  | 202 |  | 
|  | 203 | #---------------------------------------------------------------------- | 
| Tamas Berghammer | 37099e8 | 2015-02-25 13:02:08 +0000 | [diff] [blame] | 204 | # Android specific options | 
|  | 205 | #---------------------------------------------------------------------- | 
|  | 206 | ifeq "$(OS)" "Android" | 
| Tamas Berghammer | dcc8e59 | 2015-04-02 11:09:28 +0000 | [diff] [blame^] | 207 | objcopy_notdir = $(if $(findstring clang,$(1)), \ | 
|  | 208 | $(subst clang,objcopy,$(1)), \ | 
|  | 209 | $(if $(findstring gcc,$(1)), \ | 
|  | 210 | $(subst gcc,objcopy,$(1)), \ | 
|  | 211 | $(subst cc,objcopy,$(1)))))) | 
|  | 212 | objcopy = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call objcopy_notdir,$(notdir $(1)))),$(call objcopy_notdir,$(1))) | 
|  | 213 |  | 
|  | 214 | LDFLAGS += -pie | 
|  | 215 | OBJCOPY = $(call objcopy $(CC)) | 
| Tamas Berghammer | 37099e8 | 2015-02-25 13:02:08 +0000 | [diff] [blame] | 216 | endif | 
|  | 217 |  | 
|  | 218 | #---------------------------------------------------------------------- | 
| Daniel Malea | c7ffa7a | 2013-06-05 19:32:34 +0000 | [diff] [blame] | 219 | # C++ standard library options | 
|  | 220 | #---------------------------------------------------------------------- | 
|  | 221 | ifeq (1,$(USE_LIBSTDCPP)) | 
|  | 222 | # Clang requires an extra flag: -stdlib=libstdc++ | 
|  | 223 | ifneq (,$(findstring clang,$(CC))) | 
| Enrico Granata | a1acb49 | 2013-06-07 01:58:52 +0000 | [diff] [blame] | 224 | CXXFLAGS += -stdlib=libstdc++ | 
| Daniel Malea | c7ffa7a | 2013-06-05 19:32:34 +0000 | [diff] [blame] | 225 | LDFLAGS += -stdlib=libstdc++ | 
|  | 226 | endif | 
|  | 227 | endif | 
|  | 228 |  | 
| Greg Clayton | 1767a73 | 2013-06-13 21:27:14 +0000 | [diff] [blame] | 229 | ifeq (1,$(USE_LIBCPP)) | 
|  | 230 | # Clang requires an extra flag: -stdlib=libstdc++ | 
|  | 231 | ifneq (,$(findstring clang,$(CC))) | 
|  | 232 | CXXFLAGS += -stdlib=libc++ | 
|  | 233 | LDFLAGS += -stdlib=libc++ | 
|  | 234 | endif | 
|  | 235 | endif | 
|  | 236 |  | 
| Daniel Malea | c7ffa7a | 2013-06-05 19:32:34 +0000 | [diff] [blame] | 237 | #---------------------------------------------------------------------- | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 238 | # dylib settings | 
|  | 239 | #---------------------------------------------------------------------- | 
|  | 240 | ifneq "$(strip $(DYLIB_C_SOURCES))" "" | 
|  | 241 | DYLIB_OBJECTS +=$(strip $(DYLIB_C_SOURCES:.c=.o)) | 
|  | 242 | endif | 
|  | 243 |  | 
| Sean Callanan | 7277284 | 2012-02-22 23:57:45 +0000 | [diff] [blame] | 244 | ifneq "$(strip $(DYLIB_OBJC_SOURCES))" "" | 
|  | 245 | DYLIB_OBJECTS +=$(strip $(DYLIB_OBJC_SOURCES:.m=.o)) | 
|  | 246 | endif | 
|  | 247 |  | 
| Greg Clayton | d50d238 | 2012-01-10 00:00:15 +0000 | [diff] [blame] | 248 | ifneq "$(strip $(DYLIB_CXX_SOURCES))" "" | 
|  | 249 | DYLIB_OBJECTS +=$(strip $(DYLIB_CXX_SOURCES:.cpp=.o)) | 
|  | 250 | CXX = $(call cxx_compiler,$(CC)) | 
|  | 251 | LD = $(call cxx_linker,$(CC)) | 
|  | 252 | endif | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 253 |  | 
|  | 254 | #---------------------------------------------------------------------- | 
|  | 255 | # Check if we have any C source files | 
|  | 256 | #---------------------------------------------------------------------- | 
|  | 257 | ifneq "$(strip $(C_SOURCES))" "" | 
|  | 258 | OBJECTS +=$(strip $(C_SOURCES:.c=.o)) | 
|  | 259 | endif | 
|  | 260 |  | 
|  | 261 | #---------------------------------------------------------------------- | 
|  | 262 | # Check if we have any C++ source files | 
|  | 263 | #---------------------------------------------------------------------- | 
|  | 264 | ifneq "$(strip $(CXX_SOURCES))" "" | 
|  | 265 | OBJECTS +=$(strip $(CXX_SOURCES:.cpp=.o)) | 
| Johnny Chen | 832d233 | 2010-09-30 01:22:34 +0000 | [diff] [blame] | 266 | CXX = $(call cxx_compiler,$(CC)) | 
| Johnny Chen | bdb4efc | 2011-01-14 18:19:53 +0000 | [diff] [blame] | 267 | LD = $(call cxx_linker,$(CC)) | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 268 | endif | 
|  | 269 |  | 
|  | 270 | #---------------------------------------------------------------------- | 
|  | 271 | # Check if we have any ObjC source files | 
|  | 272 | #---------------------------------------------------------------------- | 
|  | 273 | ifneq "$(strip $(OBJC_SOURCES))" "" | 
|  | 274 | OBJECTS +=$(strip $(OBJC_SOURCES:.m=.o)) | 
|  | 275 | LDFLAGS +=-lobjc | 
|  | 276 | endif | 
|  | 277 |  | 
|  | 278 | #---------------------------------------------------------------------- | 
|  | 279 | # Check if we have any ObjC++ source files | 
|  | 280 | #---------------------------------------------------------------------- | 
|  | 281 | ifneq "$(strip $(OBJCXX_SOURCES))" "" | 
|  | 282 | OBJECTS +=$(strip $(OBJCXX_SOURCES:.mm=.o)) | 
| Johnny Chen | 832d233 | 2010-09-30 01:22:34 +0000 | [diff] [blame] | 283 | CXX = $(call cxx_compiler,$(CC)) | 
| Johnny Chen | bdb4efc | 2011-01-14 18:19:53 +0000 | [diff] [blame] | 284 | LD = $(call cxx_linker,$(CC)) | 
| Johnny Chen | 8da4ddf | 2012-04-24 23:05:07 +0000 | [diff] [blame] | 285 | ifeq "$(findstring lobjc,$(LDFLAGS))" "" | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 286 | LDFLAGS +=-lobjc | 
|  | 287 | endif | 
|  | 288 | endif | 
|  | 289 |  | 
| Johnny Chen | fe14162 | 2012-01-12 23:09:42 +0000 | [diff] [blame] | 290 | #---------------------------------------------------------------------- | 
|  | 291 | # Check if we have any C source files for archive | 
|  | 292 | #---------------------------------------------------------------------- | 
|  | 293 | ifneq "$(strip $(ARCHIVE_C_SOURCES))" "" | 
|  | 294 | ARCHIVE_OBJECTS +=$(strip $(ARCHIVE_C_SOURCES:.c=.o)) | 
|  | 295 | endif | 
|  | 296 |  | 
|  | 297 | #---------------------------------------------------------------------- | 
|  | 298 | # Check if we have any C++ source files for archive | 
|  | 299 | #---------------------------------------------------------------------- | 
|  | 300 | ifneq "$(strip $(ARCHIVE_CXX_SOURCES))" "" | 
|  | 301 | ARCHIVE_OBJECTS +=$(strip $(ARCHIVE_CXX_SOURCES:.cpp=.o)) | 
|  | 302 | CXX = $(call cxx_compiler,$(CC)) | 
|  | 303 | LD = $(call cxx_linker,$(CC)) | 
|  | 304 | endif | 
|  | 305 |  | 
|  | 306 | #---------------------------------------------------------------------- | 
|  | 307 | # Check if we have any ObjC source files for archive | 
|  | 308 | #---------------------------------------------------------------------- | 
|  | 309 | ifneq "$(strip $(ARCHIVE_OBJC_SOURCES))" "" | 
|  | 310 | ARCHIVE_OBJECTS +=$(strip $(ARCHIVE_OBJC_SOURCES:.m=.o)) | 
|  | 311 | LDFLAGS +=-lobjc | 
|  | 312 | endif | 
|  | 313 |  | 
|  | 314 | #---------------------------------------------------------------------- | 
|  | 315 | # Check if we have any ObjC++ source files for archive | 
|  | 316 | #---------------------------------------------------------------------- | 
|  | 317 | ifneq "$(strip $(ARCHIVE_OBJCXX_SOURCES))" "" | 
|  | 318 | ARCHIVE_OBJECTS +=$(strip $(ARCHIVE_OBJCXX_SOURCES:.mm=.o)) | 
|  | 319 | CXX = $(call cxx_compiler,$(CC)) | 
|  | 320 | LD = $(call cxx_linker,$(CC)) | 
| Johnny Chen | 8da4ddf | 2012-04-24 23:05:07 +0000 | [diff] [blame] | 321 | ifeq "$(findstring lobjc,$(LDFLAGS))" "" | 
| Johnny Chen | fe14162 | 2012-01-12 23:09:42 +0000 | [diff] [blame] | 322 | LDFLAGS +=-lobjc | 
|  | 323 | endif | 
|  | 324 | endif | 
|  | 325 |  | 
| Matt Kopec | f2430f5 | 2013-07-24 21:39:24 +0000 | [diff] [blame] | 326 | #---------------------------------------------------------------------- | 
|  | 327 | # Check if we are compiling with gcc 4.6 | 
|  | 328 | #---------------------------------------------------------------------- | 
|  | 329 | ifneq (,$(filter g++,$(CXX))) | 
|  | 330 | CXXVERSION = $(shell g++ -dumpversion | cut -b 1-3) | 
|  | 331 | ifeq "$(CXXVERSION)" "4.6" | 
|  | 332 | # GCC 4.6 cannot handle -std=c++11, so replace it with -std=c++0x | 
|  | 333 | # instead. FIXME: remove once GCC version is upgraded. | 
|  | 334 | override CXXFLAGS := $(subst -std=c++11,-std=c++0x,$(CXXFLAGS)) | 
|  | 335 | endif | 
|  | 336 | endif | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 337 |  | 
|  | 338 | #---------------------------------------------------------------------- | 
| Johnny Chen | beac8f9 | 2012-01-10 00:41:11 +0000 | [diff] [blame] | 339 | # DYLIB_ONLY variable can be used to skip the building of a.out. | 
|  | 340 | # See the sections below regarding dSYM file as well as the building of | 
|  | 341 | # EXE from all the objects. | 
|  | 342 | #---------------------------------------------------------------------- | 
|  | 343 |  | 
|  | 344 | #---------------------------------------------------------------------- | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 345 | # Make the dSYM file from the executable if $(MAKE_DSYM) != "NO" | 
|  | 346 | #---------------------------------------------------------------------- | 
| Matt Kopec | 7663b3a | 2013-09-25 17:44:00 +0000 | [diff] [blame] | 347 | ifneq "$(DYLIB_ONLY)" "YES" | 
| Michael Sartain | 802b055 | 2013-07-02 18:13:13 +0000 | [diff] [blame] | 348 | $(DSYM) : $(EXE) | 
| Peter Collingbourne | 518f03d | 2011-06-20 19:06:04 +0000 | [diff] [blame] | 349 | ifeq "$(OS)" "Darwin" | 
| Johnny Chen | 9101639 | 2011-06-20 20:08:26 +0000 | [diff] [blame] | 350 | ifneq "$(MAKE_DSYM)" "NO" | 
| Enrico Granata | 489af08 | 2014-11-18 22:47:33 +0000 | [diff] [blame] | 351 | "$(DS)" $(DSFLAGS) -o "$(DSYM)" "$(EXE)" | 
| Johnny Chen | 9101639 | 2011-06-20 20:08:26 +0000 | [diff] [blame] | 352 | endif | 
| Michael Sartain | 802b055 | 2013-07-02 18:13:13 +0000 | [diff] [blame] | 353 | else | 
|  | 354 | ifeq "$(SPLIT_DEBUG_SYMBOLS)" "YES" | 
| Tamas Berghammer | dcc8e59 | 2015-04-02 11:09:28 +0000 | [diff] [blame^] | 355 | $(OBJCOPY) --only-keep-debug "$(EXE)" "$(DSYM)" | 
|  | 356 | $(OBJCOPY) --strip-debug --add-gnu-debuglink="$(DSYM)" "$(EXE)" "$(EXE)" | 
| Michael Sartain | 802b055 | 2013-07-02 18:13:13 +0000 | [diff] [blame] | 357 | endif | 
|  | 358 | endif | 
| Johnny Chen | beac8f9 | 2012-01-10 00:41:11 +0000 | [diff] [blame] | 359 | endif | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 360 |  | 
|  | 361 | #---------------------------------------------------------------------- | 
|  | 362 | # Compile the executable from all the objects. | 
|  | 363 | #---------------------------------------------------------------------- | 
| Johnny Chen | beac8f9 | 2012-01-10 00:41:11 +0000 | [diff] [blame] | 364 | ifneq "$(DYLIB_NAME)" "" | 
|  | 365 | ifeq "$(DYLIB_ONLY)" "" | 
| Johnny Chen | fe14162 | 2012-01-12 23:09:42 +0000 | [diff] [blame] | 366 | $(EXE) : $(OBJECTS) $(ARCHIVE_NAME) $(DYLIB_FILENAME) | 
| Richard Mitton | ec8b282 | 2013-10-17 20:09:33 +0000 | [diff] [blame] | 367 | $(LD) $(OBJECTS) $(ARCHIVE_NAME) -L. -l$(DYLIB_NAME) $(LDFLAGS) -o "$(EXE)" | 
| Johnny Chen | beac8f9 | 2012-01-10 00:41:11 +0000 | [diff] [blame] | 368 | else | 
|  | 369 | EXE = $(DYLIB_FILENAME) | 
|  | 370 | endif | 
|  | 371 | else | 
| Johnny Chen | fe14162 | 2012-01-12 23:09:42 +0000 | [diff] [blame] | 372 | $(EXE) : $(OBJECTS) $(ARCHIVE_NAME) | 
| Daniel Malea | 2745d84 | 2013-01-25 00:31:48 +0000 | [diff] [blame] | 373 | $(LD) $(OBJECTS) $(LDFLAGS) $(ARCHIVE_NAME) -o "$(EXE)" | 
| Johnny Chen | fe14162 | 2012-01-12 23:09:42 +0000 | [diff] [blame] | 374 | endif | 
|  | 375 |  | 
|  | 376 | #---------------------------------------------------------------------- | 
|  | 377 | # Make the archive | 
|  | 378 | #---------------------------------------------------------------------- | 
|  | 379 | ifneq "$(ARCHIVE_NAME)" "" | 
|  | 380 | ifeq "$(OS)" "Darwin" | 
|  | 381 | $(ARCHIVE_NAME) : $(ARCHIVE_OBJECTS) | 
|  | 382 | $(AR) $(ARFLAGS) $(ARCHIVE_NAME) $(ARCHIVE_OBJECTS) | 
|  | 383 | $(RM) $(ARCHIVE_OBJECTS) | 
|  | 384 | else | 
|  | 385 | $(ARCHIVE_NAME) : $(foreach ar_obj,$(ARCHIVE_OBJECTS),$(ARCHIVE_NAME)($(ar_obj))) | 
|  | 386 | endif | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 387 | endif | 
|  | 388 |  | 
|  | 389 | #---------------------------------------------------------------------- | 
|  | 390 | # Make the dylib | 
|  | 391 | #---------------------------------------------------------------------- | 
| Zachary Turner | 794e6a6 | 2015-03-13 21:51:11 +0000 | [diff] [blame] | 392 | $(DYLIB_OBJECTS) : CFLAGS += -DCOMPILING_LLDB_TEST_DLL | 
|  | 393 |  | 
| Peter Collingbourne | 518f03d | 2011-06-20 19:06:04 +0000 | [diff] [blame] | 394 | $(DYLIB_FILENAME) : $(DYLIB_OBJECTS) | 
|  | 395 | ifeq "$(OS)" "Darwin" | 
|  | 396 | $(LD) $(LDFLAGS) $(DYLIB_OBJECTS) -install_name "@executable_path/$(DYLIB_FILENAME)" -dynamiclib -o "$(DYLIB_FILENAME)" | 
| Greg Clayton | 0c9773c | 2012-09-20 21:43:11 +0000 | [diff] [blame] | 397 | ifneq "$(MAKE_DSYM)" "NO" | 
|  | 398 | ifneq "$(DS)" "" | 
| Kate Stone | 2136ace | 2015-01-21 19:30:00 +0000 | [diff] [blame] | 399 | "$(DS)" $(DSFLAGS) "$(DYLIB_FILENAME)" | 
| Greg Clayton | 0c9773c | 2012-09-20 21:43:11 +0000 | [diff] [blame] | 400 | endif | 
|  | 401 | endif | 
| Peter Collingbourne | 518f03d | 2011-06-20 19:06:04 +0000 | [diff] [blame] | 402 | else | 
|  | 403 | $(LD) $(LDFLAGS) $(DYLIB_OBJECTS) -shared -o "$(DYLIB_FILENAME)" | 
| Michael Sartain | 802b055 | 2013-07-02 18:13:13 +0000 | [diff] [blame] | 404 | ifeq "$(SPLIT_DEBUG_SYMBOLS)" "YES" | 
| Tamas Berghammer | dcc8e59 | 2015-04-02 11:09:28 +0000 | [diff] [blame^] | 405 | $(OBJCOPY) --only-keep-debug "$(DYLIB_FILENAME)" "$(DYLIB_FILENAME).debug" | 
|  | 406 | $(OBJCOPY) --strip-debug --add-gnu-debuglink="$(DYLIB_FILENAME).debug" "$(DYLIB_FILENAME)" "$(DYLIB_FILENAME)" | 
| Michael Sartain | 802b055 | 2013-07-02 18:13:13 +0000 | [diff] [blame] | 407 | endif | 
| Peter Collingbourne | 518f03d | 2011-06-20 19:06:04 +0000 | [diff] [blame] | 408 | endif | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 409 |  | 
|  | 410 | #---------------------------------------------------------------------- | 
|  | 411 | # Automatic variables based on items already entered. Below we create | 
| Zachary Turner | 794e6a6 | 2015-03-13 21:51:11 +0000 | [diff] [blame] | 412 | # an object's lists from the list of sources by replacing all entries | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 413 | # that end with .c with .o, and we also create a list of prerequisite | 
|  | 414 | # files by replacing all .c files with .d. | 
|  | 415 | #---------------------------------------------------------------------- | 
|  | 416 | PREREQS := $(OBJECTS:.o=.d) | 
| Johnny Chen | e3dc0f0 | 2010-08-24 16:35:00 +0000 | [diff] [blame] | 417 | ifneq "$(DYLIB_NAME)" "" | 
|  | 418 | DYLIB_PREREQS := $(DYLIB_OBJECTS:.o=.d) | 
|  | 419 | endif | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 420 |  | 
|  | 421 | #---------------------------------------------------------------------- | 
|  | 422 | # Rule for Generating Prerequisites Automatically using .d files and | 
|  | 423 | # the compiler -MM option. The -M option will list all system headers, | 
|  | 424 | # and the -MM option will list all non-system dependencies. | 
|  | 425 | #---------------------------------------------------------------------- | 
| Zachary Turner | 794e6a6 | 2015-03-13 21:51:11 +0000 | [diff] [blame] | 426 | ifeq "$(OS)" "Windows_NT" | 
|  | 427 | JOIN_CMD = & | 
|  | 428 | QUOTE = " | 
|  | 429 | else | 
|  | 430 | JOIN_CMD = ; | 
|  | 431 | QUOTE = ' | 
|  | 432 | endif | 
|  | 433 |  | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 434 | %.d: %.c | 
| Zachary Turner | 794e6a6 | 2015-03-13 21:51:11 +0000 | [diff] [blame] | 435 | @rm -f $@ $(JOIN_CMD) \ | 
| Pavel Labath | f81ed47 | 2015-02-05 09:52:42 +0000 | [diff] [blame] | 436 | $(CC) -M $(CFLAGS) $< > $@.tmp && \ | 
| Zachary Turner | 794e6a6 | 2015-03-13 21:51:11 +0000 | [diff] [blame] | 437 | sed $(QUOTE)s,\($*\)\.o[ :]*,\1.o $@ : ,g$(QUOTE) < $@.tmp > $@ $(JOIN_CMD) \ | 
| Pavel Labath | f81ed47 | 2015-02-05 09:52:42 +0000 | [diff] [blame] | 438 | rm -f $@.tmp | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 439 |  | 
|  | 440 | %.d: %.cpp | 
| Zachary Turner | 794e6a6 | 2015-03-13 21:51:11 +0000 | [diff] [blame] | 441 | @rm -f $@ $(JOIN_CMD) \ | 
| Pavel Labath | f81ed47 | 2015-02-05 09:52:42 +0000 | [diff] [blame] | 442 | $(CXX) -M $(CXXFLAGS) $< > $@.tmp && \ | 
| Zachary Turner | 794e6a6 | 2015-03-13 21:51:11 +0000 | [diff] [blame] | 443 | sed $(QUOTE)s,\($*\)\.o[ :]*,\1.o $@ : ,g$(QUOTE) < $@.tmp > $@ $(JOIN_CMD) \ | 
| Pavel Labath | f81ed47 | 2015-02-05 09:52:42 +0000 | [diff] [blame] | 444 | rm -f $@.tmp | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 445 |  | 
|  | 446 | %.d: %.m | 
| Zachary Turner | 794e6a6 | 2015-03-13 21:51:11 +0000 | [diff] [blame] | 447 | @rm -f $@ $(JOIN_CMD) \ | 
| Pavel Labath | f81ed47 | 2015-02-05 09:52:42 +0000 | [diff] [blame] | 448 | $(CC) -M $(CFLAGS) $< > $@.tmp && \ | 
| Zachary Turner | 794e6a6 | 2015-03-13 21:51:11 +0000 | [diff] [blame] | 449 | sed $(QUOTE)s,\($*\)\.o[ :]*,\1.o $@ : ,g$(QUOTE) < $@.tmp > $@ $(JOIN_CMD) \ | 
| Pavel Labath | f81ed47 | 2015-02-05 09:52:42 +0000 | [diff] [blame] | 450 | rm -f $@.tmp | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 451 |  | 
|  | 452 | %.d: %.mm | 
| Zachary Turner | 794e6a6 | 2015-03-13 21:51:11 +0000 | [diff] [blame] | 453 | @rm -f $@ $(JOIN_CMD) \ | 
| Pavel Labath | f81ed47 | 2015-02-05 09:52:42 +0000 | [diff] [blame] | 454 | $(CXX) -M $(CXXFLAGS) $< > $@.tmp && \ | 
| Zachary Turner | 794e6a6 | 2015-03-13 21:51:11 +0000 | [diff] [blame] | 455 | sed $(QUOTE)s,\($*\)\.o[ :]*,\1.o $@ : ,g$(QUOTE) < $@.tmp > $@ $(JOIN_CMD) \ | 
| Pavel Labath | f81ed47 | 2015-02-05 09:52:42 +0000 | [diff] [blame] | 456 | rm -f $@.tmp | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 457 |  | 
|  | 458 | #---------------------------------------------------------------------- | 
|  | 459 | # Include all of the makefiles for each source file so we don't have | 
|  | 460 | # to manually track all of the prerequisites for each source file. | 
|  | 461 | #---------------------------------------------------------------------- | 
|  | 462 | sinclude $(PREREQS) | 
| Johnny Chen | e3dc0f0 | 2010-08-24 16:35:00 +0000 | [diff] [blame] | 463 | ifneq "$(DYLIB_NAME)" "" | 
|  | 464 | sinclude $(DYLIB_PREREQS) | 
|  | 465 | endif | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 466 |  | 
| Johnny Chen | 8da4ddf | 2012-04-24 23:05:07 +0000 | [diff] [blame] | 467 | # Define a suffix rule for .mm -> .o | 
|  | 468 | .SUFFIXES: .mm .o | 
|  | 469 | .mm.o: | 
|  | 470 | $(CXX) $(CXXFLAGS) -c $< | 
|  | 471 |  | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 472 | .PHONY: clean | 
|  | 473 | dsym:	$(DSYM) | 
|  | 474 | all:	$(EXE) $(DSYM) | 
| Johnny Chen | e1030cd | 2010-09-27 20:44:46 +0000 | [diff] [blame] | 475 | clean:: | 
| Pavel Labath | f81ed47 | 2015-02-05 09:52:42 +0000 | [diff] [blame] | 476 | $(RM) "$(EXE)" $(OBJECTS) $(PREREQS) $(PREREQS:.d=.d.tmp) $(ARCHIVE_NAME) $(ARCHIVE_OBJECTS) | 
| Ed Maste | 0990e05 | 2014-03-07 17:20:50 +0000 | [diff] [blame] | 477 | ifneq "$(DYLIB_NAME)" "" | 
| Jason Molenda | 53b8ea1 | 2014-03-08 01:53:27 +0000 | [diff] [blame] | 478 | $(RM) -r $(DYLIB_FILENAME).dSYM | 
| Pavel Labath | f81ed47 | 2015-02-05 09:52:42 +0000 | [diff] [blame] | 479 | $(RM) $(DYLIB_OBJECTS) $(DYLIB_PREREQS) $(DYLIB_PREREQS:.d=.d.tmp) $(DYLIB_FILENAME) $(DYLIB_FILENAME).debug | 
| Johnny Chen | 9bc867a | 2010-08-23 23:56:08 +0000 | [diff] [blame] | 480 | endif | 
| Ed Maste | 0990e05 | 2014-03-07 17:20:50 +0000 | [diff] [blame] | 481 | ifneq "$(DSYM)" "" | 
| Jason Molenda | 53b8ea1 | 2014-03-08 01:53:27 +0000 | [diff] [blame] | 482 | $(RM) -r "$(DSYM)" | 
| Ed Maste | 0990e05 | 2014-03-07 17:20:50 +0000 | [diff] [blame] | 483 | endif | 
| Zachary Turner | 3e9ca3a | 2014-12-16 16:48:19 +0000 | [diff] [blame] | 484 | ifeq "$(OS)" "Windows_NT" | 
| Zachary Turner | 65fe1eb | 2015-03-26 16:43:25 +0000 | [diff] [blame] | 485 | $(RM) $(wildcard *.manifest *.pdb *.ilk) | 
| Zachary Turner | 794e6a6 | 2015-03-13 21:51:11 +0000 | [diff] [blame] | 486 | ifneq "$(DYLIB_NAME)" "" | 
| Zachary Turner | 65fe1eb | 2015-03-26 16:43:25 +0000 | [diff] [blame] | 487 | $(RM) $(DYLIB_NAME).lib $(DYLIB_NAME).exp | 
| Zachary Turner | 794e6a6 | 2015-03-13 21:51:11 +0000 | [diff] [blame] | 488 | endif | 
| Zachary Turner | 3e9ca3a | 2014-12-16 16:48:19 +0000 | [diff] [blame] | 489 | endif | 
| Johnny Chen | fa38041 | 2011-01-14 21:18:12 +0000 | [diff] [blame] | 490 |  | 
|  | 491 | #---------------------------------------------------------------------- | 
|  | 492 | # From http://blog.melski.net/tag/debugging-makefiles/ | 
|  | 493 | # | 
|  | 494 | # Usage: make print-CC print-CXX print-LD | 
|  | 495 | #---------------------------------------------------------------------- | 
|  | 496 | print-%: | 
|  | 497 | @echo '$*=$($*)' | 
|  | 498 | @echo '  origin = $(origin $*)' | 
|  | 499 | @echo '  flavor = $(flavor $*)' | 
|  | 500 | @echo '   value = $(value  $*)' | 
| Johnny Chen | 8b2c321 | 2011-01-28 17:22:29 +0000 | [diff] [blame] | 501 |  | 
|  | 502 |  | 
|  | 503 | ### Local Variables: ### | 
|  | 504 | ### mode:makefile ### | 
|  | 505 | ### End: ### |