From 3a37b91532eb38fb0494da7d70c10d7da4959981 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 6 Sep 2018 13:41:30 -0700 Subject: Fixed amalgamation. --- tools/amalgamate.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tools') 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() -- cgit v1.2.3