|
14 | 14 | See the License for the specific language governing permissions and
|
15 | 15 | limitations under the License.
|
16 | 16 | """
|
17 |
| -import glob |
18 | 17 | import re
|
19 | 18 | from copy import copy
|
20 | 19 | from os.path import join, dirname, splitext, basename, exists
|
21 | 20 | from os import makedirs, write
|
22 |
| -from shutil import copyfile |
23 | 21 | from tempfile import mkstemp
|
24 | 22 |
|
25 | 23 | from tools.toolchains import mbedToolchain, TOOLCHAIN_PATHS
|
@@ -201,21 +199,17 @@ def correct_scatter_shebang(self, scatter_file):
|
201 | 199 | with open(scatter_file, "rb") as input:
|
202 | 200 | lines = input.readlines()
|
203 | 201 | if (lines[0].startswith(self.SHEBANG) or
|
204 |
| - not lines[0].startswith("#!")): |
| 202 | + not lines[0].startswith("#!")): |
205 | 203 | return scatter_file
|
206 | 204 | else:
|
207 | 205 | new_scatter = join(self.build_dir, ".link_script.sct")
|
| 206 | + self.SHEBANG += " -I %s" % dirname(scatter_file) |
208 | 207 | if self.need_update(new_scatter, [scatter_file]):
|
209 | 208 | with open(new_scatter, "wb") as out:
|
210 | 209 | out.write(self.SHEBANG)
|
211 | 210 | out.write("\n")
|
212 | 211 | out.write("".join(lines[1:]))
|
213 | 212 |
|
214 |
| - # Copy headers into the build dir as well |
215 |
| - headers = glob.glob(join(dirname(scatter_file), '*.h')) |
216 |
| - for header in headers: |
217 |
| - copyfile(header, join(self.build_dir, basename(header))) |
218 |
| - |
219 | 213 | return new_scatter
|
220 | 214 |
|
221 | 215 | @hook_tool
|
|
0 commit comments