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 # LIBCXX_INSTALL_PATH=<path> CLANG_PATH=<path> ... | 6 # LIBCXX_INSTALL_PATH=<path> CLANG_PATH=<path> ... |
7 # | 7 # |
8 | 8 |
9 # LLVM_SRC_PATH is the path to the root of the checked out source code. This | 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/ | 10 # directory should contain the configure script, the include/ and lib/ |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 IceTypeConverter.cpp \ | 109 IceTypeConverter.cpp \ |
110 IceTypes.cpp \ | 110 IceTypes.cpp \ |
111 llvm2ice.cpp \ | 111 llvm2ice.cpp \ |
112 PNaClTranslator.cpp | 112 PNaClTranslator.cpp |
113 | 113 |
114 OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS)) | 114 OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS)) |
115 | 115 |
116 # Keep all the first target so it's the default. | 116 # Keep all the first target so it's the default. |
117 all: $(OBJDIR)/llvm2ice make_symlink | 117 all: $(OBJDIR)/llvm2ice make_symlink |
118 | 118 |
119 make_symlink: $(OBJDIR)/llvm2ice $(OBJDIR)/llvm2ice.build_atts | 119 # Creates symbolic link so that testing is easier. Also runs |
120 » rm -rf llvm2ice llvm2ice.build_atts | 120 # llvm2ice to verify that the defines flags have valid values, |
| 121 # as well as describe the corresponding build attributes. |
| 122 make_symlink: $(OBJDIR)/llvm2ice |
| 123 » rm -rf llvm2ice |
121 ln -s $(OBJDIR)/llvm2ice | 124 ln -s $(OBJDIR)/llvm2ice |
122 » ln -s $(OBJDIR)/llvm2ice.build_atts | 125 » @echo "Build Attributes:" |
| 126 » @$(OBJDIR)/llvm2ice --build-atts |
123 | 127 |
124 .PHONY: all make_symlink | 128 .PHONY: all make_symlink |
125 | 129 |
126 # TODO(kschimpf): Fix python scripts to directly get build attributes | 130 # TODO(kschimpf): Fix python scripts to directly get build attributes |
127 # rather than generating $(OBJDIR)/llvm2ice.build_atts. | 131 # rather than generating $(OBJDIR)/llvm2ice.build_atts. |
128 $(OBJDIR)/llvm2ice: $(OBJS) | 132 $(OBJDIR)/llvm2ice: $(OBJS) |
129 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -ldl \ | 133 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -ldl \ |
130 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) | 134 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) |
131 $@ --build-atts > $@.build_atts | |
132 | 135 |
133 # TODO: Be more precise than "*.h" here and elsewhere. | 136 # TODO: Be more precise than "*.h" here and elsewhere. |
134 $(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def | 137 $(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def |
135 $(CXX) -c $(CXXFLAGS) $< -o $@ | 138 $(CXX) -c $(CXXFLAGS) $< -o $@ |
136 | 139 |
137 $(OBJS): | $(OBJDIR) | 140 $(OBJS): | $(OBJDIR) |
138 | 141 |
139 $(OBJDIR): | 142 $(OBJDIR): |
140 @mkdir -p $@ | 143 @mkdir -p $@ |
141 | 144 |
(...skipping 17 matching lines...) Expand all Loading... |
159 ifeq (,$(wildcard /usr/lib/clang-format/clang-format-diff.py)) | 162 ifeq (,$(wildcard /usr/lib/clang-format/clang-format-diff.py)) |
160 CLANG_FORMAT_DIFF = clang-format-diff.py | 163 CLANG_FORMAT_DIFF = clang-format-diff.py |
161 else | 164 else |
162 CLANG_FORMAT_DIFF = /usr/lib/clang-format/clang-format-diff.py | 165 CLANG_FORMAT_DIFF = /usr/lib/clang-format/clang-format-diff.py |
163 endif | 166 endif |
164 format-diff: | 167 format-diff: |
165 git diff -U0 `git merge-base HEAD master` | \ | 168 git diff -U0 `git merge-base HEAD master` | \ |
166 $(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i | 169 $(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i |
167 | 170 |
168 clean: | 171 clean: |
169 » rm -rf llvm2ice llvm2ice.build_atts *.o $(OBJDIR) | 172 » rm -rf llvm2ice *.o $(OBJDIR) |
170 | 173 |
171 clean-all: clean | 174 clean-all: clean |
172 rm -rf build/ | 175 rm -rf build/ |
OLD | NEW |