Commit 0bd90530 authored by Legodev's avatar Legodev

compacted makefile

parent 75e130ef
......@@ -14,12 +14,17 @@ if os.name != 'nt':
namespace = "@Desolation"
keypath = sourcePath / "Keys" / "DesolationREDUX.{}.biprivatekey".format(branch)
projectPath = sourcePath / repo / namespace / "Addons"
projectPath = sourcePath / repo / namespace / "Add ons"
sourceAddonsPath = projectPath
destinationpath = sourcePath / branch / repo / "Addons"
addonlist = [x for x in filter(os.path.isdir, os.listdir(sourceAddonsPath))]
addonlist = [x for x in os.listdir(sourceAddonsPath) if os.path.isdir(sourceAddonsPath / x)]
with open("Makefile", "w") as f:
print('ADDONBUILDEREXEPATH="{}"'.format(addonBuilderExePath), file=f)
print('SOURCEADDONSPATH="{}"'.format(sourceAddonsPath), file=f)
print('DESTINATIONPATH="{}"'.format(destinationpath), file=f)
print('PROJECTPATH="{}"'.format(projectPath), file=f)
print('KEYPATH="{}"'.format(keypath), file=f)
print(createmakefilealldependencies(destinationpath, addonlist), file=f)
for addon in addonlist:
......@@ -27,10 +32,10 @@ with open("Makefile", "w") as f:
configfiles = findconfigfiles(sourceAddonsPath / addon)
sourceAddonPath = sourceAddonsPath / addon
for configfile in configfiles:
dependencies += ["{}.pbo".format(x) for x in getdependencylist(configfile) if
dependencies += [x for x in getdependencylist(configfile) if
x in addonlist and not x in dependencies]
print("", file=f)
print(createaddonmakefiledependencies(addon, sourceAddonPath, destinationpath, dependencies), file=f)
print(createaddonmakefiledependencies(addon, sourceAddonsPath, destinationpath, dependencies), file=f)
print('\t{}'.format(createaddonbuildercmd(projectPath, sourceAddonPath, namespace,
addon, destinationpath, keypath)), file=f)
......@@ -4,12 +4,15 @@ arma3ToolsPath = Path("C:/Program Files (x86)/Steam/steamapps/common/Arma 3 Tool
addonBuilderExePath = arma3ToolsPath / "AddonBuilder/AddonBuilder.exe"
def createaddonbuildercmd(projectPath, sourceAddonPath, namespace, addon, destinationpath, keypath):
def createaddonbuildercmd(projectPath, sourceAddonsPath, namespace, addon, destinationpath, keypath):
sourceAddonPath = sourceAddonsPath / addon
cmd = (str(addonBuilderExePath), str(sourceAddonPath), str(destinationpath), '-clear', '-sign="{}"'.format(keypath),
'-project="{}"'.format(projectPath), '-binarizeAllTextures')
cmdshell = '"{}" "{}" "{}" -clear -sign="{}" -project="{}" -binarizeAllTextures'.format(addonBuilderExePath,
sourceAddonPath,
destinationpath,
keypath, projectPath)
cmdshell = '"{}" "{}" "{}" -clear -sign="{}" -project="{}" -binarizeAllTextures'.format("${ADDONBUILDEREXEPATH}",
"${SOURCEADDONSPATH}/" + addon,
"${DESTINATIONPATH}",
"${KEYPATH}",
"${PROJECTPATH}")
return cmdshell
def createmakefilealldependencies(destinationpath, addonlist):
dependencies = [str(destinationpath / dependency) + '.pbo' for dependency in addonlist]
dependencies = ["${{DESTINATIONPATH}}/{}.pbo".format(dependency) for dependency in addonlist]
return 'all: {}'.format(' '.join(dependencies))
def createaddonmakefiledependencies(addon, sourceAddonPath, destinationpath, dependencies):
dependencies = [str(destinationpath / dependency) for dependency in dependencies]
return '{}.pbo: $(shell find "{}" -type f) {}'.format(addon, sourceAddonPath, ' '.join(dependencies))
\ No newline at end of file
dependencies = ["${{DESTINATIONPATH}}/{}.pbo".format(dependency) for dependency in dependencies]
return '${{DESTINATIONPATH}}/{}.pbo: $(shell find "{}" -type f) {}'.format(addon, sourceAddonPath, ' '.join(dependencies))
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment