diff options
Diffstat (limited to 'cpp')
-rwxr-xr-x | cpp/managementgen/qmf/generate.py | 22 | ||||
-rw-r--r-- | cpp/managementgen/qmf/templates/Makefile.mk | 4 |
2 files changed, 21 insertions, 5 deletions
diff --git a/cpp/managementgen/qmf/generate.py b/cpp/managementgen/qmf/generate.py index 8b8eb43252..7346200a28 100755 --- a/cpp/managementgen/qmf/generate.py +++ b/cpp/managementgen/qmf/generate.py @@ -100,9 +100,10 @@ class Template: class Makefile: """ Object representing a makefile fragment """ - def __init__ (self, filelists, templateFiles): + def __init__ (self, filelists, templateFiles, packagelist): self.filelists = filelists self.templateFiles = templateFiles + self.packagelist = packagelist def genGenSources (self, stream, variables): mdir = variables["mgenDir"] @@ -139,6 +140,21 @@ class Makefile: stream.write (" \\\n ") stream.write (file) + def genHeaderInstalls (self, stream, variables): + for package in self.packagelist: + name = "_".join(package.split("/")) + stream.write(name + "dir = $(includedir)/qmf/" + package + "\n") + stream.write("dist_" + name + "_HEADERS = ") + first = True + for file in self.filelists["h"]: + if file.find("gen/qmf/" + package) == 0: + if first: + first = False + else: + stream.write (" \\\n ") + stream.write(file) + stream.write("\n\n") + class Generator: """ @@ -175,11 +191,13 @@ class Generator: self.filelists["h"] = [] self.filelists["cpp"] = [] self.filelists["mk"] = [] + self.packagelist = [] self.templateFiles = [] self.variables = {} def setPackage (self, packageName): path = "/".join(packageName.split(".")) + self.packagelist.append(path) self.packagePath = self.normalize(self.dest + path) def genDisclaimer (self, stream, variables): @@ -298,7 +316,7 @@ class Generator: def makeSingleFile (self, templateFile, target, force=False): """ Generate a single expanded template """ - makefile = Makefile (self.filelists, self.templateFiles) + makefile = Makefile (self.filelists, self.templateFiles, self.packagelist) template = Template (self.input + templateFile, self) self.templateFiles.append (templateFile) stream = template.expand (makefile) diff --git a/cpp/managementgen/qmf/templates/Makefile.mk b/cpp/managementgen/qmf/templates/Makefile.mk index 06b600272a..6b06e74b46 100644 --- a/cpp/managementgen/qmf/templates/Makefile.mk +++ b/cpp/managementgen/qmf/templates/Makefile.mk @@ -26,9 +26,7 @@ mgen_generator=/*MGEN:Makefile.GenSources*/ mgen_broker_cpp=/*MGEN:Makefile.GenCppFiles*/ # Header file install rules. -qpid_managementdir = $(includedir)/qmf -nobase_dist_qpid_management_HEADERS = /*MGEN:Makefile.GenHFiles*/ - +/*MGEN:Makefile.HeaderInstalls*/ if GENERATE $(srcdir)/managementgen.mk: $(mgen_generator) $(mgen_cmd) |