Generate Carbon as well as classic PPC plugin projects. This module is finally paying back the investment in it!

This commit is contained in:
Jack Jansen 2001-01-23 22:36:26 +00:00
parent 6abe676538
commit 8c19b882e4

View file

@ -30,13 +30,27 @@ def relpath(base, path):
rv = string.join(pathfields, os.sep) rv = string.join(pathfields, os.sep)
return rv return rv
def genpluginproject(module, def genpluginproject(architecture, module,
project=None, projectdir=None, project=None, projectdir=None,
sources=[], sourcedirs=[], sources=[], sourcedirs=[],
libraries=[], extradirs=[], libraries=[], extradirs=[],
extraexportsymbols=[]): extraexportsymbols=[]):
if architecture == "all":
# For the time being we generate two project files. Not as nice as
# a single multitarget project, but easier to implement for now.
genpluginproject("ppc", module, project, projectdir, sources, sourcedirs,
libraries, extradirs, extraexportsymbols)
genpluginproject("carbon", module, project, projectdir, sources, sourcedirs,
libraries, extradirs, extraexportsymbols)
return
templatename = "template-%s" % architecture
targetname = "%s.%s" % (module, architecture)
dllname = "%s.%s.slb" % (module, architecture)
if not project: if not project:
project = module + '.mcp' if architecture != "ppc":
project = "%s.%s.mcp"%(module, architecture)
else:
project = "%s.mcp"%module
if not projectdir: if not projectdir:
projectdir = PROJECTDIR projectdir = PROJECTDIR
if not sources: if not sources:
@ -54,6 +68,10 @@ def genpluginproject(module,
else: else:
print "Warning: %s: sourcefile not found: %s"%(module, sources[0]) print "Warning: %s: sourcefile not found: %s"%(module, sources[0])
sourcedirs = [] sourcedirs = []
if architecture == "carbon":
prefixname = "mwerks_carbonplugin_config.h"
else:
prefixname = "mwerks_plugin_config.h"
dict = { dict = {
"sysprefix" : relpath(projectdir, sys.prefix), "sysprefix" : relpath(projectdir, sys.prefix),
"sources" : sources, "sources" : sources,
@ -61,28 +79,33 @@ def genpluginproject(module,
"libraries": libraries, "libraries": libraries,
"mac_outputdir" : "::Plugins", "mac_outputdir" : "::Plugins",
"extraexportsymbols" : extraexportsymbols, "extraexportsymbols" : extraexportsymbols,
"mac_targetname" : targetname,
"mac_dllname" : dllname,
"prefixname" : prefixname,
} }
mkcwproject.mkproject(os.path.join(projectdir, project), module, dict, force=FORCEREBUILD) mkcwproject.mkproject(os.path.join(projectdir, project), module, dict,
force=FORCEREBUILD, templatename=templatename)
def genallprojects(force=0): def genallprojects(force=0):
global FORCEREBUILD global FORCEREBUILD
FORCEREBUILD = force FORCEREBUILD = force
# Standard Python modules # Standard Python modules
genpluginproject("ucnhash", sources=["ucnhash.c"]) genpluginproject("all", "ucnhash", sources=["ucnhash.c"])
genpluginproject("pyexpat", genpluginproject("all", "pyexpat",
sources=["pyexpat.c"], sources=["pyexpat.c"],
libraries=["libexpat.ppc.lib"], libraries=["libexpat.ppc.lib"],
extradirs=["::::expat:*"]) extradirs=["::::expat:*"])
genpluginproject("zlib", genpluginproject("all", "zlib",
libraries=["zlib.ppc.Lib"], libraries=["zlib.ppc.Lib"],
extradirs=["::::imglibs:zlib:mac", "::::imglibs:zlib"]) extradirs=["::::imglibs:zlib:mac", "::::imglibs:zlib"])
genpluginproject("gdbm", genpluginproject("all", "gdbm",
libraries=["gdbm.ppc.gusi.lib"], libraries=["gdbm.ppc.gusi.lib"],
extradirs=["::::gdbm:mac", "::::gdbm"]) extradirs=["::::gdbm:mac", "::::gdbm"])
# bgen-generated Toolbox modules # bgen-generated Toolbox modules
genpluginproject("App", libraries=["AppearanceLib"]) genpluginproject("ppc", "App", libraries=["AppearanceLib"])
genpluginproject("Cm", genpluginproject("carbon", "App")
genpluginproject("ppc", "Cm",
libraries=["QuickTimeLib"], libraries=["QuickTimeLib"],
extraexportsymbols=[ extraexportsymbols=[
"CmpObj_New", "CmpObj_New",
@ -90,23 +113,36 @@ def genallprojects(force=0):
"CmpInstObj_New", "CmpInstObj_New",
"CmpInstObj_Convert", "CmpInstObj_Convert",
]) ])
genpluginproject("Fm") genpluginproject("carbon", "Cm",
genpluginproject("Help") extraexportsymbols=[
genpluginproject("Icn", libraries=["IconServicesLib"]) "CmpObj_New",
genpluginproject("List") "CmpObj_Convert",
genpluginproject("Qt", libraries=["QuickTimeLib", "Cm.ppc.slb", "Qdoffs.ppc.slb"], extradirs=["::Plugins"]) "CmpInstObj_New",
genpluginproject("Qdoffs", "CmpInstObj_Convert",
])
genpluginproject("all", "Fm")
genpluginproject("ppc", "Help")
genpluginproject("ppc", "Icn", libraries=["IconServicesLib"])
genpluginproject("carbon", "Icn")
genpluginproject("all", "List")
genpluginproject("ppc", "Qt", libraries=["QuickTimeLib", "Cm.ppc.slb", "Qdoffs.ppc.slb"],
extradirs=["::Plugins"])
genpluginproject("carbon", "Qt", libraries=["Cm.carbon.slb", "Qdoffs.carbon.slb"],
extradirs=["::Plugins"])
genpluginproject("all", "Qdoffs",
extraexportsymbols=["GWorldObj_New", "GWorldObj_Convert"]) extraexportsymbols=["GWorldObj_New", "GWorldObj_Convert"])
genpluginproject("Scrap") genpluginproject("ppc", "Scrap")
genpluginproject("Snd", libraries=["SoundLib"]) genpluginproject("ppc", "Snd", libraries=["SoundLib"])
genpluginproject("Sndihooks", sources=[":snd:Sndihooks.c"]) genpluginproject("carbon", "Snd")
genpluginproject("TE", libraries=["DragLib"]) genpluginproject("all", "Sndihooks", sources=[":snd:Sndihooks.c"])
genpluginproject("ppc", "TE", libraries=["DragLib"])
genpluginproject("carbon", "TE")
# Other Mac modules # Other Mac modules
genpluginproject("calldll", sources=["calldll.c"]) genpluginproject("all", "calldll", sources=["calldll.c"])
genpluginproject("ColorPicker") genpluginproject("all", "ColorPicker")
genpluginproject("Printing") genpluginproject("ppc", "Printing")
genpluginproject("waste", genpluginproject("ppc", "waste",
sources=[ sources=[
"wastemodule.c", "wastemodule.c",
'WEAccessors.c', 'WEBirthDeath.c', 'WEDebug.c', 'WEAccessors.c', 'WEBirthDeath.c', 'WEDebug.c',
@ -122,11 +158,11 @@ def genallprojects(force=0):
'::::Waste 1.3 Distribution:*', '::::Waste 1.3 Distribution:*',
'::::ICProgKit1.4:APIs'] '::::ICProgKit1.4:APIs']
) )
genpluginproject("ctb") genpluginproject("ppc", "ctb")
genpluginproject("icglue", sources=["icgluemodule.c"], genpluginproject("ppc", "icglue", sources=["icgluemodule.c"],
libraries=["ICGlueCFM-PPC.lib"], libraries=["ICGlueCFM-PPC.lib"],
extradirs=["::::ICProgKit1.4:APIs"]) extradirs=["::::ICProgKit1.4:APIs"])
genpluginproject("macspeech", libraries=["SpeechLib"]) genpluginproject("ppc", "macspeech", libraries=["SpeechLib"])
if __name__ == '__main__': if __name__ == '__main__':
genallprojects() genallprojects()