Updated bytecodes and changelog

This commit is contained in:
starkos 2009-01-30 18:51:56 +00:00
parent 2062e69084
commit 47b2cb0880

View File

@ -19,7 +19,7 @@ const char* builtin_scripts[] = {
"--\n\n\nfunction premake.showhelp()\n\n-- sort the lists of actions and options into alphabetical order\nactions = { }\nfor name,_ in pairs(premake.actions) do table.insert(actions, name) end\ntable.sort(actions)\n\noptions = { }\nfor name,_ in pairs(premake.options) do table.insert(options, name) end\ntable.sort(options)\n\n\n-- display the basic usage\nprintf(\"Premake %s, a build script generator\", _PREMAKE_VERSION)\nprintf(_PREMAKE_COPYRIGHT)\nprintf(\"%s %s\", _VERSION, _COPYRIGHT)\nprintf(\"\")\nprintf(\"Usage: premake4 [options] action [arguments]\")\nprintf(\"\")\n\n\n-- display all options\nprintf(\"OPTIONS\")\nprintf(\"\")\nfor _,name in ipairs(options) do\nlocal opt = premake.options[name]\nlocal trigger = opt.trigger\nlocal description = opt.description\n\nif (opt.value) then trigger = trigger .. \"=\" .. opt.value end\nif (opt.allowed) then description = description .. \"; one of:\" end\n\nprintf(\" --%-15s %s\", trigger, description) \nif (opt.allowed) then\ntable.sort(opt.allowed, function(a,b) return a[1] < b[1] end)\nfor _, value in ipairs(opt.allowed) do\nprintf(\" %-14s %s\", value[1], value[2])\nend\nend\nprintf(\"\")\nend\n\n-- display all actions\nprintf(\"ACTIONS\")\nprintf(\"\")\nfor _,name in ipairs(actions) do\nprintf(\" %-17s %s\", name, premake.actions[name].description)\nend\nprintf(\"\")\n\n\n-- see more\nprintf(\"For additional information, see http://industriousone.com/premake\")\n\nend\n\n\n",
"--\n\n\nlocal scriptfile = \"premake4.lua\"\nlocal shorthelp = \"Type 'premake4 --help' for help\"\nlocal versionhelp = \"premake4 (Premake Build Script Generator) %s\"\n\n\n\n\nlocal function doaction(name)\nlocal action = premake.actions[name]\n\n-- walk the session objects and generate files from the templates\nlocal function generatefiles(this, templates)\nif (not templates) then return end\nfor _,tmpl in ipairs(templates) do\nlocal output = true\nif (tmpl[3]) then\noutput = tmpl[3](this)\nend\nif (output) then\nlocal fname = path.getrelative(os.getcwd(), premake.getoutputname(this, tmpl[1]))\nprintf(\"Generating %s...\", fname)\nlocal f, err = io.open(fname, \"wb\")\nif (not f) then\nerror(err, 0)\nend\nio.output(f)\n\n-- call the template function to generate the output\ntmpl[2](this)\n\nio.output():close()\nend\nend\nend\n\nfor _,sln in ipairs(_SOLUTIONS) do\ngeneratefiles(sln, action.solutiontemplates)\nfor prj in premake.eachproject(sln) do\ngeneratefiles(prj, action.projecttemplates)\nend\nend\n\nif (action.execute) then\naction.execute()\nend\nend\n\n\n\n\nfunction _premake_main(scriptpath)\n\n-- if running off the disk (in debug mode), load everything \n-- listed in _manifest.lua; the list divisions make sure\n-- everything gets initialized in the proper order.\n\nif (scriptpath) then\nlocal scripts, templates, actions = dofile(scriptpath .. \"/_manifest.lua\")\n\n-- core code first\nfor _,v in ipairs(scripts) do\ndofile(scriptpath .. \"/\" .. v)\nend\n\n-- then the templates\nfor _,v in ipairs(templates) do\nlocal name = path.getbasename(v)\n_TEMPLATES[name] = premake.loadtemplatefile(scriptpath .. \"/\" .. v)\nend\n\n-- finally the actions\nfor _,v in ipairs(actions) do\ndofile(scriptpath .. \"/\" .. v)\nend\nend\n\n\n-- If there is a project script available, run it to get the\n-- project information, available options and actions, etc.\n\nlocal fname = _OPTIONS[\"file\"] or scriptfile\nif (os.isfile(fname)) then\ndofile(fname)\nend\n\n\n-- Process special options\n\nif (_OPTIONS[\"version\"]) then\nprintf(versionhelp, _PREMAKE_VERSION)\nreturn 1\nend\n\nif (_OPTIONS[\"help\"]) then\npremake.showhelp()\nreturn 1\nend\n\n\n-- If no action was specified, show a short help message\n\nif (not _ACTION) then\nprint(shorthelp)\nreturn 1\nend\n\n\n-- If there wasn't a project script I've got to bail now\n\nif (not os.isfile(fname)) then\nerror(\"No Premake script (\"..scriptfile..\") found!\", 2)\nend\n\n\n-- Validate the command-line arguments. This has to happen after the\n-- script has run to allow for project-specific options\n\nif (not premake.actions[_ACTION]) then\nerror(\"Error: no such action '\".._ACTION..\"'\", 0)\nend\n\nok, err = premake.checkoptions()\nif (not ok) then error(\"Error: \" .. err, 0) end\n\n\n-- Sanity check the current project setup\n\nok, err = premake.checktools()\nif (not ok) then error(\"Error: \" .. err, 0) end\n\n-- work-in-progress: build the configurations\nprint(\"Building configurations...\")\npremake.buildconfigs()\n\nok, err = premake.checkprojects()\nif (not ok) then error(\"Error: \" .. err, 0) end\n\n\n-- Hand over control to the action\nprintf(\"Running action '%s'...\", _ACTION)\ndoaction(_ACTION)\n\nprint(\"Done.\")\nreturn 0\n\nend\n",
"_TEMPLATES.codeblocks_workspace=premake.loadtemplatestring('codeblocks_workspace',[[<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n<CodeBlocks_workspace_file>\n <Workspace title=\"<%= this.name %>\">\n <% for prj in premake.eachproject(this) do %>\n <Project filename=\"<%= path.join(path.getrelative(this.location, prj.location), prj.name) %>.cbp\"<%= iif(prj.project==this.projects[1], ' active=\"1\"', '') %>>\n <% for _,dep in ipairs(premake.getdependencies(prj)) do %>\n <Depends filename=\"<%= path.join(path.getrelative(this.location, dep.location), dep.name) %>.cbp\" />\n <% end %>\n </Project>\n <% end %>\n </Workspace>\n</CodeBlocks_workspace_file>\n]])",
"_TEMPLATES.codeblocks_cbp=premake.loadtemplatestring('codeblocks_cbp',[[<% local cc = premake[_OPTIONS.cc] %>\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n<CodeBlocks_project_file>\n <FileVersion major=\"1\" minor=\"6\" />\n <Project>\n <Option title=\"<%= premake.esc(this.name) %>\" />\n <Option pch_mode=\"2\" />\n <Option compiler=\"<%= _OPTIONS.cc %>\" />\n <Build>\n <% for cfg in premake.eachconfig(this) do %>\n <Target title=\"<%= premake.esc(cfg.name) %>\">\n <Option output=\"<%= premake.esc(cfg.buildtarget.fullpath) %>\" prefix_auto=\"0\" extension_auto=\"0\" />\n <Option object_output=\"<%= premake.esc(cfg.objectsdir) %>\" />\n <% if (cfg.kind == \"WindowedApp\") then %>\n <Option type=\"0\" />\n <% elseif (cfg.kind == \"ConsoleApp\") then %>\n <Option type=\"1\" />\n <% elseif (cfg.kind == \"StaticLib\") then %>\n <Option type=\"2\" />\n <% elseif (cfg.kind == \"SharedLib\") then %>\n <Option type=\"3\" />\n <% end %>\n <Option compiler=\"<%= _OPTIONS.cc %>\" />\n <% if (cfg.kind == \"SharedLib\") then %>\n <Option createDefFile=\"0\" />\n <Option createStaticLib=\"<%= iif(cfg.flags.NoImportLib, 0, 1) %>\" />\n <% end %>\n <Compiler>\n <% for _,flag in ipairs(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cc.getdefines(cfg.defines), cfg.buildoptions)) do %>\n <Add option=\"<%= premake.esc(flag) %>\" />\n <% end %>\n <% if not cfg.flags.NoPCH and cfg.pchheader then %>\n <Add option=\"-Winvalid-pch\" />\n <Add option=\"-include &quot;<%= premake.esc(cfg.pchheader) %>&quot;\" />\n <% end %>\n <% for _,v in ipairs(cfg.includedirs) do %>\n <Add directory=\"<%= premake.esc(v) %>\" />\n <% end %>\n </Compiler>\n <Linker>\n <% if cfg.flags.NoSymbols then %>\n <Add options=\"-s\" />\n <% end %>\n <% for _,v in ipairs(cfg.linkoptions) do %>\n <Add option=\"<%= premake.esc(v) %>\" />\n <% end %>\n <% for _,v in ipairs(premake.getlinks(cfg, \"all\", \"directory\")) do %>\n <Add directory=\"<%= premake.esc(v) %>\" />\n <% end %>\n <% for _,v in ipairs(premake.getlinks(cfg, \"all\", \"basename\")) do %>\n <Add library=\"<%= premake.esc(v) %>\" />\n <% end %>\n </Linker>\n <% if premake.findfile(cfg, \".rc\") then %>\n <ResourceCompiler>\n <% for _,v in ipairs(cfg.includedirs) do %>\n <Add directory=\"<%= premake.esc(v) %>\" />\n <% end %>\n <% for _,v in ipairs(cfg.resincludedirs) do %>\n <Add directory=\"<%= premake.esc(v) %>\" />\n <% end %>\n </ResourceCompiler>\n <% end %>\n <% if #cfg.prebuildcommands > 0 or #cfg.postbuildcommands > 0 then %>\n <ExtraCommands>\n <% for _,v in ipairs(cfg.prebuildcommands) do %>\n <Add before=\"<%= premake.esc(v) %>\" />\n <% end %>\n <% for _,v in ipairs(cfg.postbuildcommands) do %>\n <Add after=\"<%= premake.esc(v) %>\" />\n <% end %>\n </ExtraCommands>\n <% end %>\n </Target>\n <% end %>\n </Build>\n <% for _,fname in ipairs(this.files) do %>\n <Unit filename=\"<%= premake.esc(fname) %>\">\n <% if path.getextension(fname) == \".rc\" then %>\n <Option compilerVar=\"WINDRES\" />\n <% elseif path.iscppfile(fname) then %>\n <Option compilerVar=\"<%= iif(this.language == \"C\", \"CC\", \"CPP\") %>\" />\n <% if (not this.flags.NoPCH and fname == this.pchheader) then %>\n <Option compile=\"1\" />\n <Option weight=\"0\" />\n <% end %>\n <% end %>\n </Unit>\n <% end %>\n <Extensions />\n </Project>\n</CodeBlocks_project_file>\n]])",
"_TEMPLATES.codeblocks_cbp=premake.loadtemplatestring('codeblocks_cbp',[[<% local cc = premake[_OPTIONS.cc] %>\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n<CodeBlocks_project_file>\n <FileVersion major=\"1\" minor=\"6\" />\n <Project>\n <Option title=\"<%= premake.esc(this.name) %>\" />\n <Option pch_mode=\"2\" />\n <Option compiler=\"<%= _OPTIONS.cc %>\" />\n <Build>\n <% for cfg in premake.eachconfig(this) do %>\n <Target title=\"<%= premake.esc(cfg.name) %>\">\n <Option output=\"<%= premake.esc(cfg.buildtarget.fullpath) %>\" prefix_auto=\"0\" extension_auto=\"0\" />\n <Option object_output=\"<%= premake.esc(cfg.objectsdir) %>\" />\n <% if (cfg.kind == \"WindowedApp\") then %>\n <Option type=\"0\" />\n <% elseif (cfg.kind == \"ConsoleApp\") then %>\n <Option type=\"1\" />\n <% elseif (cfg.kind == \"StaticLib\") then %>\n <Option type=\"2\" />\n <% elseif (cfg.kind == \"SharedLib\") then %>\n <Option type=\"3\" />\n <% end %>\n <Option compiler=\"<%= _OPTIONS.cc %>\" />\n <% if (cfg.kind == \"SharedLib\") then %>\n <Option createDefFile=\"0\" />\n <Option createStaticLib=\"<%= iif(cfg.flags.NoImportLib, 0, 1) %>\" />\n <% end %>\n <Compiler>\n <% for _,flag in ipairs(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cc.getdefines(cfg.defines), cfg.buildoptions)) do %>\n <Add option=\"<%= premake.esc(flag) %>\" />\n <% end %>\n <% if not cfg.flags.NoPCH and cfg.pchheader then %>\n <Add option=\"-Winvalid-pch\" />\n <Add option=\"-include &quot;<%= premake.esc(cfg.pchheader) %>&quot;\" />\n <% end %>\n <% for _,v in ipairs(cfg.includedirs) do %>\n <Add directory=\"<%= premake.esc(v) %>\" />\n <% end %>\n </Compiler>\n <Linker>\n <% for _,flag in ipairs(table.join(cc.getldflags(cfg), cfg.linkoptions)) do %>\n <Add option=\"<%= premake.esc(flag) %>\" />\n <% end %>\n <% for _,v in ipairs(premake.getlinks(cfg, \"all\", \"directory\")) do %>\n <Add directory=\"<%= premake.esc(v) %>\" />\n <% end %>\n <% for _,v in ipairs(premake.getlinks(cfg, \"all\", \"basename\")) do %>\n <Add library=\"<%= premake.esc(v) %>\" />\n <% end %>\n </Linker>\n <% if premake.findfile(cfg, \".rc\") then %>\n <ResourceCompiler>\n <% for _,v in ipairs(cfg.includedirs) do %>\n <Add directory=\"<%= premake.esc(v) %>\" />\n <% end %>\n <% for _,v in ipairs(cfg.resincludedirs) do %>\n <Add directory=\"<%= premake.esc(v) %>\" />\n <% end %>\n </ResourceCompiler>\n <% end %>\n <% if #cfg.prebuildcommands > 0 or #cfg.postbuildcommands > 0 then %>\n <ExtraCommands>\n <% for _,v in ipairs(cfg.prebuildcommands) do %>\n <Add before=\"<%= premake.esc(v) %>\" />\n <% end %>\n <% for _,v in ipairs(cfg.postbuildcommands) do %>\n <Add after=\"<%= premake.esc(v) %>\" />\n <% end %>\n </ExtraCommands>\n <% end %>\n </Target>\n <% end %>\n </Build>\n <% for _,fname in ipairs(this.files) do %>\n <Unit filename=\"<%= premake.esc(fname) %>\">\n <% if path.getextension(fname) == \".rc\" then %>\n <Option compilerVar=\"WINDRES\" />\n <% elseif path.iscppfile(fname) then %>\n <Option compilerVar=\"<%= iif(this.language == \"C\", \"CC\", \"CPP\") %>\" />\n <% if (not this.flags.NoPCH and fname == this.pchheader) then %>\n <Option compile=\"1\" />\n <Option weight=\"0\" />\n <% end %>\n <% end %>\n </Unit>\n <% end %>\n <Extensions />\n </Project>\n</CodeBlocks_project_file>\n]])",
"_TEMPLATES.codelite_workspace=premake.loadtemplatestring('codelite_workspace',[[<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<CodeLite_Workspace Name=\"<%= premake.esc(this.name) %>\" Database=\"./<%= premake.esc(this.name) %>.tags\">\n<% for i,prj in ipairs(this.projects) do %>\n <Project Name=\"<%= premake.esc(prj.name) %>\" Path=\"<%= path.join(path.getrelative(this.location, prj.location), prj.name) %>.project\" Active=\"<%= iif(i==1, \"Yes\", \"No\") %>\" />\n<% end %>\n <BuildMatrix>\n <% for _, cfgname in ipairs(this.configurations) do %>\n <WorkspaceConfiguration Name=\"<%= cfgname %>\" Selected=\"yes\">\n <% for _,prj in ipairs(this.projects) do %>\n <Project Name=\"<%= prj.name %>\" ConfigName=\"<%= cfgname %>\"/>\n <% end %>\n </WorkspaceConfiguration>\n <% end %>\n </BuildMatrix>\n</CodeLite_Workspace>\n]])",
"_TEMPLATES.codelite_project=premake.loadtemplatestring('codelite_project',[[<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<CodeLite_Project Name=\"<%= premake.esc(this.name) %>\">\n <% premake.walksources(this, this.files, _CODELITE.files) %>\n <Settings Type=\"<%= _CODELITE.kind(this.kind) %>\">\n <% for cfg in premake.eachconfig(this) do %>\n <Configuration Name=\"<%= premake.esc(cfg.name) %>\" CompilerType=\"gnu <%= iif(cfg.language == \"C\", \"gcc\", \"g++\") %>\" DebuggerType=\"GNU gdb debugger\" Type=\"<%= _CODELITE.kind(cfg.kind) %>\">\n <General OutputFile=\"<%= premake.esc(cfg.buildtarget.fullpath) %>\" IntermediateDirectory=\"<%= premake.esc(cfg.objectsdir) %>\" Command=\"./<%= cfg.buildtarget.name %>\" CommandArguments=\"\" WorkingDirectory=\"<%= cfg.buildtarget.directory %>\" PauseExecWhenProcTerminates=\"<%= iif(cfg.kind == \"WindowedApp\", \"no\", \"yes\") %>\"/>\n <Compiler Required=\"yes\" Options=\"<%= table.concat(table.join(premake.gcc.getcflags(cfg), premake.gcc.getcxxflags(cfg), cfg.buildoptions), \";\") %>\">\n <% for _,v in ipairs(cfg.includedirs) do %>\n <IncludePath Value=\"<%= premake.esc(v) %>\"/>\n <% end %>\n <% for _,v in ipairs(cfg.defines) do %>\n <Preprocessor Value=\"<%= premake.esc(v) %>\"/>\n <% end %>\n </Compiler>\n <Linker Required=\"yes\" Options=\"<%= table.concat(premake.esc(table.join(premake.gcc.getldflags(cfg), cfg.linkoptions)), \";\") %>\">\n <% for _,v in ipairs(premake.getlinks(cfg, \"all\", \"directory\")) do %>\n <LibraryPath Value=\"<%= premake.esc(v) %>\" />\n <% end %>\n <% for _,v in ipairs(premake.getlinks(cfg, \"all\", \"basename\")) do %>\n <Library Value=\"<%= premake.esc(v) %>\" />\n <% end %>\n </Linker>\n <% if premake.findfile(cfg, \".rc\") then %>\n <ResourceCompiler Required=\"yes\" Options=\"<%= table.implode(table.join(cfg.defines,cfg.resdefines), \"-D\", \";\", \"\") %><%= table.concat(cfg.resoptions, \";\") %>\">\n <% for _,v in ipairs(table.join(cfg.includedirs, cfg.resincludedirs)) do %>\n <IncludePath Value=\"<%= premake.esc(v) %>\"/>\n <% end %>\n </ResourceCompiler>\n <% else %>\n <ResourceCompiler Required=\"no\" Options=\"\"/>\n <% end %>\n <% if #cfg.prebuildcommands > 0 then %>\n <PreBuild>\n <% for _,v in ipairs(cfg.prebuildcommands) do %>\n <Command Enabled=\"yes\"><%= premake.esc(v) %></Command>\n <% end %>\n </PreBuild>\n <% end %>\n <% if #cfg.postbuildcommands > 0 then %>\n <PostBuild>\n <% for _,v in ipairs(cfg.postbuildcommands) do %>\n <Command Enabled=\"yes\"><%= premake.esc(v) %></Command>\n <% end %>\n </PostBuild>\n <% end %>\n <CustomBuild Enabled=\"no\">\n <CleanCommand></CleanCommand>\n <BuildCommand></BuildCommand>\n <SingleFileCommand></SingleFileCommand>\n <MakefileGenerationCommand></MakefileGenerationCommand>\n <ThirdPartyToolName>None</ThirdPartyToolName>\n <WorkingDirectory></WorkingDirectory>\n </CustomBuild>\n <AdditionalRules>\n <CustomPostBuild></CustomPostBuild>\n <CustomPreBuild></CustomPreBuild>\n </AdditionalRules>\n </Configuration>\n <%end %>\n </Settings>\n <% for _,cfgname in ipairs(this.configurations) do %>\n <Dependencies name=\"<%= cfgname %>\">\n <% for _,dep in ipairs(premake.getdependencies(this)) do %>\n <Project Name=\"<%= dep.name %>\"/>\n <% end %>\n </Dependencies>\n <% end %>\n</CodeLite_Project>\n]])",
"_TEMPLATES.make_solution=premake.loadtemplatestring('make_solution',[[# <%= premake.actions[_ACTION].shortname %> solution makefile autogenerated by Premake\n# Usage: make [ config=config_name ]\n# Where {config_name} is one of: <%= table.implode(this.configurations, '\"', '\"', ', '):lower() %>.\n\nifndef config\n config=<%= _MAKE.esc(this.configurations[1]:lower()) %>\nendif\nexport config\n\nPROJECTS := <%= table.concat(_MAKE.esc(table.extract(this.projects, \"name\")), \" \") %>\n\n.PHONY: all clean $(PROJECTS)\n\nall: $(PROJECTS)\n\n<% for _,prj in ipairs(this.projects) do %>\n <% for cfg in premake.eachconfig(prj) do %>\nifeq ($(config),<%= _MAKE.esc(cfg.name:lower())%>)\n DEPENDENCIES := <%= table.concat(_MAKE.esc(table.extract(premake.getdependencies(cfg), \"name\")), \" \") %>\nendif\n <% end %>\n\n<%= _MAKE.esc(prj.name) %>: ${DEPENDENCIES}\n @echo ==== Building <%= prj.name %> ====\n @${MAKE} --no-print-directory -C <%=_MAKE.esc(path.getrelative(this.location, prj.location))%> -f <%=_MAKE.esc(_MAKE.getmakefilename(prj, true))%>\n \n<% end %>\n\nclean:\n<% for _,prj in ipairs(this.projects) do %>\n @${MAKE} --no-print-directory -C <%=_MAKE.esc(path.getrelative(this.location, prj.location))%> -f <%=_MAKE.esc(_MAKE.getmakefilename(prj, true))%> clean\n<% end %>\n]])",