From 47b2cb0880f26454f9d30a6124a624f2f614c647 Mon Sep 17 00:00:00 2001 From: starkos Date: Fri, 30 Jan 2009 18:51:56 +0000 Subject: [PATCH] Updated bytecodes and changelog --- src/host/scripts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/host/scripts.c b/src/host/scripts.c index b400123e..4ac4be2d 100644 --- a/src/host/scripts.c +++ b/src/host/scripts.c @@ -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',[[\n\n \">\n <% for prj in premake.eachproject(this) do %>\n .cbp\"<%= iif(prj.project==this.projects[1], ' active=\"1\"', '') %>>\n <% for _,dep in ipairs(premake.getdependencies(prj)) do %>\n .cbp\" />\n <% end %>\n \n <% end %>\n \n\n]])", - "_TEMPLATES.codeblocks_cbp=premake.loadtemplatestring('codeblocks_cbp',[[<% local cc = premake[_OPTIONS.cc] %>\n\n\n \n \n \n\n]])", + "_TEMPLATES.codeblocks_cbp=premake.loadtemplatestring('codeblocks_cbp',[[<% local cc = premake[_OPTIONS.cc] %>\n\n\n \n \n \n\n]])", "_TEMPLATES.codelite_workspace=premake.loadtemplatestring('codelite_workspace',[[\n\" Database=\"./<%= premake.esc(this.name) %>.tags\">\n<% for i,prj in ipairs(this.projects) do %>\n \" Path=\"<%= path.join(path.getrelative(this.location, prj.location), prj.name) %>.project\" Active=\"<%= iif(i==1, \"Yes\", \"No\") %>\" />\n<% end %>\n \n <% for _, cfgname in ipairs(this.configurations) do %>\n \" Selected=\"yes\">\n <% for _,prj in ipairs(this.projects) do %>\n \" ConfigName=\"<%= cfgname %>\"/>\n <% end %>\n \n <% end %>\n \n\n]])", "_TEMPLATES.codelite_project=premake.loadtemplatestring('codelite_project',[[\n\">\n <% premake.walksources(this, this.files, _CODELITE.files) %>\n \">\n <% for cfg in premake.eachconfig(this) do %>\n \" CompilerType=\"gnu <%= iif(cfg.language == \"C\", \"gcc\", \"g++\") %>\" DebuggerType=\"GNU gdb debugger\" Type=\"<%= _CODELITE.kind(cfg.kind) %>\">\n \" IntermediateDirectory=\"<%= premake.esc(cfg.objectsdir) %>\" Command=\"./<%= cfg.buildtarget.name %>\" CommandArguments=\"\" WorkingDirectory=\"<%= cfg.buildtarget.directory %>\" PauseExecWhenProcTerminates=\"<%= iif(cfg.kind == \"WindowedApp\", \"no\", \"yes\") %>\"/>\n \">\n <% for _,v in ipairs(cfg.includedirs) do %>\n \"/>\n <% end %>\n <% for _,v in ipairs(cfg.defines) do %>\n \"/>\n <% end %>\n \n \">\n <% for _,v in ipairs(premake.getlinks(cfg, \"all\", \"directory\")) do %>\n \" />\n <% end %>\n <% for _,v in ipairs(premake.getlinks(cfg, \"all\", \"basename\")) do %>\n \" />\n <% end %>\n \n <% if premake.findfile(cfg, \".rc\") then %>\n <%= table.concat(cfg.resoptions, \";\") %>\">\n <% for _,v in ipairs(table.join(cfg.includedirs, cfg.resincludedirs)) do %>\n \"/>\n <% end %>\n \n <% else %>\n \n <% end %>\n <% if #cfg.prebuildcommands > 0 then %>\n \n <% for _,v in ipairs(cfg.prebuildcommands) do %>\n <%= premake.esc(v) %>\n <% end %>\n \n <% end %>\n <% if #cfg.postbuildcommands > 0 then %>\n \n <% for _,v in ipairs(cfg.postbuildcommands) do %>\n <%= premake.esc(v) %>\n <% end %>\n \n <% end %>\n \n \n \n \n \n None\n \n \n \n \n \n \n \n <%end %>\n \n <% for _,cfgname in ipairs(this.configurations) do %>\n \">\n <% for _,dep in ipairs(premake.getdependencies(this)) do %>\n \"/>\n <% end %>\n \n <% end %>\n\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]])",