summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2018-09-06 13:41:30 -0700
committerJoshua Haberman <jhaberman@gmail.com>2018-09-06 13:41:30 -0700
commit3a37b91532eb38fb0494da7d70c10d7da4959981 (patch)
tree55aeac1fbdc913ecb6b7d9f3f7d544dd0cc8498d /tools
parentba03d65a8f94b4146b6afc0e46238cfcb08da2d4 (diff)
Fixed amalgamation.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/amalgamate.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/amalgamate.py b/tools/amalgamate.py
index b496f24..d3807c6 100755
--- a/tools/amalgamate.py
+++ b/tools/amalgamate.py
@@ -12,14 +12,20 @@ def parse_include(line):
class Amalgamator:
def __init__(self, include_path, output_path):
self.include_path = include_path
- self.included = set()
+ self.included = set(["upb/port_def.inc", "upb/port_undef.inc"])
self.output_h = open(output_path + "upb.h", "w")
self.output_c = open(output_path + "upb.c", "w")
self.output_c.write("// Amalgamated source file\n")
self.output_c.write('#include "upb.h"\n')
+ self.output_c.write('#include "upb/port_def.inc"\n')
self.output_h.write("// Amalgamated source file\n")
+ self.output_h.write('#include "upb/port_def.inc"\n')
+
+ def finish(self):
+ self.output_c.write('#include "upb/port_undef.inc"\n')
+ self.output_h.write('#include "upb/port_undef.inc"\n')
def _process_file(self, infile_name, outfile):
for line in open(infile_name):
@@ -46,3 +52,5 @@ amalgamator = Amalgamator(include_path, output_path)
for filename in sys.argv[3:]:
amalgamator.add_src(filename.strip())
+
+amalgamator.finish()
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback