summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2008-09-15 21:45:01 +0000
committerTed Ross <tross@apache.org>2008-09-15 21:45:01 +0000
commite307d4138fff7b2635ce808eea50f01f4d542a85 (patch)
treed9b3f7c693db2da0e1b45b6170ed5295e6458c85
parentfa79886b733eb0d17782e435c9eebebcc73ae608 (diff)
downloadqpid-python-e307d4138fff7b2635ce808eea50f01f4d542a85.tar.gz
An improved way of dealing with installed headers
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@695646 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-xqpid/cpp/managementgen/qmf/generate.py22
-rw-r--r--qpid/cpp/managementgen/qmf/templates/Makefile.mk4
2 files changed, 21 insertions, 5 deletions
diff --git a/qpid/cpp/managementgen/qmf/generate.py b/qpid/cpp/managementgen/qmf/generate.py
index 8b8eb43252..7346200a28 100755
--- a/qpid/cpp/managementgen/qmf/generate.py
+++ b/qpid/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/qpid/cpp/managementgen/qmf/templates/Makefile.mk b/qpid/cpp/managementgen/qmf/templates/Makefile.mk
index 06b600272a..6b06e74b46 100644
--- a/qpid/cpp/managementgen/qmf/templates/Makefile.mk
+++ b/qpid/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)