Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 462463 - Stop using mddepend.pl. r=ted
- Loading branch information
Showing
15 changed files
with
104 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
import pymake.data | ||
import pymake.parser | ||
import pymake.parserdata | ||
import sys | ||
|
||
''' | ||
Modifies the output of Sun Studio's -xM to look more like the output | ||
of gcc's -MD -MP, adding phony targets for dependencies. | ||
''' | ||
|
||
|
||
def add_phony_targets(path): | ||
print path | ||
deps = set() | ||
targets = set() | ||
for stmt in pymake.parser.parsefile(path): | ||
if isinstance(stmt, pymake.parserdata.Rule): | ||
assert isinstance(stmt.depexp, pymake.data.StringExpansion) | ||
assert isinstance(stmt.targetexp, pymake.data.StringExpansion) | ||
for d in stmt.depexp.s.split(): | ||
deps.add(d) | ||
for t in stmt.targetexp.s.split(): | ||
targets.add(t) | ||
phony_targets = deps - targets | ||
if not phony_targets: | ||
return | ||
with open(path, 'a') as f: | ||
f.writelines('%s:\n' % d for d in phony_targets) | ||
|
||
|
||
if __name__ == '__main__': | ||
for f in sys.argv[1:]: | ||
add_phony_targets(f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
import pymake.data | ||
import pymake.parser | ||
import pymake.parserdata | ||
import sys | ||
|
||
''' | ||
Modifies the output of Sun Studio's -xM to look more like the output | ||
of gcc's -MD -MP, adding phony targets for dependencies. | ||
''' | ||
|
||
|
||
def add_phony_targets(path): | ||
print path | ||
deps = set() | ||
targets = set() | ||
for stmt in pymake.parser.parsefile(path): | ||
if isinstance(stmt, pymake.parserdata.Rule): | ||
assert isinstance(stmt.depexp, pymake.data.StringExpansion) | ||
assert isinstance(stmt.targetexp, pymake.data.StringExpansion) | ||
for d in stmt.depexp.s.split(): | ||
deps.add(d) | ||
for t in stmt.targetexp.s.split(): | ||
targets.add(t) | ||
phony_targets = deps - targets | ||
if not phony_targets: | ||
return | ||
with open(path, 'a') as f: | ||
f.writelines('%s:\n' % d for d in phony_targets) | ||
|
||
|
||
if __name__ == '__main__': | ||
for f in sys.argv[1:]: | ||
add_phony_targets(f) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters