Skip to content

Commit

Permalink
[#3] Use original names for objects and deps
Browse files Browse the repository at this point in the history
  • Loading branch information
ilg-ul committed Nov 6, 2018
1 parent 88aebdd commit b45f1f4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions assets/templates/build.ninja.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ rule {{ tool.prefix }}
# Compile files from '{{ folder.relativePath }}'.

{% for file in folder.files -%}
build {{ file.relativePathShortName | replace: '$', '$$' | replace: ' ', '$ ' }}.{{ toolchain.objectExtension }}: {{ file.tool.prefix }} {{ file.buildRelativePath | replace: '$', '$$' | replace: ' ', '$ ' }}
description = {{ file.tool.fullCommandName }} {{ file.tool.options }} '{{ file.relativePath | replace: '$', '$$' }}'
depfile = {{ file.relativePathShortName | replace: '$', '$$' | replace: ' ', '$ ' }}.d
build {{ file.relativePath | replace: '$', '$$' | replace: ' ', '$ ' }}.{{ toolchain.objectExtension }}: {{ file.tool.prefix }} {{ file.buildRelativePath | replace: '$', '$$' | replace: ' ', '$ ' }}
description = {{ file.tool.fullCommandName }} {{ file.tool.outputFlag }} '{{ file.relativePath | replace: '$', '$$' }}.{{ toolchain.objectExtension }}'
depfile = {{ file.relativePath | replace: '$', '$$' | replace: ' ', '$ ' }}.d
command = {{ file.fullCommand | replace: '$', '$$' }}

{% endfor -%}
Expand Down
12 changes: 6 additions & 6 deletions assets/templates/makefile.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ all: {{ artefact.fullName | replace: '$', '$$' }}

{% for folder in sourceFolders -%}
{% for file in folder.files -%}
-include {{ file.relativePathShortName | replace: '$', '$$' | replace: ' ', '\ ' }}.d
-include {{ file.relativePath | replace: '$', '$$' | replace: ' ', '\ ' }}.d
{% endfor -%}
{% endfor -%}

Expand All @@ -23,17 +23,17 @@ all: {{ artefact.fullName | replace: '$', '$$' }}
# Compile files from '{{ folder.relativePath }}'.

{% for file in folder.files -%}
{{ file.relativePathShortName | replace: '$', '$$' | replace: ' ', '\ ' }}.{{ toolchain.objectExtension }}: {{ file.buildRelativePath | replace: '$', '$$' | replace: ' ', '\ ' }}
{{ file.relativePath | replace: '$', '$$' | replace: ' ', '\ ' }}.{{ toolchain.objectExtension }}: {{ file.buildRelativePath | replace: '$', '$$' | replace: ' ', '\ ' }}
{% if isVerbose -%}
{{ tab }}@echo ' '
{{ tab }}@echo 'Building file: {{ file.buildRelativePath | replace: '$', '$$' }}'
{{ tab }}@echo 'Building file: {{ file.relativePath | replace: '$', '$$' }}.{{ toolchain.objectExtension }}'
{{ tab }}@echo 'Invoking: {{ file.tool.fullDescription }}'
{% else -%}
{{ tab }}@echo '{{ file.tool.fullCommandName }} {{ file.tool.options }} {{ file.buildRelativePath | replace: '$', '$$' }} ...'
{{ tab }}@echo '{{ file.tool.fullCommandName }} {{ file.tool.outputFlag }} {{ file.relativePath | replace: '$', '$$' }}.{{ toolchain.objectExtension }} ...'
{% endif -%}
{{ tab }}{% if isVerbose == false %}@{% endif %}{{ file.fullCommand | replace: '$', '$$' }}
{% if isVerbose -%}
{{ tab }}@echo 'Finished building: {{ file.buildRelativePath | replace: '$', '$$' }}'
{{ tab }}@echo 'Finished building: {{ file.relativePath | replace: '$', '$$' }}.{{ toolchain.objectExtension }}'
{% endif -%}

{% endfor -%}
Expand Down Expand Up @@ -63,7 +63,7 @@ clean:
{% else -%}
{{ tab }}-@echo '$(firstword $(RM)) ...'
{% endif -%}
{{ tab }}-{% if isVerbose == false %}@{% endif %}$(RM) {% for folder in sourceFolders %}{% for file in folder.files %}'{{ file.relativePathShortName | replace: '$', '$$' }}.d' {% endfor %}{% endfor %}
{{ tab }}-{% if isVerbose == false %}@{% endif %}$(RM) {% for folder in sourceFolders %}{% for file in folder.files %}'{{ file.relativePath | replace: '$', '$$' }}.d' {% endfor %}{% endfor %}
{{ tab }}-{% if isVerbose == false %}@{% endif %}$(RM) {% for obj in root.objs %}'{{ obj | replace: '$', '$$' }}' {% endfor %}'{{ artefact.fullName | replace: '$', '$$' }}'

################################################################################
Expand Down
12 changes: 6 additions & 6 deletions assets/toolchains.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@
"cCompiler": {
"commandName": "gcc",
"options": "-c",
"deps": "-MMD -MP -MF '${node.relativePathShortName}.d'",
"deps": "-MMD -MP -MF '${node.relativePath}.d'",
"outputFlag": "-o",
"output": "'${node.relativePathShortName}.${toolchain.objectExtension}'",
"output": "'${node.relativePath}.${toolchain.objectExtension}'",
"inputs": "'${node.buildRelativePath}'",
"fileExtensions": {
"c": {
Expand All @@ -135,9 +135,9 @@
"cppCompiler": {
"commandName": "g++",
"options": "-c",
"deps": "-MMD -MP -MF '${node.relativePathShortName}.d'",
"deps": "-MMD -MP -MF '${node.relativePath}.d'",
"outputFlag": "-o",
"output": "'${node.relativePathShortName}.${toolchain.objectExtension}'",
"output": "'${node.relativePath}.${toolchain.objectExtension}'",
"inputs": "'${node.buildRelativePath}'",
"fileExtensions": {
"cpp": {
Expand All @@ -160,9 +160,9 @@
"assembler": {
"commandName": "gcc",
"options": "-x assembler-with-cpp -c",
"deps": "-MMD -MP -MF '${node.relativePathShortName}.d'",
"deps": "-MMD -MP -MF '${node.relativePath}.d'",
"outputFlag": "-o",
"output": "'${node.relativePathShortName}.${toolchain.objectExtension}'",
"output": "'${node.relativePath}.${toolchain.objectExtension}'",
"inputs": "'${node.buildRelativePath}'",
"fileExtensions": {
"S": {
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/source-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ class SourceTree extends Node {
out.sourceFolderNodes.push(node)

for (const file of node.files) {
out.objs.push(file.relativePathShortName + '.' +
out.objs.push(file.relativePath + '.' +
file.tool.toolchain.objectExtension)
out.tools.add(file.tool)
}
Expand Down

0 comments on commit b45f1f4

Please sign in to comment.