Skip to content

Commit 9245b50

Browse files
committed
ARM: ARMC6: Update scatter file shebang include directory
1 parent 6b21a55 commit 9245b50

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

tools/toolchains/arm.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@
1414
See the License for the specific language governing permissions and
1515
limitations under the License.
1616
"""
17-
import glob
1817
import re
1918
from copy import copy
2019
from os.path import join, dirname, splitext, basename, exists
2120
from os import makedirs, write
22-
from shutil import copyfile
2321
from tempfile import mkstemp
2422

2523
from tools.toolchains import mbedToolchain, TOOLCHAIN_PATHS
@@ -201,21 +199,17 @@ def correct_scatter_shebang(self, scatter_file):
201199
with open(scatter_file, "rb") as input:
202200
lines = input.readlines()
203201
if (lines[0].startswith(self.SHEBANG) or
204-
not lines[0].startswith("#!")):
202+
not lines[0].startswith("#!")):
205203
return scatter_file
206204
else:
207205
new_scatter = join(self.build_dir, ".link_script.sct")
206+
self.SHEBANG += " -I %s" % dirname(scatter_file)
208207
if self.need_update(new_scatter, [scatter_file]):
209208
with open(new_scatter, "wb") as out:
210209
out.write(self.SHEBANG)
211210
out.write("\n")
212211
out.write("".join(lines[1:]))
213212

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-
219213
return new_scatter
220214

221215
@hook_tool

0 commit comments

Comments
 (0)