Skip to content

Commit

Permalink
MakeHeader: always rewrite output file when run
Browse files Browse the repository at this point in the history
Make already handles not rebuilding headers when they're up to date with
their respective C file, and make's target not actually getting updated
causes MakeHeader.py to be run way more often than necessary.
  • Loading branch information
aswild committed Dec 30, 2019
1 parent 8c3289d commit 5f06506
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions scripts/MakeHeader.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,8 @@
out.write( "\n" )
out.write( "#endif\n" )

# only write a new .h file if something changed.
# This prevents a lot of recompilation during development
out.seek(0)
try:
with io.open(name + ".h", "r", encoding="utf-8") as orig:
origcontents = orig.readlines()
except:
origcontents = ""
if origcontents != out.readlines():
with io.open(name + ".h", "w", encoding="utf-8") as new:
print("Writing "+name+".h")
new.write(out.getvalue())
with io.open(name + ".h", "w", encoding="utf-8") as new:
#print("Writing "+name+".h")
new.write(out.getvalue())
out.close()

0 comments on commit 5f06506

Please sign in to comment.