Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 1 | # The following variables will likely need to be modified, depending on where |
| 2 | # and how you built LLVM & Clang. They can be overridden in a command-line |
| 3 | # invocation of make, like: |
| 4 | # |
Karl Schimpf | 8fcefc3 | 2014-09-15 12:56:50 -0700 | [diff] [blame] | 5 | # make LLVM_SRC_PATH=<path> LLVM_BIN_PATH=<path> \ |
| 6 | # LIBCXX_INSTALL_PATH=<path> CLANG_PATH=<path> ... |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 7 | # |
| 8 | |
| 9 | # LLVM_SRC_PATH is the path to the root of the checked out source code. This |
| 10 | # directory should contain the configure script, the include/ and lib/ |
| 11 | # directories of LLVM, Clang in tools/clang/, etc. |
| 12 | # Alternatively, if you're building vs. a binary download of LLVM, then |
| 13 | # LLVM_SRC_PATH can point to the main untarred directory. |
| 14 | LLVM_SRC_PATH ?= ../llvm |
| 15 | |
| 16 | # LLVM_BIN_PATH is the directory where binaries are placed by the LLVM build |
| 17 | # process. It should contain the tools like opt, llc and clang. The default |
| 18 | # reflects a debug build with autotools (configure & make). |
| 19 | LLVM_BIN_PATH ?= $(shell readlink -e \ |
Jan Voung | 4c127ba | 2014-09-19 13:11:36 -0700 | [diff] [blame] | 20 | ../../out/llvm_x86_64_linux_work/Release+Asserts/bin) |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 21 | |
Karl Schimpf | 8fcefc3 | 2014-09-15 12:56:50 -0700 | [diff] [blame] | 22 | # LIBCXX_INSTALL_PATH is the directory where libc++ is located. It should |
| 23 | # contain header files and corresponding libraries |
| 24 | LIBCXX_INSTALL_PATH ?= $(shell readlink -e \ |
Jan Voung | 4c127ba | 2014-09-19 13:11:36 -0700 | [diff] [blame] | 25 | ../../../toolchain/linux_x86/pnacl_newlib) |
Karl Schimpf | 8fcefc3 | 2014-09-15 12:56:50 -0700 | [diff] [blame] | 26 | |
| 27 | # CLANG_PATH is the location of the clang compiler to use. |
| 28 | CLANG_PATH ?= $(shell readlink -e \ |
| 29 | ../../../../third_party/llvm-build/Release+Asserts/bin) |
| 30 | |
Jan Voung | a2703ae | 2015-02-19 11:27:44 -0800 | [diff] [blame] | 31 | # The location of binutils tools (e.g., objdump). |
| 32 | BINUTILS_BIN_PATH ?= $(shell readlink -e \ |
| 33 | ../../out/binutils_pnacl_x86_64_linux_work/binutils) |
| 34 | |
Jan Voung | 4c127ba | 2014-09-19 13:11:36 -0700 | [diff] [blame] | 35 | HOST_ARCH ?= x86_64 |
Jan Voung | 839c4ce | 2014-07-28 15:19:43 -0700 | [diff] [blame] | 36 | ifeq ($(HOST_ARCH),x86_64) |
Karl Schimpf | 8fcefc3 | 2014-09-15 12:56:50 -0700 | [diff] [blame] | 37 | HOST_FLAGS = -m64 -stdlib=libc++ |
Jan Voung | 839c4ce | 2014-07-28 15:19:43 -0700 | [diff] [blame] | 38 | else |
| 39 | ifeq ($(HOST_ARCH),x86) |
Karl Schimpf | 8fcefc3 | 2014-09-15 12:56:50 -0700 | [diff] [blame] | 40 | HOST_FLAGS = -m32 -stdlib=libc++ |
Jan Voung | 839c4ce | 2014-07-28 15:19:43 -0700 | [diff] [blame] | 41 | endif |
| 42 | endif |
| 43 | |
Jim Stichnoth | fddef24 | 2014-09-26 18:53:41 -0700 | [diff] [blame] | 44 | ifdef DEBUG |
| 45 | OBJDIR = build/Debug |
| 46 | OPTLEVEL = -O0 |
| 47 | else |
| 48 | OBJDIR = build/Release |
Jim Stichnoth | a49e9d9 | 2014-12-07 14:25:34 -0800 | [diff] [blame] | 49 | OPTLEVEL = -O2 -ffunction-sections -fdata-sections |
Jim Stichnoth | fddef24 | 2014-09-26 18:53:41 -0700 | [diff] [blame] | 50 | endif |
| 51 | |
Karl Schimpf | b262c5e | 2014-10-27 14:41:57 -0700 | [diff] [blame] | 52 | # The list of CXX defines that are dependent on build parameters. |
| 53 | CXX_DEFINES = |
Jim Stichnoth | fa4efea | 2015-01-27 05:06:03 -0800 | [diff] [blame] | 54 | CXX_EXTRA = |
| 55 | LD_EXTRA = |
Karl Schimpf | b262c5e | 2014-10-27 14:41:57 -0700 | [diff] [blame] | 56 | |
| 57 | ifdef MINIMAL |
Jim Stichnoth | e3c02c2 | 2014-12-05 14:16:07 -0800 | [diff] [blame] | 58 | NOASSERT = 1 |
Karl Schimpf | b262c5e | 2014-10-27 14:41:57 -0700 | [diff] [blame] | 59 | OBJDIR := $(OBJDIR)+Min |
Karl Schimpf | b6c96af | 2014-11-17 10:58:39 -0800 | [diff] [blame] | 60 | CXX_DEFINES += -DALLOW_DUMP=0 -DALLOW_LLVM_CL=0 -DALLOW_LLVM_IR=0 \ |
Karl Schimpf | df80eb8 | 2015-02-09 14:20:22 -0800 | [diff] [blame] | 61 | -DALLOW_LLVM_IR_AS_INPUT=0 -DALLOW_DISABLE_IR_GEN=0 \ |
| 62 | -DALLOW_MINIMAL_BUILD=1 |
Karl Schimpf | b262c5e | 2014-10-27 14:41:57 -0700 | [diff] [blame] | 63 | else |
Karl Schimpf | b6c96af | 2014-11-17 10:58:39 -0800 | [diff] [blame] | 64 | CXX_DEFINES += -DALLOW_DUMP=1 -DALLOW_LLVM_CL=1 -DALLOW_LLVM_IR=1 \ |
Karl Schimpf | df80eb8 | 2015-02-09 14:20:22 -0800 | [diff] [blame] | 65 | -DALLOW_LLVM_IR_AS_INPUT=1 -DALLOW_DISABLE_IR_GEN=1 \ |
| 66 | -DALLOW_MINIMAL_BUILD=0 |
Karl Schimpf | b262c5e | 2014-10-27 14:41:57 -0700 | [diff] [blame] | 67 | endif |
| 68 | |
Jim Stichnoth | 9c234e2 | 2014-10-01 09:28:21 -0700 | [diff] [blame] | 69 | ifdef NOASSERT |
| 70 | ASSERTIONS = -DNDEBUG |
| 71 | else |
| 72 | ASSERTIONS = |
| 73 | OBJDIR := $(OBJDIR)+Asserts |
| 74 | endif |
| 75 | |
Jim Stichnoth | fa4efea | 2015-01-27 05:06:03 -0800 | [diff] [blame] | 76 | ifdef TSAN |
| 77 | OBJDIR := $(OBJDIR)+TSan |
| 78 | CXX_EXTRA += -fsanitize=thread |
| 79 | LD_EXTRA += -fsanitize=thread |
| 80 | endif |
| 81 | |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 82 | $(info -----------------------------------------------) |
| 83 | $(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH)) |
| 84 | $(info Using LLVM_BIN_PATH = $(LLVM_BIN_PATH)) |
Karl Schimpf | 8fcefc3 | 2014-09-15 12:56:50 -0700 | [diff] [blame] | 85 | $(info Using LIBCXX_INSTALL_PATH = $(LIBCXX_INSTALL_PATH)) |
| 86 | $(info Using CLANG_PATH = $(CLANG_PATH)) |
Jan Voung | a2703ae | 2015-02-19 11:27:44 -0800 | [diff] [blame] | 87 | $(info Using BINUTILS_BIN_PATH = $(BINUTILS_BIN_PATH)) |
Jan Voung | 839c4ce | 2014-07-28 15:19:43 -0700 | [diff] [blame] | 88 | $(info Using HOST_ARCH = $(HOST_ARCH)) |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 89 | $(info -----------------------------------------------) |
| 90 | |
| 91 | LLVM_CXXFLAGS := `$(LLVM_BIN_PATH)/llvm-config --cxxflags` |
Jim Stichnoth | 14c3f41 | 2014-08-27 11:02:50 -0700 | [diff] [blame] | 92 | LLVM_LDFLAGS := `$(LLVM_BIN_PATH)/llvm-config --libs` \ |
Jim Stichnoth | 3324642 | 2014-11-24 14:36:23 -0800 | [diff] [blame] | 93 | `$(LLVM_BIN_PATH)/llvm-config --ldflags` \ |
| 94 | `$(LLVM_BIN_PATH)/llvm-config --system-libs` |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 95 | |
| 96 | # It's recommended that CXX matches the compiler you used to build LLVM itself. |
Jim Stichnoth | 5e06f9f | 2014-09-17 08:41:21 -0700 | [diff] [blame] | 97 | CCACHE := `command -v ccache` |
| 98 | CXX := CCACHE_CPP2=yes $(CCACHE) $(CLANG_PATH)/clang++ |
Jan Voung | 839c4ce | 2014-07-28 15:19:43 -0700 | [diff] [blame] | 99 | |
Jan Voung | e837e1a | 2015-03-02 14:21:54 -0800 | [diff] [blame] | 100 | CXXFLAGS := $(LLVM_CXXFLAGS) -std=gnu++11 -Wall -Wextra -Werror -fno-rtti \ |
Karl Schimpf | b262c5e | 2014-10-27 14:41:57 -0700 | [diff] [blame] | 101 | -fno-exceptions $(OPTLEVEL) $(ASSERTIONS) $(CXX_DEFINES) -g \ |
Jim Stichnoth | 26f9433 | 2015-01-28 08:37:22 -0800 | [diff] [blame] | 102 | $(HOST_FLAGS) -pedantic -Wno-error=unused-parameter \ |
Jim Stichnoth | fa4efea | 2015-01-27 05:06:03 -0800 | [diff] [blame] | 103 | -I$(LIBCXX_INSTALL_PATH)/include/c++/v1 $(CXX_EXTRA) |
| 104 | LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib -Wl,--gc-sections \ |
| 105 | $(LD_EXTRA) |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 106 | |
Karl Schimpf | ab06df3 | 2014-10-29 14:58:25 -0700 | [diff] [blame] | 107 | SRCS = \ |
Jan Voung | 8acded0 | 2014-09-22 18:02:25 -0700 | [diff] [blame] | 108 | assembler.cpp \ |
| 109 | assembler_ia32.cpp \ |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 110 | IceCfg.cpp \ |
| 111 | IceCfgNode.cpp \ |
Jan Voung | 08c3bcd | 2014-12-01 17:55:16 -0800 | [diff] [blame] | 112 | IceELFObjectWriter.cpp \ |
| 113 | IceELFSection.cpp \ |
Jan Voung | ec27073 | 2015-01-12 17:00:22 -0800 | [diff] [blame] | 114 | IceFixups.cpp \ |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 115 | IceGlobalContext.cpp \ |
Karl Schimpf | e3f64d0 | 2014-10-07 10:38:22 -0700 | [diff] [blame] | 116 | IceGlobalInits.cpp \ |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 117 | IceInst.cpp \ |
| 118 | IceInstX8632.cpp \ |
Jan Voung | 3bd9f1a | 2014-06-18 10:50:57 -0700 | [diff] [blame] | 119 | IceIntrinsics.cpp \ |
Jim Stichnoth | d97c7df | 2014-06-04 11:57:08 -0700 | [diff] [blame] | 120 | IceLiveness.cpp \ |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 121 | IceOperand.cpp \ |
Jim Stichnoth | d97c7df | 2014-06-04 11:57:08 -0700 | [diff] [blame] | 122 | IceRegAlloc.cpp \ |
Jim Stichnoth | c4554d7 | 2014-09-30 16:49:38 -0700 | [diff] [blame] | 123 | IceRNG.cpp \ |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 124 | IceTargetLowering.cpp \ |
| 125 | IceTargetLoweringX8632.cpp \ |
Jim Stichnoth | bbca754 | 2015-02-11 16:08:31 -0800 | [diff] [blame] | 126 | IceThreading.cpp \ |
Jim Stichnoth | c4554d7 | 2014-09-30 16:49:38 -0700 | [diff] [blame] | 127 | IceTimerTree.cpp \ |
Karl Schimpf | 8d7abae | 2014-07-07 14:50:30 -0700 | [diff] [blame] | 128 | IceTranslator.cpp \ |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 129 | IceTypes.cpp \ |
Jim Stichnoth | fa0cfa5 | 2015-02-26 09:42:36 -0800 | [diff] [blame] | 130 | main.cpp \ |
Karl Schimpf | 8d7abae | 2014-07-07 14:50:30 -0700 | [diff] [blame] | 131 | PNaClTranslator.cpp |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 132 | |
Karl Schimpf | ab06df3 | 2014-10-29 14:58:25 -0700 | [diff] [blame] | 133 | ifndef MINIMAL |
Karl Schimpf | 4019f08 | 2014-12-15 13:45:00 -0800 | [diff] [blame] | 134 | SRCS += IceConverter.cpp \ |
| 135 | IceTypeConverter.cpp |
Karl Schimpf | ab06df3 | 2014-10-29 14:58:25 -0700 | [diff] [blame] | 136 | endif |
| 137 | |
Jim Stichnoth | fddef24 | 2014-09-26 18:53:41 -0700 | [diff] [blame] | 138 | OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS)) |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 139 | |
Jan Voung | 08c3bcd | 2014-12-01 17:55:16 -0800 | [diff] [blame] | 140 | UNITTEST_SRCS = \ |
Karl Schimpf | 2e7daef | 2015-01-09 13:04:13 -0800 | [diff] [blame] | 141 | BitcodeMunge.cpp \ |
| 142 | IceELFSectionTest.cpp \ |
| 143 | IceParseInstsTest.cpp |
Jan Voung | 08c3bcd | 2014-12-01 17:55:16 -0800 | [diff] [blame] | 144 | |
| 145 | UNITTEST_OBJS = $(patsubst %.cpp, $(OBJDIR)/unittest/%.o, $(UNITTEST_SRCS)) |
Jim Stichnoth | fa0cfa5 | 2015-02-26 09:42:36 -0800 | [diff] [blame] | 146 | UNITTEST_LIB_OBJS = $(filter-out $(OBJDIR)/main.o,$(OBJS)) |
Jan Voung | 08c3bcd | 2014-12-01 17:55:16 -0800 | [diff] [blame] | 147 | |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 148 | # Keep all the first target so it's the default. |
Jim Stichnoth | fa0cfa5 | 2015-02-26 09:42:36 -0800 | [diff] [blame] | 149 | all: $(OBJDIR)/pnacl-sz make_symlink runtime |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 150 | |
Karl Schimpf | 6af6336 | 2014-10-29 14:55:00 -0700 | [diff] [blame] | 151 | # Creates symbolic link so that testing is easier. Also runs |
Jim Stichnoth | fa0cfa5 | 2015-02-26 09:42:36 -0800 | [diff] [blame] | 152 | # pnacl-sz to verify that the defines flags have valid values, |
Karl Schimpf | 6af6336 | 2014-10-29 14:55:00 -0700 | [diff] [blame] | 153 | # as well as describe the corresponding build attributes. |
Jim Stichnoth | fa0cfa5 | 2015-02-26 09:42:36 -0800 | [diff] [blame] | 154 | make_symlink: $(OBJDIR)/pnacl-sz |
| 155 | rm -rf pnacl-sz |
| 156 | ln -s $(OBJDIR)/pnacl-sz |
Karl Schimpf | 6af6336 | 2014-10-29 14:55:00 -0700 | [diff] [blame] | 157 | @echo "Build Attributes:" |
Jim Stichnoth | fa0cfa5 | 2015-02-26 09:42:36 -0800 | [diff] [blame] | 158 | @$(OBJDIR)/pnacl-sz --build-atts |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 159 | |
Jim Stichnoth | 9738a9e | 2015-02-23 16:39:06 -0800 | [diff] [blame] | 160 | .PHONY: all make_symlink runtime bloat |
Jim Stichnoth | fddef24 | 2014-09-26 18:53:41 -0700 | [diff] [blame] | 161 | |
Jim Stichnoth | fa0cfa5 | 2015-02-26 09:42:36 -0800 | [diff] [blame] | 162 | $(OBJDIR)/pnacl-sz: $(OBJS) |
Jim Stichnoth | 3324642 | 2014-11-24 14:36:23 -0800 | [diff] [blame] | 163 | $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) \ |
Karl Schimpf | 8fcefc3 | 2014-09-15 12:56:50 -0700 | [diff] [blame] | 164 | -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 165 | |
Jim Stichnoth | dd842db | 2015-01-27 12:53:53 -0800 | [diff] [blame] | 166 | # TODO(stichnot): Be more precise than "*.h" here and elsewhere. |
Jim Stichnoth | fddef24 | 2014-09-26 18:53:41 -0700 | [diff] [blame] | 167 | $(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 168 | $(CXX) -c $(CXXFLAGS) $< -o $@ |
| 169 | |
Jan Voung | 08c3bcd | 2014-12-01 17:55:16 -0800 | [diff] [blame] | 170 | $(OBJDIR)/run_unittests: $(UNITTEST_OBJS) $(UNITTEST_LIB_OBJS) |
| 171 | $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -lgtest -lgtest_main -ldl \ |
| 172 | -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) |
| 173 | |
Jim Stichnoth | 6e861d5 | 2015-02-03 14:35:51 -0800 | [diff] [blame] | 174 | $(UNITTEST_OBJS): $(OBJDIR)/unittest/%.o: unittest/%.cpp \ |
| 175 | unittest/*.h src/*.h src/*.def |
Jan Voung | 08c3bcd | 2014-12-01 17:55:16 -0800 | [diff] [blame] | 176 | $(CXX) -c $(CXXFLAGS) \ |
| 177 | -Isrc/ \ |
| 178 | -I$(LLVM_SRC_PATH)/utils/unittest/googletest/include \ |
| 179 | -DGTEST_HAS_RTTI=0 -DGTEST_USE_OWN_TR1_TUPLE \ |
| 180 | $< -o $@ |
| 181 | |
Jim Stichnoth | fddef24 | 2014-09-26 18:53:41 -0700 | [diff] [blame] | 182 | $(OBJS): | $(OBJDIR) |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 183 | |
Jan Voung | 08c3bcd | 2014-12-01 17:55:16 -0800 | [diff] [blame] | 184 | $(UNITTEST_OBJS): | $(OBJDIR)/unittest |
| 185 | |
Jim Stichnoth | fddef24 | 2014-09-26 18:53:41 -0700 | [diff] [blame] | 186 | $(OBJDIR): |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 187 | @mkdir -p $@ |
| 188 | |
Jan Voung | 08c3bcd | 2014-12-01 17:55:16 -0800 | [diff] [blame] | 189 | $(OBJDIR)/unittest: $(OBJDIR) |
| 190 | @mkdir -p $@ |
| 191 | |
Jim Stichnoth | 9738a9e | 2015-02-23 16:39:06 -0800 | [diff] [blame] | 192 | RT_SRC := runtime/szrt.c runtime/szrt_ll.ll |
| 193 | RT_OBJ := build/runtime/szrt_native_x8632.o build/runtime/szrt_sb_x8632.o |
| 194 | |
| 195 | runtime: $(RT_OBJ) |
| 196 | |
| 197 | # Use runtime.is.built so that build-runtime.py is invoked only once |
| 198 | # even in a parallel build. |
| 199 | .INTERMEDIATE: runtime.is.built |
| 200 | $(RT_OBJ): runtime.is.built |
| 201 | runtime.is.built: $(RT_SRC) |
| 202 | @echo ================ Building Subzero runtime ================ |
| 203 | ./pydir/build-runtime.py -v |
| 204 | |
Jim Stichnoth | fa0cfa5 | 2015-02-26 09:42:36 -0800 | [diff] [blame] | 205 | check-lit: $(OBJDIR)/pnacl-sz make_symlink |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 206 | LLVM_BIN_PATH=$(LLVM_BIN_PATH) \ |
Jan Voung | a2703ae | 2015-02-19 11:27:44 -0800 | [diff] [blame] | 207 | BINUTILS_BIN_PATH=$(BINUTILS_BIN_PATH) \ |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 208 | $(LLVM_SRC_PATH)/utils/lit/lit.py -sv tests_lit |
Jim Stichnoth | ac9c943 | 2014-08-26 14:07:13 -0700 | [diff] [blame] | 209 | |
Jan Voung | 08c3bcd | 2014-12-01 17:55:16 -0800 | [diff] [blame] | 210 | check-unit: $(OBJDIR)/run_unittests |
| 211 | $(OBJDIR)/run_unittests |
| 212 | |
Karl Schimpf | ab06df3 | 2014-10-29 14:58:25 -0700 | [diff] [blame] | 213 | ifdef MINIMAL |
Jim Stichnoth | 9738a9e | 2015-02-23 16:39:06 -0800 | [diff] [blame] | 214 | check: check-lit check-unit runtime |
Karl Schimpf | ab06df3 | 2014-10-29 14:58:25 -0700 | [diff] [blame] | 215 | @echo "Crosstests ignored, minimal build" |
| 216 | else |
Jim Stichnoth | 9738a9e | 2015-02-23 16:39:06 -0800 | [diff] [blame] | 217 | check: check-lit check-unit runtime |
Jim Stichnoth | 16178a1 | 2014-09-02 14:11:57 -0700 | [diff] [blame] | 218 | (cd crosstest; ./runtests.sh) |
Karl Schimpf | ab06df3 | 2014-10-29 14:58:25 -0700 | [diff] [blame] | 219 | endif |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 220 | |
Jim Stichnoth | dd842db | 2015-01-27 12:53:53 -0800 | [diff] [blame] | 221 | FORMAT_BLACKLIST = |
| 222 | # Add one of the following lines for each source file to ignore. |
| 223 | FORMAT_BLACKLIST += ! -name IceParseInstsTest.cpp |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 224 | format: |
Jim Stichnoth | dd842db | 2015-01-27 12:53:53 -0800 | [diff] [blame] | 225 | $(LLVM_BIN_PATH)/clang-format -style=LLVM -i \ |
| 226 | `find . -regex '.*\.\(c\|h\|cpp\)' $(FORMAT_BLACKLIST)` |
Jim Stichnoth | 240e0f8 | 2014-07-09 16:53:40 -0700 | [diff] [blame] | 227 | |
Jim Stichnoth | 240e0f8 | 2014-07-09 16:53:40 -0700 | [diff] [blame] | 228 | format-diff: |
Jim Stichnoth | 206833c | 2014-08-07 10:58:05 -0700 | [diff] [blame] | 229 | git diff -U0 `git merge-base HEAD master` | \ |
Jim Stichnoth | dd842db | 2015-01-27 12:53:53 -0800 | [diff] [blame] | 230 | PATH=$(LLVM_BIN_PATH):$(PATH) \ |
| 231 | $(LLVM_SRC_PATH)/../clang/tools/clang-format/clang-format-diff.py \ |
| 232 | -p1 -style=LLVM -i |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 233 | |
Jim Stichnoth | 307e326 | 2015-02-12 16:10:37 -0800 | [diff] [blame] | 234 | bloat: make_symlink |
Jim Stichnoth | fa0cfa5 | 2015-02-26 09:42:36 -0800 | [diff] [blame] | 235 | nm -C -S -l pnacl-sz | \ |
| 236 | bloat/bloat.py --nm-output=/dev/stdin syms > build/pnacl-sz.bloat.json |
| 237 | @echo See Subzero size breakdown in bloat/pnacl-sz.bloat.html |
Jim Stichnoth | 307e326 | 2015-02-12 16:10:37 -0800 | [diff] [blame] | 238 | |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 239 | clean: |
Jim Stichnoth | fa0cfa5 | 2015-02-26 09:42:36 -0800 | [diff] [blame] | 240 | rm -rf pnacl-sz *.o $(OBJDIR) build/pnacl-sz.bloat.json |
Karl Schimpf | b262c5e | 2014-10-27 14:41:57 -0700 | [diff] [blame] | 241 | |
| 242 | clean-all: clean |
| 243 | rm -rf build/ |