|
@@ -19,7 +19,6 @@ if pos > 0:
|
|
outname = outname[:pos]
|
|
outname = outname[:pos]
|
|
include_re = re.compile("^#include (\".*\").*$")
|
|
include_re = re.compile("^#include (\".*\").*$")
|
|
guard_re = re.compile("^#(?:(?:ifndef|define) [A-Z_]+_H_|endif /\* [A-Z_]+_H_ \*/|endif // [A-Z_]+_H_)")
|
|
guard_re = re.compile("^#(?:(?:ifndef|define) [A-Z_]+_H_|endif /\* [A-Z_]+_H_ \*/|endif // [A-Z_]+_H_)")
|
|
-includes = []
|
|
|
|
|
|
|
|
print ("Starting amalgamating file "+ args.outfile)
|
|
print ("Starting amalgamating file "+ args.outfile)
|
|
|
|
|
|
@@ -30,7 +29,7 @@ file.write(u"""/* THIS IS A SINGLE-FILE DISTRIBUTION CONCATENATED FROM THE OPEN6
|
|
*/
|
|
*/
|
|
|
|
|
|
/*
|
|
/*
|
|
- * Copyright (C) 2015 the contributors as stated in the AUTHORS file
|
|
|
|
|
|
+ * Copyright (C) 2014-2016 the contributors as stated in the AUTHORS file
|
|
*
|
|
*
|
|
* This file is part of open62541. open62541 is free software: you can
|
|
* This file is part of open62541. open62541 is free software: you can
|
|
* redistribute it and/or modify it under the terms of the GNU Lesser General
|
|
* redistribute it and/or modify it under the terms of the GNU Lesser General
|
|
@@ -44,7 +43,14 @@ file.write(u"""/* THIS IS A SINGLE-FILE DISTRIBUTION CONCATENATED FROM THE OPEN6
|
|
* details.
|
|
* details.
|
|
*/\n\n""" % args.version)
|
|
*/\n\n""" % args.version)
|
|
|
|
|
|
-if not is_c:
|
|
|
|
|
|
+if is_c:
|
|
|
|
+ file.write(u'''#ifndef UA_DYNAMIC_LINKING
|
|
|
|
+# define UA_DYNAMIC_LINKING
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+#include "%s.h"
|
|
|
|
+''' % outname)
|
|
|
|
+else:
|
|
file.write(u'''#ifndef %s
|
|
file.write(u'''#ifndef %s
|
|
#define %s
|
|
#define %s
|
|
|
|
|
|
@@ -52,12 +58,6 @@ if not is_c:
|
|
extern "C" {
|
|
extern "C" {
|
|
#endif\n''' % (outname.upper() + u"_H_", outname.upper() + u"_H_") )
|
|
#endif\n''' % (outname.upper() + u"_H_", outname.upper() + u"_H_") )
|
|
|
|
|
|
-if not is_c:
|
|
|
|
- for inc in includes:
|
|
|
|
- file.write(u"#include " + inc + "\n")
|
|
|
|
-else:
|
|
|
|
- file.write(u"#include \"" + outname + ".h\"\n")
|
|
|
|
-
|
|
|
|
for fname in args.inputs:
|
|
for fname in args.inputs:
|
|
with io.open(fname, encoding="utf8") as infile:
|
|
with io.open(fname, encoding="utf8") as infile:
|
|
file.write(u"\n/*********************************** amalgamated original file \"" + fname + u"\" ***********************************/\n\n")
|
|
file.write(u"\n/*********************************** amalgamated original file \"" + fname + u"\" ***********************************/\n\n")
|