OLD | NEW |
---|---|
1 # The following variables will likely need to be modified, depending on where | 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 | 2 # and how you built LLVM & Clang. They can be overridden in a command-line |
3 # invocation of make, like: | 3 # invocation of make, like: |
4 # | 4 # |
5 # make LLVM_SRC_PATH=<path> LLVM_BIN_PATH=<path> ... | 5 # make LLVM_SRC_PATH=<path> LLVM_BIN_PATH=<path> ... |
6 # | 6 # |
7 | 7 |
8 # LLVM_SRC_PATH is the path to the root of the checked out source code. This | 8 # LLVM_SRC_PATH is the path to the root of the checked out source code. This |
9 # directory should contain the configure script, the include/ and lib/ | 9 # directory should contain the configure script, the include/ and lib/ |
10 # directories of LLVM, Clang in tools/clang/, etc. | 10 # directories of LLVM, Clang in tools/clang/, etc. |
(...skipping 11 matching lines...) Expand all Loading... | |
22 $(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH)) | 22 $(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH)) |
23 $(info Using LLVM_BIN_PATH = $(LLVM_BIN_PATH)) | 23 $(info Using LLVM_BIN_PATH = $(LLVM_BIN_PATH)) |
24 $(info -----------------------------------------------) | 24 $(info -----------------------------------------------) |
25 | 25 |
26 LLVM_CXXFLAGS := `$(LLVM_BIN_PATH)/llvm-config --cxxflags` | 26 LLVM_CXXFLAGS := `$(LLVM_BIN_PATH)/llvm-config --cxxflags` |
27 LLVM_LDFLAGS := `$(LLVM_BIN_PATH)/llvm-config --ldflags --libs` | 27 LLVM_LDFLAGS := `$(LLVM_BIN_PATH)/llvm-config --ldflags --libs` |
28 | 28 |
29 # It's recommended that CXX matches the compiler you used to build LLVM itself. | 29 # It's recommended that CXX matches the compiler you used to build LLVM itself. |
30 OPTLEVEL := -O0 | 30 OPTLEVEL := -O0 |
31 CXX := g++ | 31 CXX := g++ |
32 CXXFLAGS := -Wall -Werror -fno-rtti -fno-exceptions \ | 32 CXXFLAGS := -Wall -Wextra -Werror -fno-rtti -fno-exceptions \ |
JF
2014/05/01 00:16:55
That's bold. Kudos if you can keep -Wextra, but I'
Jim Stichnoth
2014/05/05 07:03:55
So far so good. The only complaint to deal with w
| |
33 $(OPTLEVEL) -g $(LLVM_CXXFLAGS) -m32 | 33 $(OPTLEVEL) -g $(LLVM_CXXFLAGS) -m32 |
34 LDFLAGS := -m32 | 34 LDFLAGS := -m32 |
35 | 35 |
36 SRCS= \ | 36 SRCS= \ |
37 IceCfg.cpp \ | 37 IceCfg.cpp \ |
38 IceCfgNode.cpp \ | 38 IceCfgNode.cpp \ |
39 IceGlobalContext.cpp \ | 39 IceGlobalContext.cpp \ |
40 IceInst.cpp \ | 40 IceInst.cpp \ |
41 IceInstX8632.cpp \ | |
41 IceOperand.cpp \ | 42 IceOperand.cpp \ |
43 IceTargetLowering.cpp \ | |
44 IceTargetLoweringX8632.cpp \ | |
42 IceTypes.cpp \ | 45 IceTypes.cpp \ |
43 llvm2ice.cpp | 46 llvm2ice.cpp |
44 | 47 |
45 OBJS=$(patsubst %.cpp, build/%.o, $(SRCS)) | 48 OBJS=$(patsubst %.cpp, build/%.o, $(SRCS)) |
46 | 49 |
47 # Keep all the first target so it's the default. | 50 # Keep all the first target so it's the default. |
48 all: llvm2ice | 51 all: llvm2ice |
49 | 52 |
50 .PHONY: all | 53 .PHONY: all |
51 | 54 |
52 llvm2ice: $(OBJS) | 55 llvm2ice: $(OBJS) |
53 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -ldl | 56 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -ldl |
54 | 57 |
55 # TODO: Be more precise than "*.h" here and elsewhere. | 58 # TODO: Be more precise than "*.h" here and elsewhere. |
56 $(OBJS): build/%.o: src/%.cpp src/*.h src/*.def | 59 $(OBJS): build/%.o: src/%.cpp src/*.h src/*.def |
57 $(CXX) -c $(CXXFLAGS) $< -o $@ | 60 $(CXX) -c $(CXXFLAGS) $< -o $@ |
58 | 61 |
59 $(OBJS): | build | 62 $(OBJS): | build |
60 | 63 |
61 build: | 64 build: |
62 @mkdir -p $@ | 65 @mkdir -p $@ |
63 | 66 |
64 check: llvm2ice | 67 check: llvm2ice |
65 LLVM_BIN_PATH=$(LLVM_BIN_PATH) \ | 68 LLVM_BIN_PATH=$(LLVM_BIN_PATH) \ |
66 $(LLVM_SRC_PATH)/utils/lit/lit.py -sv tests_lit | 69 $(LLVM_SRC_PATH)/utils/lit/lit.py -sv tests_lit |
70 (cd crosstest; LLVM_BIN_PATH=$(LLVM_BIN_PATH) ./runtests.sh) | |
JF
2014/05/01 00:16:55
When will it be appropriate to add test bots to su
Jim Stichnoth
2014/05/05 07:03:55
Should be doable and appropriate now - as of the p
| |
67 | 71 |
68 # TODO: Fix the use of wildcards. | 72 # TODO: Fix the use of wildcards. |
69 format: | 73 format: |
70 $(LLVM_BIN_PATH)/clang-format -style=LLVM -i \ | 74 $(LLVM_BIN_PATH)/clang-format -style=LLVM -i \ |
71 src/Ice*.h src/Ice*.cpp src/llvm2ice.cpp | 75 src/Ice*.h src/Ice*.cpp src/llvm2ice.cpp |
72 | 76 |
73 clean: | 77 clean: |
74 rm -rf llvm2ice *.o build/ | 78 rm -rf llvm2ice *.o build/ |
OLD | NEW |