premake-4.3-src+repack1/0000775000000000000000000000000012133645023013612 5ustar rootrootpremake-4.3-src+repack1/build/0000755000000000000000000000000011470465413014715 5ustar rootrootpremake-4.3-src+repack1/build/xcode3/0000755000000000000000000000000011470465413016102 5ustar rootrootpremake-4.3-src+repack1/build/xcode3/Premake4.xcodeproj/0000755000000000000000000000000011470465413021546 5ustar rootrootpremake-4.3-src+repack1/build/xcode3/Premake4.xcodeproj/project.pbxproj0000644000000000000000000016555011470465413024636 0ustar rootroot// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 45; objects = { /* Begin PBXBuildFile section */ 5D097E22261F7D3E16C45DDF /* lapi.c in Sources */ = {isa = PBXBuildFile; fileRef = 2F6A5B95436069A36AE42537 /* lapi.c */; }; 5A0655AB643D77EE3C327A64 /* lauxlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 443705EC6E5D514C654B25DD /* lauxlib.c */; }; 175648A00BE050BD349E27D2 /* lbaselib.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D6E113F00B56B886D6E0000 /* lbaselib.c */; }; 6A523B03464B7A40381B2D19 /* lcode.c in Sources */ = {isa = PBXBuildFile; fileRef = 05D118571FB33CCF6A6B2E6A /* lcode.c */; }; 53CD584F509E6A031E2C19BA /* ldblib.c in Sources */ = {isa = PBXBuildFile; fileRef = 7F83317E4C8C008279FC2B52 /* ldblib.c */; }; 456057950A3537C569AF740E /* ldebug.c in Sources */ = {isa = PBXBuildFile; fileRef = 1B4F6CFE1831548641873A70 /* ldebug.c */; }; 4DCA2FEC48FB6A2B64DA559B /* ldo.c in Sources */ = {isa = PBXBuildFile; fileRef = 13E7247270E54C4F5D7C038B /* ldo.c */; }; 61301CDE3E65619A57C550D8 /* ldump.c in Sources */ = {isa = PBXBuildFile; fileRef = 39D40F330702545479B96DA6 /* ldump.c */; }; 7CB557CF7A04201761D256D5 /* lfunc.c in Sources */ = {isa = PBXBuildFile; fileRef = 35F90D20478453092F517A4B /* lfunc.c */; }; 4E634B7F7F5B5C7058E5336F /* lgc.c in Sources */ = {isa = PBXBuildFile; fileRef = 3CA656E42F1B34F6396C0B0E /* lgc.c */; }; 10CD389141A6049F0DE154E5 /* linit.c in Sources */ = {isa = PBXBuildFile; fileRef = 72492D65713D1A2B14F8303D /* linit.c */; }; 23101C612CD90EB30BDE514A /* liolib.c in Sources */ = {isa = PBXBuildFile; fileRef = 40CB00855B001CC97BB81CA9 /* liolib.c */; }; 7DDB4C1B220378BB707F5B3D /* llex.c in Sources */ = {isa = PBXBuildFile; fileRef = 056539240EFB0136054034BB /* llex.c */; }; 51C855975D7F639773855FE2 /* lmathlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 46043C8E37176AF93B097370 /* lmathlib.c */; }; 124D07F2368A27FE3C206147 /* lmem.c in Sources */ = {isa = PBXBuildFile; fileRef = 1B54583C653F1339065F6DAD /* lmem.c */; }; 70BB3E9478F3264066DE048E /* loadlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 4247665D704B015842077AAC /* loadlib.c */; }; 17516E863F9D684C6061140A /* lobject.c in Sources */ = {isa = PBXBuildFile; fileRef = 2C111D3302A554AA0DA3047E /* lobject.c */; }; 18E715713B683A157785449D /* lopcodes.c in Sources */ = {isa = PBXBuildFile; fileRef = 1CFD5E452ACE53DD742E7B87 /* lopcodes.c */; }; 471339AD1987104560145DD6 /* loslib.c in Sources */ = {isa = PBXBuildFile; fileRef = 35BC56AD0ECF5D8B6E803D4D /* loslib.c */; }; 647D61DF29FC1B4E46F866E2 /* lparser.c in Sources */ = {isa = PBXBuildFile; fileRef = 187B748637581E7266252952 /* lparser.c */; }; 0E4E36BC7CE87D40104679D1 /* lstate.c in Sources */ = {isa = PBXBuildFile; fileRef = 35BF3EE93C02557B06EF529E /* lstate.c */; }; 085200BC3EF753327A2E2027 /* lstring.c in Sources */ = {isa = PBXBuildFile; fileRef = 326E794B6A2352CD4A014607 /* lstring.c */; }; 0D8F44E53B77147C124D2B63 /* lstrlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 03657B9C48A41FA855900008 /* lstrlib.c */; }; 4260441143160A963711588A /* ltable.c in Sources */ = {isa = PBXBuildFile; fileRef = 7C270F0B4C0B7FE927DC7228 /* ltable.c */; }; 5A7E190139CE2153739618CF /* ltablib.c in Sources */ = {isa = PBXBuildFile; fileRef = 58440F0F396E6CF629CD75CE /* ltablib.c */; }; 4D3C28BF44E80FA071FC0211 /* ltm.c in Sources */ = {isa = PBXBuildFile; fileRef = 4505703C79EC217861BA2FE2 /* ltm.c */; }; 3BA152117B3027E354004EDF /* lundump.c in Sources */ = {isa = PBXBuildFile; fileRef = 12EB10BD6C365FD52FA44151 /* lundump.c */; }; 42E37150535B07E81FAA02B4 /* lvm.c in Sources */ = {isa = PBXBuildFile; fileRef = 65DF287063A7227229F13ADD /* lvm.c */; }; 0788332F56794EA749AE7644 /* lzio.c in Sources */ = {isa = PBXBuildFile; fileRef = 715E102D7AE5033862865B67 /* lzio.c */; }; 10E47DCB4A857A5A51AE0BC6 /* os_chdir.c in Sources */ = {isa = PBXBuildFile; fileRef = 0FA615321EB03989031572BB /* os_chdir.c */; }; 2F546E4C61E71D6F698A7322 /* os_copyfile.c in Sources */ = {isa = PBXBuildFile; fileRef = 10C2419E0B8416AE323F4D8E /* os_copyfile.c */; }; 6FC44CB11E6130FE7CA6785F /* os_getcwd.c in Sources */ = {isa = PBXBuildFile; fileRef = 6FA430F9353735BA518E6C94 /* os_getcwd.c */; }; 055E0F0B276F68DE7ACA0835 /* os_isdir.c in Sources */ = {isa = PBXBuildFile; fileRef = 4074028A38B5087574A52D10 /* os_isdir.c */; }; 4052648B65163458358945B3 /* os_isfile.c in Sources */ = {isa = PBXBuildFile; fileRef = 00E839841DA4257A6E9033DC /* os_isfile.c */; }; 7BB93B4A37DD0F857A200924 /* os_match.c in Sources */ = {isa = PBXBuildFile; fileRef = 6E9E63CE11F50476712C0FFA /* os_match.c */; }; 609E55CD108B2C1738172CAF /* os_mkdir.c in Sources */ = {isa = PBXBuildFile; fileRef = 369F152A2F097C6814055E34 /* os_mkdir.c */; }; 0D5D7FE955B836E04F3B4F0A /* os_pathsearch.c in Sources */ = {isa = PBXBuildFile; fileRef = 231365F6055A65DC7B965C79 /* os_pathsearch.c */; }; 1A8B5CAB14524E1007355DD6 /* os_rmdir.c in Sources */ = {isa = PBXBuildFile; fileRef = 45784C5504F2616066705FB1 /* os_rmdir.c */; }; 4FEB641F5D8F783E41067D52 /* os_uuid.c in Sources */ = {isa = PBXBuildFile; fileRef = 299F21212A03698330A12367 /* os_uuid.c */; }; 728A03A568D17CD9221F46C8 /* path_isabsolute.c in Sources */ = {isa = PBXBuildFile; fileRef = 49192EA8371A23521698130D /* path_isabsolute.c */; }; 0D16524A06E96C056C2C7926 /* premake.c in Sources */ = {isa = PBXBuildFile; fileRef = 2ADE100427D51CB005A675CF /* premake.c */; }; 2C8B01B677BC0A561BDD5CF8 /* scripts.c in Sources */ = {isa = PBXBuildFile; fileRef = 2B69356C55FA147C7B0C690E /* scripts.c */; }; 749D753D17FF167A4EE12563 /* string_endswith.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A78491274152CEF3349113F /* string_endswith.c */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 736F13995C9D05497E84388C /* BUILD.txt */ = {isa = PBXFileReference; lastKnownFileType = text; name = "BUILD.txt"; path = "../../BUILD.txt"; sourceTree = ""; }; 25D401AB4287699F7AA17671 /* CHANGES.txt */ = {isa = PBXFileReference; lastKnownFileType = text; name = "CHANGES.txt"; path = "../../CHANGES.txt"; sourceTree = ""; }; 0FEC50C608A273751DBD1B64 /* LICENSE.txt */ = {isa = PBXFileReference; lastKnownFileType = text; name = "LICENSE.txt"; path = "../../LICENSE.txt"; sourceTree = ""; }; 748A1B58398004922BA434B2 /* README.txt */ = {isa = PBXFileReference; lastKnownFileType = text; name = "README.txt"; path = "../../README.txt"; sourceTree = ""; }; 47E533405FF62B9A263D1809 /* premake4.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "premake4.lua"; path = "../../premake4.lua"; sourceTree = ""; }; 46B7490447AE2DB37F4054B6 /* embed.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "embed.lua"; path = "embed.lua"; sourceTree = ""; }; 18793DD66743646A7DF42543 /* release.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "release.lua"; path = "release.lua"; sourceTree = ""; }; 0B46492411495ED637DF510B /* _manifest.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "_manifest.lua"; path = "_manifest.lua"; sourceTree = ""; }; 471D54E2757C56260F9E0C88 /* _premake_main.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "_premake_main.lua"; path = "_premake_main.lua"; sourceTree = ""; }; 4ED30A4D459A0C4F293D65BC /* _clean.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "_clean.lua"; path = "_clean.lua"; sourceTree = ""; }; 7D6A56F6398D6117632D2E36 /* _codeblocks.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "_codeblocks.lua"; path = "_codeblocks.lua"; sourceTree = ""; }; 185F29C3684F3D2830020AA6 /* codeblocks_cbp.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "codeblocks_cbp.lua"; path = "codeblocks_cbp.lua"; sourceTree = ""; }; 34EC24A813F54DE92B5C2968 /* codeblocks_workspace.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "codeblocks_workspace.lua"; path = "codeblocks_workspace.lua"; sourceTree = ""; }; 1A1D081E0458611F591E61D8 /* _codelite.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "_codelite.lua"; path = "_codelite.lua"; sourceTree = ""; }; 40802CE8380151471C4F24A1 /* codelite_project.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "codelite_project.lua"; path = "codelite_project.lua"; sourceTree = ""; }; 752F7BA402DC5EBD0258643F /* codelite_workspace.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "codelite_workspace.lua"; path = "codelite_workspace.lua"; sourceTree = ""; }; 66E94BAE461E60BC13DE012D /* _example.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "_example.lua"; path = "_example.lua"; sourceTree = ""; }; 64E7344E14E624981A257345 /* example_project.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "example_project.lua"; path = "example_project.lua"; sourceTree = ""; }; 633E19FA07893DEF3C3E4361 /* example_solution.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "example_solution.lua"; path = "example_solution.lua"; sourceTree = ""; }; 11F909150254755526AE206A /* _make.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "_make.lua"; path = "_make.lua"; sourceTree = ""; }; 25EC2BDD60D8176B7FFD6A9A /* make_cpp.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "make_cpp.lua"; path = "make_cpp.lua"; sourceTree = ""; }; 62844A0540BE36004EEA1E41 /* make_csharp.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "make_csharp.lua"; path = "make_csharp.lua"; sourceTree = ""; }; 73CF43741FCC2AE737DD11A7 /* make_solution.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "make_solution.lua"; path = "make_solution.lua"; sourceTree = ""; }; 689728874AEE74E500B510D8 /* _vstudio.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "_vstudio.lua"; path = "_vstudio.lua"; sourceTree = ""; }; 0E42234E08560209392B6D61 /* vs2002_csproj.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "vs2002_csproj.lua"; path = "vs2002_csproj.lua"; sourceTree = ""; }; 340331494EFC0DE537054E20 /* vs2002_csproj_user.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "vs2002_csproj_user.lua"; path = "vs2002_csproj_user.lua"; sourceTree = ""; }; 408A4C1E05A20BA5234D53C4 /* vs2002_solution.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "vs2002_solution.lua"; path = "vs2002_solution.lua"; sourceTree = ""; }; 05AC04792D582841501E619E /* vs2003_solution.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "vs2003_solution.lua"; path = "vs2003_solution.lua"; sourceTree = ""; }; 7BC9511F6E52596F124A6825 /* vs2005_csproj.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "vs2005_csproj.lua"; path = "vs2005_csproj.lua"; sourceTree = ""; }; 63FE54D2424D65DC055A0ACB /* vs2005_csproj_user.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "vs2005_csproj_user.lua"; path = "vs2005_csproj_user.lua"; sourceTree = ""; }; 401730924F0907EA20E46F50 /* vs2005_solution.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "vs2005_solution.lua"; path = "vs2005_solution.lua"; sourceTree = ""; }; 006E756D6673468570D36543 /* vs200x_vcproj.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "vs200x_vcproj.lua"; path = "vs200x_vcproj.lua"; sourceTree = ""; }; 33D362B518D9546A7CDD3064 /* vs2010_vcxproxj.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "vs2010_vcxproxj.lua"; path = "vs2010_vcxproxj.lua"; sourceTree = ""; }; 32AE4D91217A532954992712 /* vs_generic_solution.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "vs_generic_solution.lua"; path = "vs_generic_solution.lua"; sourceTree = ""; }; 1CD70C4B3F131D9F628D3285 /* _xcode.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "_xcode.lua"; path = "_xcode.lua"; sourceTree = ""; }; 42585B8B19B96DD63DCD026F /* xcode_common.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "xcode_common.lua"; path = "xcode_common.lua"; sourceTree = ""; }; 7EA85EB20F1C1DF158C83F62 /* xcode_project.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "xcode_project.lua"; path = "xcode_project.lua"; sourceTree = ""; }; 50F86F472EEC26B830F34E38 /* action.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "action.lua"; path = "action.lua"; sourceTree = ""; }; 55B255B2390A78294D533018 /* api.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "api.lua"; path = "api.lua"; sourceTree = ""; }; 0D037F1E2A190A913E7C442B /* cmdline.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "cmdline.lua"; path = "cmdline.lua"; sourceTree = ""; }; 6B683A03429E4F56339C6DEF /* configs.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "configs.lua"; path = "configs.lua"; sourceTree = ""; }; 26A40D2E70DB7692142A5AFD /* globals.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "globals.lua"; path = "globals.lua"; sourceTree = ""; }; 4FBD3570547231CA69A2104A /* help.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "help.lua"; path = "help.lua"; sourceTree = ""; }; 70DA03501ABB25E70B9C3537 /* io.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "io.lua"; path = "io.lua"; sourceTree = ""; }; 43C75BDE5CB02DE65CD349F7 /* option.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "option.lua"; path = "option.lua"; sourceTree = ""; }; 23873460372E386B33A525F3 /* os.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "os.lua"; path = "os.lua"; sourceTree = ""; }; 022D6D59211312C22A3B2530 /* path.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "path.lua"; path = "path.lua"; sourceTree = ""; }; 7ECD471611E82F18032A3B6E /* premake.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "premake.lua"; path = "premake.lua"; sourceTree = ""; }; 3CE50BFF32C6030B011531F2 /* project.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "project.lua"; path = "project.lua"; sourceTree = ""; }; 3D5862947C80531066712411 /* solution.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "solution.lua"; path = "solution.lua"; sourceTree = ""; }; 072C06EB33FF493B56BE55AB /* string.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "string.lua"; path = "string.lua"; sourceTree = ""; }; 7079236176137EED0D8313C1 /* table.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "table.lua"; path = "table.lua"; sourceTree = ""; }; 2327597F2DDA72FB77551FAE /* tree.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "tree.lua"; path = "tree.lua"; sourceTree = ""; }; 608D04725D3D5971211A49F0 /* validate.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "validate.lua"; path = "validate.lua"; sourceTree = ""; }; 2F6A5B95436069A36AE42537 /* lapi.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "lapi.c"; path = "lapi.c"; sourceTree = ""; }; 7B63246455C12172751601C5 /* lapi.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lapi.h"; path = "lapi.h"; sourceTree = ""; }; 443705EC6E5D514C654B25DD /* lauxlib.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "lauxlib.c"; path = "lauxlib.c"; sourceTree = ""; }; 79DD1CC56204339E653036DE /* lauxlib.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lauxlib.h"; path = "lauxlib.h"; sourceTree = ""; }; 4D6E113F00B56B886D6E0000 /* lbaselib.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "lbaselib.c"; path = "lbaselib.c"; sourceTree = ""; }; 05D118571FB33CCF6A6B2E6A /* lcode.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "lcode.c"; path = "lcode.c"; sourceTree = ""; }; 68AE252D4B4B371F7D29279C /* lcode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lcode.h"; path = "lcode.h"; sourceTree = ""; }; 7F83317E4C8C008279FC2B52 /* ldblib.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "ldblib.c"; path = "ldblib.c"; sourceTree = ""; }; 1B4F6CFE1831548641873A70 /* ldebug.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "ldebug.c"; path = "ldebug.c"; sourceTree = ""; }; 4C6441A765CD18EA559963C8 /* ldebug.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "ldebug.h"; path = "ldebug.h"; sourceTree = ""; }; 13E7247270E54C4F5D7C038B /* ldo.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "ldo.c"; path = "ldo.c"; sourceTree = ""; }; 513E728E01781A5C3CA85F33 /* ldo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "ldo.h"; path = "ldo.h"; sourceTree = ""; }; 39D40F330702545479B96DA6 /* ldump.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "ldump.c"; path = "ldump.c"; sourceTree = ""; }; 35F90D20478453092F517A4B /* lfunc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "lfunc.c"; path = "lfunc.c"; sourceTree = ""; }; 543241E746E36E8F0DD344F9 /* lfunc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lfunc.h"; path = "lfunc.h"; sourceTree = ""; }; 3CA656E42F1B34F6396C0B0E /* lgc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "lgc.c"; path = "lgc.c"; sourceTree = ""; }; 5E906B6021C257A7280A58E0 /* lgc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lgc.h"; path = "lgc.h"; sourceTree = ""; }; 72492D65713D1A2B14F8303D /* linit.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "linit.c"; path = "linit.c"; sourceTree = ""; }; 40CB00855B001CC97BB81CA9 /* liolib.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "liolib.c"; path = "liolib.c"; sourceTree = ""; }; 056539240EFB0136054034BB /* llex.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "llex.c"; path = "llex.c"; sourceTree = ""; }; 11E774706A2E7F501BCF743E /* llex.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "llex.h"; path = "llex.h"; sourceTree = ""; }; 1EEA29C40AE0183744B3672B /* llimits.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "llimits.h"; path = "llimits.h"; sourceTree = ""; }; 46043C8E37176AF93B097370 /* lmathlib.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "lmathlib.c"; path = "lmathlib.c"; sourceTree = ""; }; 1B54583C653F1339065F6DAD /* lmem.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "lmem.c"; path = "lmem.c"; sourceTree = ""; }; 7C954612524131177ABB45EA /* lmem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lmem.h"; path = "lmem.h"; sourceTree = ""; }; 4247665D704B015842077AAC /* loadlib.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "loadlib.c"; path = "loadlib.c"; sourceTree = ""; }; 2C111D3302A554AA0DA3047E /* lobject.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "lobject.c"; path = "lobject.c"; sourceTree = ""; }; 3F1C7184281732E84B1E30B0 /* lobject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lobject.h"; path = "lobject.h"; sourceTree = ""; }; 1CFD5E452ACE53DD742E7B87 /* lopcodes.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "lopcodes.c"; path = "lopcodes.c"; sourceTree = ""; }; 24385CF247182A3539EB7BFD /* lopcodes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lopcodes.h"; path = "lopcodes.h"; sourceTree = ""; }; 35BC56AD0ECF5D8B6E803D4D /* loslib.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "loslib.c"; path = "loslib.c"; sourceTree = ""; }; 187B748637581E7266252952 /* lparser.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "lparser.c"; path = "lparser.c"; sourceTree = ""; }; 353D73D26788152013913961 /* lparser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lparser.h"; path = "lparser.h"; sourceTree = ""; }; 35BF3EE93C02557B06EF529E /* lstate.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "lstate.c"; path = "lstate.c"; sourceTree = ""; }; 2AAF7ABA010C69177A6641F6 /* lstate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lstate.h"; path = "lstate.h"; sourceTree = ""; }; 326E794B6A2352CD4A014607 /* lstring.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "lstring.c"; path = "lstring.c"; sourceTree = ""; }; 69B7718B5F1305DA2FB34F5F /* lstring.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lstring.h"; path = "lstring.h"; sourceTree = ""; }; 03657B9C48A41FA855900008 /* lstrlib.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "lstrlib.c"; path = "lstrlib.c"; sourceTree = ""; }; 7C270F0B4C0B7FE927DC7228 /* ltable.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "ltable.c"; path = "ltable.c"; sourceTree = ""; }; 7C1630281FE870CE1D137BE0 /* ltable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "ltable.h"; path = "ltable.h"; sourceTree = ""; }; 58440F0F396E6CF629CD75CE /* ltablib.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "ltablib.c"; path = "ltablib.c"; sourceTree = ""; }; 4505703C79EC217861BA2FE2 /* ltm.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "ltm.c"; path = "ltm.c"; sourceTree = ""; }; 47500A2731C478152E820CE4 /* ltm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "ltm.h"; path = "ltm.h"; sourceTree = ""; }; 69D540C61066428D77F466BB /* lua.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lua.h"; path = "lua.h"; sourceTree = ""; }; 1FA32BBE5E48776808443F44 /* luaconf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "luaconf.h"; path = "luaconf.h"; sourceTree = ""; }; 10370DCF4E2B73A83B310E34 /* lualib.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lualib.h"; path = "lualib.h"; sourceTree = ""; }; 12EB10BD6C365FD52FA44151 /* lundump.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "lundump.c"; path = "lundump.c"; sourceTree = ""; }; 4FEF5DEC5D8815EE4B36603D /* lundump.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lundump.h"; path = "lundump.h"; sourceTree = ""; }; 65DF287063A7227229F13ADD /* lvm.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "lvm.c"; path = "lvm.c"; sourceTree = ""; }; 783971477A9B588B28367AA3 /* lvm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lvm.h"; path = "lvm.h"; sourceTree = ""; }; 715E102D7AE5033862865B67 /* lzio.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "lzio.c"; path = "lzio.c"; sourceTree = ""; }; 15AC73E356BD21550A7078BA /* lzio.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lzio.h"; path = "lzio.h"; sourceTree = ""; }; 0FA615321EB03989031572BB /* os_chdir.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "os_chdir.c"; path = "os_chdir.c"; sourceTree = ""; }; 10C2419E0B8416AE323F4D8E /* os_copyfile.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "os_copyfile.c"; path = "os_copyfile.c"; sourceTree = ""; }; 6FA430F9353735BA518E6C94 /* os_getcwd.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "os_getcwd.c"; path = "os_getcwd.c"; sourceTree = ""; }; 4074028A38B5087574A52D10 /* os_isdir.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "os_isdir.c"; path = "os_isdir.c"; sourceTree = ""; }; 00E839841DA4257A6E9033DC /* os_isfile.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "os_isfile.c"; path = "os_isfile.c"; sourceTree = ""; }; 6E9E63CE11F50476712C0FFA /* os_match.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "os_match.c"; path = "os_match.c"; sourceTree = ""; }; 369F152A2F097C6814055E34 /* os_mkdir.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "os_mkdir.c"; path = "os_mkdir.c"; sourceTree = ""; }; 231365F6055A65DC7B965C79 /* os_pathsearch.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "os_pathsearch.c"; path = "os_pathsearch.c"; sourceTree = ""; }; 45784C5504F2616066705FB1 /* os_rmdir.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "os_rmdir.c"; path = "os_rmdir.c"; sourceTree = ""; }; 299F21212A03698330A12367 /* os_uuid.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "os_uuid.c"; path = "os_uuid.c"; sourceTree = ""; }; 49192EA8371A23521698130D /* path_isabsolute.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "path_isabsolute.c"; path = "path_isabsolute.c"; sourceTree = ""; }; 2ADE100427D51CB005A675CF /* premake.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "premake.c"; path = "premake.c"; sourceTree = ""; }; 498D4F213F976E3175B00239 /* premake.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "premake.h"; path = "premake.h"; sourceTree = ""; }; 2B69356C55FA147C7B0C690E /* scripts.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "scripts.c"; path = "scripts.c"; sourceTree = ""; }; 2A78491274152CEF3349113F /* string_endswith.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "string_endswith.c"; path = "string_endswith.c"; sourceTree = ""; }; 6AC00F6E38A569345B8D43A6 /* dotnet.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "dotnet.lua"; path = "dotnet.lua"; sourceTree = ""; }; 7A4B048E461950EA588C07D1 /* gcc.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "gcc.lua"; path = "gcc.lua"; sourceTree = ""; }; 54AD2C58638A199106A74E91 /* msc.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "msc.lua"; path = "msc.lua"; sourceTree = ""; }; 1A3C5FE74F6B2C65564C1F88 /* ow.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "ow.lua"; path = "ow.lua"; sourceTree = ""; }; 5FCF0F53372722ED18FF137B /* test_make_escaping.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_make_escaping.lua"; path = "test_make_escaping.lua"; sourceTree = ""; }; 74767F7506E154BD6E9D0B3F /* test_make_pch.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_make_pch.lua"; path = "test_make_pch.lua"; sourceTree = ""; }; 563B4040305F2F5B0CA143F6 /* test_clean.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_clean.lua"; path = "test_clean.lua"; sourceTree = ""; }; 06FD5FF0452F39111A2918B8 /* test_vs2005_csproj.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_vs2005_csproj.lua"; path = "test_vs2005_csproj.lua"; sourceTree = ""; }; 0108750A7DDE3A9E7BAB211F /* test_vs200x_vcproj.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_vs200x_vcproj.lua"; path = "test_vs200x_vcproj.lua"; sourceTree = ""; }; 370F5DA474F05B8E068A7F91 /* test_vs200x_vcproj_linker.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_vs200x_vcproj_linker.lua"; path = "test_vs200x_vcproj_linker.lua"; sourceTree = ""; }; 283744634877046D297F687F /* test_vs2010_filters.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_vs2010_filters.lua"; path = "test_vs2010_filters.lua"; sourceTree = ""; }; 29BC0BBD334242D06A7B53B3 /* test_vs2010_flags.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_vs2010_flags.lua"; path = "test_vs2010_flags.lua"; sourceTree = ""; }; 3EA961822AB15947568D4DB0 /* test_vs2010_links.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_vs2010_links.lua"; path = "test_vs2010_links.lua"; sourceTree = ""; }; 683C4F5B7D90086461492916 /* test_vs2010_project_kinds.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_vs2010_project_kinds.lua"; path = "test_vs2010_project_kinds.lua"; sourceTree = ""; }; 6A086DA70D022C4C389C34CE /* test_vs2010_vcxproj.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_vs2010_vcxproj.lua"; path = "test_vs2010_vcxproj.lua"; sourceTree = ""; }; 5582698D46D3058050F47E2A /* test_xcode_common.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_xcode_common.lua"; path = "test_xcode_common.lua"; sourceTree = ""; }; 18D637BF167443A73D275E37 /* test_xcode_dependencies.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_xcode_dependencies.lua"; path = "test_xcode_dependencies.lua"; sourceTree = ""; }; 72143DDD05B016CF2FA30CA5 /* test_xcode_project.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_xcode_project.lua"; path = "test_xcode_project.lua"; sourceTree = ""; }; 4C5B010841A801FF18DA3664 /* test_action.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_action.lua"; path = "test_action.lua"; sourceTree = ""; }; 03B22DA5560773EC48496C98 /* test_api.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_api.lua"; path = "test_api.lua"; sourceTree = ""; }; 032471F26A15212269D934C2 /* test_baking.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_baking.lua"; path = "test_baking.lua"; sourceTree = ""; }; 46883B4346C06E4734FA197E /* test_config.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_config.lua"; path = "test_config.lua"; sourceTree = ""; }; 23324E22296749B2456B1AFD /* test_os.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_os.lua"; path = "test_os.lua"; sourceTree = ""; }; 603F5295444D4748083614D5 /* test_path.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_path.lua"; path = "test_path.lua"; sourceTree = ""; }; 3C875AE8769B44F00860101B /* test_table.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_table.lua"; path = "test_table.lua"; sourceTree = ""; }; 0603517E4A6740F759420D2F /* test_tree.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_tree.lua"; path = "test_tree.lua"; sourceTree = ""; }; 692B32E1541742C34BD47F36 /* ok.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "ok.lua"; path = "ok.lua"; sourceTree = ""; }; 5CC92EBF0E5E469B01DC1B96 /* pepperfish_profiler.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "pepperfish_profiler.lua"; path = "pepperfish_profiler.lua"; sourceTree = ""; }; 21E965AE28CB513F22BC184D /* premake4.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "premake4.lua"; path = "premake4.lua"; sourceTree = ""; }; 24E7658C535D0996575D2FEE /* test_dofile.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_dofile.lua"; path = "test_dofile.lua"; sourceTree = ""; }; 5EBD091900B648FE56211969 /* test_gcc.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_gcc.lua"; path = "test_gcc.lua"; sourceTree = ""; }; 79230B1C71EE54410C242278 /* test_gmake_cpp.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_gmake_cpp.lua"; path = "test_gmake_cpp.lua"; sourceTree = ""; }; 1C0E021C195B318B1E44086E /* test_gmake_cs.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_gmake_cs.lua"; path = "test_gmake_cs.lua"; sourceTree = ""; }; 1AE62BE1602F5BEF3E115A69 /* test_keywords.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_keywords.lua"; path = "test_keywords.lua"; sourceTree = ""; }; 23966EE4549B490C66291643 /* test_platforms.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_platforms.lua"; path = "test_platforms.lua"; sourceTree = ""; }; 2ED205F8165731631C0C71FC /* test_premake.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_premake.lua"; path = "test_premake.lua"; sourceTree = ""; }; 6DA239841EF86BF546A90456 /* test_project.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_project.lua"; path = "test_project.lua"; sourceTree = ""; }; 3E082C131BE621976C1B70E5 /* test_stress.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_stress.lua"; path = "test_stress.lua"; sourceTree = ""; }; 62BF05CB6A6874BE69F304BB /* test_string.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_string.lua"; path = "test_string.lua"; sourceTree = ""; }; 4A7956E01D4F69137AA0359B /* test_targets.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_targets.lua"; path = "test_targets.lua"; sourceTree = ""; }; 7FD66D631D8F1A6B18CF3E44 /* test_vs2002_sln.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_vs2002_sln.lua"; path = "test_vs2002_sln.lua"; sourceTree = ""; }; 649B133B0FFF64005B4F2AD1 /* test_vs2003_sln.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_vs2003_sln.lua"; path = "test_vs2003_sln.lua"; sourceTree = ""; }; 07002E8346CF46B8093C4370 /* test_vs2005_sln.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_vs2005_sln.lua"; path = "test_vs2005_sln.lua"; sourceTree = ""; }; 76676BF951EC10E21792092C /* test_vs2008_sln.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_vs2008_sln.lua"; path = "test_vs2008_sln.lua"; sourceTree = ""; }; 5C6A4D25765F7078782D594D /* test_vs2010_sln.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "test_vs2010_sln.lua"; path = "test_vs2010_sln.lua"; sourceTree = ""; }; 5DF6433F73A2484F551B7624 /* testfx.lua */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.lua; name = "testfx.lua"; path = "testfx.lua"; sourceTree = ""; }; 24E162B62ACD0A3477902722 /* premake4 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = "premake4"; path = "premake4"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 32185A483CD1506A01CD4564 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 5557718C5B4956EE31A3489B /* Premake4 */ = { isa = PBXGroup; children = ( 736F13995C9D05497E84388C /* BUILD.txt */, 25D401AB4287699F7AA17671 /* CHANGES.txt */, 0FEC50C608A273751DBD1B64 /* LICENSE.txt */, 748A1B58398004922BA434B2 /* README.txt */, 47E533405FF62B9A263D1809 /* premake4.lua */, 7A31449548F559A1045D7F15 /* scripts */, 5D90489D42C6576813B21B72 /* src */, 3562386D37596A917ADE4091 /* tests */, 6C12505866C529C13FEA5110 /* Products */, ); name = "Premake4"; sourceTree = ""; }; 7A31449548F559A1045D7F15 /* scripts */ = { isa = PBXGroup; children = ( 46B7490447AE2DB37F4054B6 /* embed.lua */, 18793DD66743646A7DF42543 /* release.lua */, ); name = "scripts"; path = ../../scripts; sourceTree = ""; }; 5D90489D42C6576813B21B72 /* src */ = { isa = PBXGroup; children = ( 0B46492411495ED637DF510B /* _manifest.lua */, 471D54E2757C56260F9E0C88 /* _premake_main.lua */, 75EC728E54E27E19407007CE /* actions */, 547506620EF8749228E21CD2 /* base */, 2EAF743F5FFA16F95069571F /* host */, 15C8301D78F25967344665DA /* tools */, ); name = "src"; path = ../../src; sourceTree = ""; }; 75EC728E54E27E19407007CE /* actions */ = { isa = PBXGroup; children = ( 0E7A0F8424BF0D8817B23512 /* clean */, 1FA33E58218262515E93397C /* codeblocks */, 732B1A7722B66F061ABA38D2 /* codelite */, 019509F3577D088962AB7949 /* example */, 223D0EAF210F6AE97761130A /* make */, 216D221867B33F057C181CAC /* vstudio */, 18546B4927826C5A1CE652EA /* xcode */, ); name = "actions"; path = actions; sourceTree = ""; }; 0E7A0F8424BF0D8817B23512 /* clean */ = { isa = PBXGroup; children = ( 4ED30A4D459A0C4F293D65BC /* _clean.lua */, ); name = "clean"; path = clean; sourceTree = ""; }; 1FA33E58218262515E93397C /* codeblocks */ = { isa = PBXGroup; children = ( 7D6A56F6398D6117632D2E36 /* _codeblocks.lua */, 185F29C3684F3D2830020AA6 /* codeblocks_cbp.lua */, 34EC24A813F54DE92B5C2968 /* codeblocks_workspace.lua */, ); name = "codeblocks"; path = codeblocks; sourceTree = ""; }; 732B1A7722B66F061ABA38D2 /* codelite */ = { isa = PBXGroup; children = ( 1A1D081E0458611F591E61D8 /* _codelite.lua */, 40802CE8380151471C4F24A1 /* codelite_project.lua */, 752F7BA402DC5EBD0258643F /* codelite_workspace.lua */, ); name = "codelite"; path = codelite; sourceTree = ""; }; 019509F3577D088962AB7949 /* example */ = { isa = PBXGroup; children = ( 66E94BAE461E60BC13DE012D /* _example.lua */, 64E7344E14E624981A257345 /* example_project.lua */, 633E19FA07893DEF3C3E4361 /* example_solution.lua */, ); name = "example"; path = example; sourceTree = ""; }; 223D0EAF210F6AE97761130A /* make */ = { isa = PBXGroup; children = ( 11F909150254755526AE206A /* _make.lua */, 25EC2BDD60D8176B7FFD6A9A /* make_cpp.lua */, 62844A0540BE36004EEA1E41 /* make_csharp.lua */, 73CF43741FCC2AE737DD11A7 /* make_solution.lua */, ); name = "make"; path = make; sourceTree = ""; }; 216D221867B33F057C181CAC /* vstudio */ = { isa = PBXGroup; children = ( 689728874AEE74E500B510D8 /* _vstudio.lua */, 0E42234E08560209392B6D61 /* vs2002_csproj.lua */, 340331494EFC0DE537054E20 /* vs2002_csproj_user.lua */, 408A4C1E05A20BA5234D53C4 /* vs2002_solution.lua */, 05AC04792D582841501E619E /* vs2003_solution.lua */, 7BC9511F6E52596F124A6825 /* vs2005_csproj.lua */, 63FE54D2424D65DC055A0ACB /* vs2005_csproj_user.lua */, 401730924F0907EA20E46F50 /* vs2005_solution.lua */, 006E756D6673468570D36543 /* vs200x_vcproj.lua */, 33D362B518D9546A7CDD3064 /* vs2010_vcxproxj.lua */, 32AE4D91217A532954992712 /* vs_generic_solution.lua */, ); name = "vstudio"; path = vstudio; sourceTree = ""; }; 18546B4927826C5A1CE652EA /* xcode */ = { isa = PBXGroup; children = ( 1CD70C4B3F131D9F628D3285 /* _xcode.lua */, 42585B8B19B96DD63DCD026F /* xcode_common.lua */, 7EA85EB20F1C1DF158C83F62 /* xcode_project.lua */, ); name = "xcode"; path = xcode; sourceTree = ""; }; 547506620EF8749228E21CD2 /* base */ = { isa = PBXGroup; children = ( 50F86F472EEC26B830F34E38 /* action.lua */, 55B255B2390A78294D533018 /* api.lua */, 0D037F1E2A190A913E7C442B /* cmdline.lua */, 6B683A03429E4F56339C6DEF /* configs.lua */, 26A40D2E70DB7692142A5AFD /* globals.lua */, 4FBD3570547231CA69A2104A /* help.lua */, 70DA03501ABB25E70B9C3537 /* io.lua */, 43C75BDE5CB02DE65CD349F7 /* option.lua */, 23873460372E386B33A525F3 /* os.lua */, 022D6D59211312C22A3B2530 /* path.lua */, 7ECD471611E82F18032A3B6E /* premake.lua */, 3CE50BFF32C6030B011531F2 /* project.lua */, 3D5862947C80531066712411 /* solution.lua */, 072C06EB33FF493B56BE55AB /* string.lua */, 7079236176137EED0D8313C1 /* table.lua */, 2327597F2DDA72FB77551FAE /* tree.lua */, 608D04725D3D5971211A49F0 /* validate.lua */, ); name = "base"; path = base; sourceTree = ""; }; 2EAF743F5FFA16F95069571F /* host */ = { isa = PBXGroup; children = ( 51A12A27740D02B001E43345 /* lua-5.1.4 */, 0FA615321EB03989031572BB /* os_chdir.c */, 10C2419E0B8416AE323F4D8E /* os_copyfile.c */, 6FA430F9353735BA518E6C94 /* os_getcwd.c */, 4074028A38B5087574A52D10 /* os_isdir.c */, 00E839841DA4257A6E9033DC /* os_isfile.c */, 6E9E63CE11F50476712C0FFA /* os_match.c */, 369F152A2F097C6814055E34 /* os_mkdir.c */, 231365F6055A65DC7B965C79 /* os_pathsearch.c */, 45784C5504F2616066705FB1 /* os_rmdir.c */, 299F21212A03698330A12367 /* os_uuid.c */, 49192EA8371A23521698130D /* path_isabsolute.c */, 2ADE100427D51CB005A675CF /* premake.c */, 498D4F213F976E3175B00239 /* premake.h */, 2B69356C55FA147C7B0C690E /* scripts.c */, 2A78491274152CEF3349113F /* string_endswith.c */, ); name = "host"; path = host; sourceTree = ""; }; 51A12A27740D02B001E43345 /* lua-5.1.4 */ = { isa = PBXGroup; children = ( 318E757241D47E976CC657E9 /* src */, ); name = "lua-5.1.4"; path = lua-5.1.4; sourceTree = ""; }; 318E757241D47E976CC657E9 /* src */ = { isa = PBXGroup; children = ( 2F6A5B95436069A36AE42537 /* lapi.c */, 7B63246455C12172751601C5 /* lapi.h */, 443705EC6E5D514C654B25DD /* lauxlib.c */, 79DD1CC56204339E653036DE /* lauxlib.h */, 4D6E113F00B56B886D6E0000 /* lbaselib.c */, 05D118571FB33CCF6A6B2E6A /* lcode.c */, 68AE252D4B4B371F7D29279C /* lcode.h */, 7F83317E4C8C008279FC2B52 /* ldblib.c */, 1B4F6CFE1831548641873A70 /* ldebug.c */, 4C6441A765CD18EA559963C8 /* ldebug.h */, 13E7247270E54C4F5D7C038B /* ldo.c */, 513E728E01781A5C3CA85F33 /* ldo.h */, 39D40F330702545479B96DA6 /* ldump.c */, 35F90D20478453092F517A4B /* lfunc.c */, 543241E746E36E8F0DD344F9 /* lfunc.h */, 3CA656E42F1B34F6396C0B0E /* lgc.c */, 5E906B6021C257A7280A58E0 /* lgc.h */, 72492D65713D1A2B14F8303D /* linit.c */, 40CB00855B001CC97BB81CA9 /* liolib.c */, 056539240EFB0136054034BB /* llex.c */, 11E774706A2E7F501BCF743E /* llex.h */, 1EEA29C40AE0183744B3672B /* llimits.h */, 46043C8E37176AF93B097370 /* lmathlib.c */, 1B54583C653F1339065F6DAD /* lmem.c */, 7C954612524131177ABB45EA /* lmem.h */, 4247665D704B015842077AAC /* loadlib.c */, 2C111D3302A554AA0DA3047E /* lobject.c */, 3F1C7184281732E84B1E30B0 /* lobject.h */, 1CFD5E452ACE53DD742E7B87 /* lopcodes.c */, 24385CF247182A3539EB7BFD /* lopcodes.h */, 35BC56AD0ECF5D8B6E803D4D /* loslib.c */, 187B748637581E7266252952 /* lparser.c */, 353D73D26788152013913961 /* lparser.h */, 35BF3EE93C02557B06EF529E /* lstate.c */, 2AAF7ABA010C69177A6641F6 /* lstate.h */, 326E794B6A2352CD4A014607 /* lstring.c */, 69B7718B5F1305DA2FB34F5F /* lstring.h */, 03657B9C48A41FA855900008 /* lstrlib.c */, 7C270F0B4C0B7FE927DC7228 /* ltable.c */, 7C1630281FE870CE1D137BE0 /* ltable.h */, 58440F0F396E6CF629CD75CE /* ltablib.c */, 4505703C79EC217861BA2FE2 /* ltm.c */, 47500A2731C478152E820CE4 /* ltm.h */, 69D540C61066428D77F466BB /* lua.h */, 1FA32BBE5E48776808443F44 /* luaconf.h */, 10370DCF4E2B73A83B310E34 /* lualib.h */, 12EB10BD6C365FD52FA44151 /* lundump.c */, 4FEF5DEC5D8815EE4B36603D /* lundump.h */, 65DF287063A7227229F13ADD /* lvm.c */, 783971477A9B588B28367AA3 /* lvm.h */, 715E102D7AE5033862865B67 /* lzio.c */, 15AC73E356BD21550A7078BA /* lzio.h */, ); name = "src"; path = src; sourceTree = ""; }; 15C8301D78F25967344665DA /* tools */ = { isa = PBXGroup; children = ( 6AC00F6E38A569345B8D43A6 /* dotnet.lua */, 7A4B048E461950EA588C07D1 /* gcc.lua */, 54AD2C58638A199106A74E91 /* msc.lua */, 1A3C5FE74F6B2C65564C1F88 /* ow.lua */, ); name = "tools"; path = tools; sourceTree = ""; }; 3562386D37596A917ADE4091 /* tests */ = { isa = PBXGroup; children = ( 1DC71308309A7F0D394E3FF9 /* actions */, 2B95559F4C6E78B600270756 /* base */, 2CC831515B2C59FF1CF92B24 /* folder */, 5CC92EBF0E5E469B01DC1B96 /* pepperfish_profiler.lua */, 21E965AE28CB513F22BC184D /* premake4.lua */, 24E7658C535D0996575D2FEE /* test_dofile.lua */, 5EBD091900B648FE56211969 /* test_gcc.lua */, 79230B1C71EE54410C242278 /* test_gmake_cpp.lua */, 1C0E021C195B318B1E44086E /* test_gmake_cs.lua */, 1AE62BE1602F5BEF3E115A69 /* test_keywords.lua */, 23966EE4549B490C66291643 /* test_platforms.lua */, 2ED205F8165731631C0C71FC /* test_premake.lua */, 6DA239841EF86BF546A90456 /* test_project.lua */, 3E082C131BE621976C1B70E5 /* test_stress.lua */, 62BF05CB6A6874BE69F304BB /* test_string.lua */, 4A7956E01D4F69137AA0359B /* test_targets.lua */, 7FD66D631D8F1A6B18CF3E44 /* test_vs2002_sln.lua */, 649B133B0FFF64005B4F2AD1 /* test_vs2003_sln.lua */, 07002E8346CF46B8093C4370 /* test_vs2005_sln.lua */, 76676BF951EC10E21792092C /* test_vs2008_sln.lua */, 5C6A4D25765F7078782D594D /* test_vs2010_sln.lua */, 5DF6433F73A2484F551B7624 /* testfx.lua */, ); name = "tests"; path = ../../tests; sourceTree = ""; }; 1DC71308309A7F0D394E3FF9 /* actions */ = { isa = PBXGroup; children = ( 766709E259B05D4917886B34 /* make */, 563B4040305F2F5B0CA143F6 /* test_clean.lua */, 0A3D4D072E827A14788C40A0 /* vstudio */, 4B54002731B7051130A4650D /* xcode */, ); name = "actions"; path = actions; sourceTree = ""; }; 766709E259B05D4917886B34 /* make */ = { isa = PBXGroup; children = ( 5FCF0F53372722ED18FF137B /* test_make_escaping.lua */, 74767F7506E154BD6E9D0B3F /* test_make_pch.lua */, ); name = "make"; path = make; sourceTree = ""; }; 0A3D4D072E827A14788C40A0 /* vstudio */ = { isa = PBXGroup; children = ( 06FD5FF0452F39111A2918B8 /* test_vs2005_csproj.lua */, 0108750A7DDE3A9E7BAB211F /* test_vs200x_vcproj.lua */, 370F5DA474F05B8E068A7F91 /* test_vs200x_vcproj_linker.lua */, 283744634877046D297F687F /* test_vs2010_filters.lua */, 29BC0BBD334242D06A7B53B3 /* test_vs2010_flags.lua */, 3EA961822AB15947568D4DB0 /* test_vs2010_links.lua */, 683C4F5B7D90086461492916 /* test_vs2010_project_kinds.lua */, 6A086DA70D022C4C389C34CE /* test_vs2010_vcxproj.lua */, ); name = "vstudio"; path = vstudio; sourceTree = ""; }; 4B54002731B7051130A4650D /* xcode */ = { isa = PBXGroup; children = ( 5582698D46D3058050F47E2A /* test_xcode_common.lua */, 18D637BF167443A73D275E37 /* test_xcode_dependencies.lua */, 72143DDD05B016CF2FA30CA5 /* test_xcode_project.lua */, ); name = "xcode"; path = xcode; sourceTree = ""; }; 2B95559F4C6E78B600270756 /* base */ = { isa = PBXGroup; children = ( 4C5B010841A801FF18DA3664 /* test_action.lua */, 03B22DA5560773EC48496C98 /* test_api.lua */, 032471F26A15212269D934C2 /* test_baking.lua */, 46883B4346C06E4734FA197E /* test_config.lua */, 23324E22296749B2456B1AFD /* test_os.lua */, 603F5295444D4748083614D5 /* test_path.lua */, 3C875AE8769B44F00860101B /* test_table.lua */, 0603517E4A6740F759420D2F /* test_tree.lua */, ); name = "base"; path = base; sourceTree = ""; }; 2CC831515B2C59FF1CF92B24 /* folder */ = { isa = PBXGroup; children = ( 692B32E1541742C34BD47F36 /* ok.lua */, ); name = "folder"; path = folder; sourceTree = ""; }; 6C12505866C529C13FEA5110 /* Products */ = { isa = PBXGroup; children = ( 24E162B62ACD0A3477902722 /* premake4 */, ); name = "Products"; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 533F6572329421AF016C6F87 /* Premake4 */ = { isa = PBXNativeTarget; buildConfigurationList = 7300250773CD2BC518776C0B /* Build configuration list for PBXNativeTarget "Premake4" */; buildPhases = ( 01340F810F1B74B2135E3BF6 /* Resources */, 49A23EB62C9504B663DB74D8 /* Sources */, 32185A483CD1506A01CD4564 /* Frameworks */, ); buildRules = ( ); dependencies = ( ); name = "Premake4"; productInstallPath = "$(HOME)/bin"; productName = "Premake4"; productReference = 24E162B62ACD0A3477902722 /* premake4 */; productType = "com.apple.product-type.tool"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "Premake4" */; compatibilityVersion = "Xcode 3.1"; hasScannedForEncodings = 1; mainGroup = 5557718C5B4956EE31A3489B /* Premake4 */; projectDirPath = ""; projectRoot = ""; targets = ( 533F6572329421AF016C6F87 /* premake4 */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 01340F810F1B74B2135E3BF6 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 49A23EB62C9504B663DB74D8 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 5D097E22261F7D3E16C45DDF /* lapi.c in Sources */, 5A0655AB643D77EE3C327A64 /* lauxlib.c in Sources */, 175648A00BE050BD349E27D2 /* lbaselib.c in Sources */, 6A523B03464B7A40381B2D19 /* lcode.c in Sources */, 53CD584F509E6A031E2C19BA /* ldblib.c in Sources */, 456057950A3537C569AF740E /* ldebug.c in Sources */, 4DCA2FEC48FB6A2B64DA559B /* ldo.c in Sources */, 61301CDE3E65619A57C550D8 /* ldump.c in Sources */, 7CB557CF7A04201761D256D5 /* lfunc.c in Sources */, 4E634B7F7F5B5C7058E5336F /* lgc.c in Sources */, 10CD389141A6049F0DE154E5 /* linit.c in Sources */, 23101C612CD90EB30BDE514A /* liolib.c in Sources */, 7DDB4C1B220378BB707F5B3D /* llex.c in Sources */, 51C855975D7F639773855FE2 /* lmathlib.c in Sources */, 124D07F2368A27FE3C206147 /* lmem.c in Sources */, 70BB3E9478F3264066DE048E /* loadlib.c in Sources */, 17516E863F9D684C6061140A /* lobject.c in Sources */, 18E715713B683A157785449D /* lopcodes.c in Sources */, 471339AD1987104560145DD6 /* loslib.c in Sources */, 647D61DF29FC1B4E46F866E2 /* lparser.c in Sources */, 0E4E36BC7CE87D40104679D1 /* lstate.c in Sources */, 085200BC3EF753327A2E2027 /* lstring.c in Sources */, 0D8F44E53B77147C124D2B63 /* lstrlib.c in Sources */, 4260441143160A963711588A /* ltable.c in Sources */, 5A7E190139CE2153739618CF /* ltablib.c in Sources */, 4D3C28BF44E80FA071FC0211 /* ltm.c in Sources */, 3BA152117B3027E354004EDF /* lundump.c in Sources */, 42E37150535B07E81FAA02B4 /* lvm.c in Sources */, 0788332F56794EA749AE7644 /* lzio.c in Sources */, 10E47DCB4A857A5A51AE0BC6 /* os_chdir.c in Sources */, 2F546E4C61E71D6F698A7322 /* os_copyfile.c in Sources */, 6FC44CB11E6130FE7CA6785F /* os_getcwd.c in Sources */, 055E0F0B276F68DE7ACA0835 /* os_isdir.c in Sources */, 4052648B65163458358945B3 /* os_isfile.c in Sources */, 7BB93B4A37DD0F857A200924 /* os_match.c in Sources */, 609E55CD108B2C1738172CAF /* os_mkdir.c in Sources */, 0D5D7FE955B836E04F3B4F0A /* os_pathsearch.c in Sources */, 1A8B5CAB14524E1007355DD6 /* os_rmdir.c in Sources */, 4FEB641F5D8F783E41067D52 /* os_uuid.c in Sources */, 728A03A568D17CD9221F46C8 /* path_isabsolute.c in Sources */, 0D16524A06E96C056C2C7926 /* premake.c in Sources */, 2C8B01B677BC0A561BDD5CF8 /* scripts.c in Sources */, 749D753D17FF167A4EE12563 /* string_endswith.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 283B68C16F4F39532EBE77A2 /* Release Native */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; CONFIGURATION_BUILD_DIR = ../../bin/release; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; INSTALL_PATH = /usr/local/bin; PRODUCT_NAME = "premake4"; }; name = "Release Native"; }; 14307FC01A1C3CE256BB46FF /* Release 32-bit Universal */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; CONFIGURATION_BUILD_DIR = ../../bin/release; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; INSTALL_PATH = /usr/local/bin; PRODUCT_NAME = "premake4"; }; name = "Release 32-bit Universal"; }; 5C1454F321F8265458806994 /* Debug Native */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CONFIGURATION_BUILD_DIR = ../../bin/debug; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; INSTALL_PATH = /usr/local/bin; PRODUCT_NAME = "premake4"; }; name = "Debug Native"; }; 69D932017A1126E85C9C2468 /* Debug 32-bit Universal */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CONFIGURATION_BUILD_DIR = ../../bin/debug; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; INSTALL_PATH = /usr/local/bin; PRODUCT_NAME = "premake4"; }; name = "Debug 32-bit Universal"; }; 4844080E08B616C97A0E5E1C /* Release Native */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_BUILD_DIR = "$(SYMROOT)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = s; GCC_PREPROCESSOR_DEFINITIONS = ( "NDEBUG", "LUA_USE_MACOSX", ); GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( "../../src/host/lua-5.1.4/src", ); OBJROOT = "obj/Release"; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "-rdynamic", ); PREBINDING = NO; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static; SYMROOT = "../../bin/release"; WARNING_CFLAGS = "-Wall"; }; name = "Release Native"; }; 43D63D2371A92C71302613BC /* Release 32-bit Universal */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CONFIGURATION_BUILD_DIR = "$(SYMROOT)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = s; GCC_PREPROCESSOR_DEFINITIONS = ( "NDEBUG", "LUA_USE_MACOSX", ); GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( "../../src/host/lua-5.1.4/src", ); OBJROOT = "obj/Universal32/Release"; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "-rdynamic", ); PREBINDING = NO; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static; SYMROOT = "../../bin/release"; WARNING_CFLAGS = "-Wall"; }; name = "Release 32-bit Universal"; }; 0820115B7172790F72FC24CC /* Debug Native */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_BUILD_DIR = "$(SYMROOT)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "_DEBUG", "LUA_USE_MACOSX", ); GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( "../../src/host/lua-5.1.4/src", ); OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "-rdynamic", ); PREBINDING = NO; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static; SYMROOT = "../../bin/debug"; WARNING_CFLAGS = "-Wall"; }; name = "Debug Native"; }; 3F5E6FCF09B61CBF6D252A0D /* Debug 32-bit Universal */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CONFIGURATION_BUILD_DIR = "$(SYMROOT)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "_DEBUG", "LUA_USE_MACOSX", ); GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( "../../src/host/lua-5.1.4/src", ); OBJROOT = "obj/Universal32/Debug"; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "-rdynamic", ); PREBINDING = NO; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static; SYMROOT = "../../bin/debug"; WARNING_CFLAGS = "-Wall"; }; name = "Debug 32-bit Universal"; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 7300250773CD2BC518776C0B /* Build configuration list for PBXNativeTarget "premake4" */ = { isa = XCConfigurationList; buildConfigurations = ( 283B68C16F4F39532EBE77A2 /* Release Native */, 14307FC01A1C3CE256BB46FF /* Release 32-bit Universal */, 5C1454F321F8265458806994 /* Debug Native */, 69D932017A1126E85C9C2468 /* Debug 32-bit Universal */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = "Release Native"; }; 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "Premake4" */ = { isa = XCConfigurationList; buildConfigurations = ( 4844080E08B616C97A0E5E1C /* Release Native */, 43D63D2371A92C71302613BC /* Release 32-bit Universal */, 0820115B7172790F72FC24CC /* Debug Native */, 3F5E6FCF09B61CBF6D252A0D /* Debug 32-bit Universal */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = "Release Native"; }; /* End XCConfigurationList section */ }; rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; } premake-4.3-src+repack1/build/vs2005/0000755000000000000000000000000011470465411015652 5ustar rootrootpremake-4.3-src+repack1/build/vs2005/Premake4.vcproj0000644000000000000000000005071411470465411020556 0ustar rootroot premake-4.3-src+repack1/build/vs2005/Premake4.sln0000644000000000000000000000156011470465411020042 0ustar rootroot Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Premake4", "Premake4.vcproj", "{D654AECF-E2AA-9AD4-A0BD-8F0DCD1F11B8}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Release|Win32 = Release|Win32 Debug|Win32 = Debug|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {D654AECF-E2AA-9AD4-A0BD-8F0DCD1F11B8}.Release|Win32.ActiveCfg = Release|Win32 {D654AECF-E2AA-9AD4-A0BD-8F0DCD1F11B8}.Release|Win32.Build.0 = Release|Win32 {D654AECF-E2AA-9AD4-A0BD-8F0DCD1F11B8}.Debug|Win32.ActiveCfg = Debug|Win32 {D654AECF-E2AA-9AD4-A0BD-8F0DCD1F11B8}.Debug|Win32.Build.0 = Debug|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal premake-4.3-src+repack1/build/vs2010/0000755000000000000000000000000011470465411015646 5ustar rootrootpremake-4.3-src+repack1/build/vs2010/Premake4.vcxproj0000644000000000000000000004061611470465411020742 0ustar rootroot Release Win32 Debug Win32 {6B429E5C-0EC3-3E31-C2F2-8D34BE7E140D} Premake4 Win32Proj Application MultiByte true false Application MultiByte true <_ProjectFileVersion>10.0.30319.1 ..\..\bin\release\ obj\Release\ premake4 false ..\..\bin\debug\ obj\Debug\ premake4 true MinSpace ..\..\src\host\lua-5.1.4\src;%(AdditionalIncludeDirectories) NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) false true MultiThreaded true Level4 CompileAsC NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\..\src\host\lua-5.1.4\src;%(AdditionalIncludeDirectories) $(OutDir)premake4.exe %(AdditionalLibraryDirectories) Console false true true mainCRTStartup MachineX86 Disabled ..\..\src\host\lua-5.1.4\src;%(AdditionalIncludeDirectories) _DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks true MultiThreadedDebug true Level4 EditAndContinue CompileAsC _DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\..\src\host\lua-5.1.4\src;%(AdditionalIncludeDirectories) $(OutDir)premake4.exe %(AdditionalLibraryDirectories) Console true $(OutDir)premake4.pdb mainCRTStartup MachineX86 premake-4.3-src+repack1/build/vs2010/Premake4.vcxproj.user0000644000000000000000000000021611470465411021707 0ustar rootroot premake-4.3-src+repack1/build/vs2010/Premake4.vcxproj.filters0000644000000000000000000005044611470465411022413 0ustar rootroot {31C087BA-49D6-26E1-A1E4-05CDC1A32FCD} {7BA5F8D4-A572-6963-8045-F00E30CA52DA} {4B4F7E45-3E89-E559-9477-655A9A33C9D6} {B0562536-4B57-4507-0D42-1EE2606F6A86} {C2DCAF8E-3D68-98E5-627C-D7364B778818} {2E72CC85-CFFD-3FF3-0E00-02EC6168E218} {BA3E14A7-1D29-0208-88BE-72DC3448E006} {197C4E06-45B5-4476-F219-8CA4A8039430} {C3B62B99-84CC-A359-73B5-DA587ADA6720} {1E4C2ACC-B298-C2F4-2851-16ECF2DCDAB9} {B87B1165-449C-9291-3898-31597759CBFB} {BA2398B7-C44E-8567-E8F2-066FD9952F44} {02110C3C-5F03-F737-36A5-EE4405ACB274} {DBAEF789-F748-963A-C7A6-FD64B284961C} {FAFA98DD-2069-AA63-D924-D798BA90B81C} {75C113D8-2FF7-CBB7-F808-23C94499D5A0} {75728E65-8796-41E6-7EB8-5041C096973B} {A4253DB3-7539-2425-1880-71B2597DBFC0} {4318CF1C-4210-CA35-EADA-CE02D3AA0DC8} {DEBF6222-72D5-886A-050E-2E81CA2A80B6} {A5254716-9F22-B2D1-E240-4830C00F1125} {3BCB076C-F723-B9DB-6450-7D9DD7F43BEC} src\host src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host src\host src\host src\host src\host src\host src\host src\host src\host src\host src\host src\host src\host src\host src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src src\host\lua-5.1.4\src scripts scripts src src src\actions\clean src\actions\codeblocks src\actions\codeblocks src\actions\codeblocks src\actions\codelite src\actions\codelite src\actions\codelite src\actions\example src\actions\example src\actions\example src\actions\make src\actions\make src\actions\make src\actions\make src\actions\vstudio src\actions\vstudio src\actions\vstudio src\actions\vstudio src\actions\vstudio src\actions\vstudio src\actions\vstudio src\actions\vstudio src\actions\vstudio src\actions\vstudio src\actions\vstudio src\actions\xcode src\actions\xcode src\actions\xcode src\base src\base src\base src\base src\base src\base src\base src\base src\base src\base src\base src\base src\base src\base src\base src\base src\base src\tools src\tools src\tools src\tools tests tests tests tests tests tests tests tests tests tests tests tests tests tests tests tests tests tests tests tests\actions tests\actions\make tests\actions\make tests\actions\vstudio tests\actions\vstudio tests\actions\vstudio tests\actions\vstudio tests\actions\vstudio tests\actions\vstudio tests\actions\vstudio tests\actions\vstudio tests\actions\xcode tests\actions\xcode tests\actions\xcode tests\base tests\base tests\base tests\base tests\base tests\base tests\base tests\base tests\folder premake-4.3-src+repack1/build/vs2010/Premake4.sln0000644000000000000000000000156211470465411020040 0ustar rootroot Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Premake4", "Premake4.vcxproj", "{6B429E5C-0EC3-3E31-C2F2-8D34BE7E140D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Release|Win32 = Release|Win32 Debug|Win32 = Debug|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {6B429E5C-0EC3-3E31-C2F2-8D34BE7E140D}.Release|Win32.ActiveCfg = Release|Win32 {6B429E5C-0EC3-3E31-C2F2-8D34BE7E140D}.Release|Win32.Build.0 = Release|Win32 {6B429E5C-0EC3-3E31-C2F2-8D34BE7E140D}.Debug|Win32.ActiveCfg = Debug|Win32 {6B429E5C-0EC3-3E31-C2F2-8D34BE7E140D}.Debug|Win32.Build.0 = Debug|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal premake-4.3-src+repack1/build/codelite.unix/0000755000000000000000000000000011470465413017467 5ustar rootrootpremake-4.3-src+repack1/build/codelite.unix/Premake4.workspace0000644000000000000000000000077311470465413023066 0ustar rootroot premake-4.3-src+repack1/build/codelite.unix/Premake4.project0000644000000000000000000003256311470465413022540 0ustar rootroot None None premake-4.3-src+repack1/build/vs2008/0000755000000000000000000000000011470465411015655 5ustar rootrootpremake-4.3-src+repack1/build/vs2008/Premake4.vcproj0000644000000000000000000005056411470465411020564 0ustar rootroot premake-4.3-src+repack1/build/vs2008/Premake4.sln0000644000000000000000000000156111470465411020046 0ustar rootroot Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Premake4", "Premake4.vcproj", "{D6ED3DE4-71C2-8735-234C-9D5262425A6B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Release|Win32 = Release|Win32 Debug|Win32 = Debug|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {D6ED3DE4-71C2-8735-234C-9D5262425A6B}.Release|Win32.ActiveCfg = Release|Win32 {D6ED3DE4-71C2-8735-234C-9D5262425A6B}.Release|Win32.Build.0 = Release|Win32 {D6ED3DE4-71C2-8735-234C-9D5262425A6B}.Debug|Win32.ActiveCfg = Debug|Win32 {D6ED3DE4-71C2-8735-234C-9D5262425A6B}.Debug|Win32.Build.0 = Debug|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal premake-4.3-src+repack1/build/codeblocks.windows/0000755000000000000000000000000011470465412020515 5ustar rootrootpremake-4.3-src+repack1/build/codeblocks.windows/Premake4.cbp0000644000000000000000000002735611470465412022670 0ustar rootroot premake-4.3-src+repack1/build/codeblocks.windows/Premake4.workspace0000644000000000000000000000033211470465412024103 0ustar rootroot premake-4.3-src+repack1/build/codeblocks.macosx/0000755000000000000000000000000011470465412020315 5ustar rootrootpremake-4.3-src+repack1/build/codeblocks.macosx/Premake4.cbp0000644000000000000000000003210211470465412022451 0ustar rootroot premake-4.3-src+repack1/build/codeblocks.macosx/Premake4.workspace0000644000000000000000000000033211470465412023703 0ustar rootroot premake-4.3-src+repack1/build/codelite.windows/0000755000000000000000000000000011470465412020175 5ustar rootrootpremake-4.3-src+repack1/build/codelite.windows/Premake4.workspace0000644000000000000000000000077311470465412023574 0ustar rootroot premake-4.3-src+repack1/build/codelite.windows/Premake4.project0000644000000000000000000003207411470465412023243 0ustar rootroot None None premake-4.3-src+repack1/build/gmake.unix/0000755000000000000000000000000011470465412016762 5ustar rootrootpremake-4.3-src+repack1/build/gmake.unix/Makefile0000644000000000000000000000130111470465412020415 0ustar rootroot# GNU Make solution makefile autogenerated by Premake # Type "make help" for usage help ifndef config config=release endif export config PROJECTS := Premake4 .PHONY: all clean help $(PROJECTS) all: $(PROJECTS) Premake4: @echo "==== Building Premake4 ($(config)) ====" @${MAKE} --no-print-directory -C . -f Premake4.make clean: @${MAKE} --no-print-directory -C . -f Premake4.make clean help: @echo "Usage: make [config=name] [target]" @echo "" @echo "CONFIGURATIONS:" @echo " release" @echo " debug" @echo "" @echo "TARGETS:" @echo " all (default)" @echo " clean" @echo " Premake4" @echo "" @echo "For more information, see http://industriousone.com/premake/quick-start" premake-4.3-src+repack1/build/gmake.unix/Premake4.make0000644000000000000000000002100711470465412021271 0ustar rootroot# GNU Make project makefile autogenerated by Premake ifndef config config=release endif ifndef verbose SILENT = @ endif ifndef CC CC = gcc endif ifndef CXX CXX = g++ endif ifndef AR AR = ar endif ifeq ($(config),release) OBJDIR = obj/Release TARGETDIR = ../../bin/release TARGET = $(TARGETDIR)/premake4 DEFINES += -DNDEBUG -DLUA_USE_POSIX -DLUA_USE_DLOPEN INCLUDES += -I../../src/host/lua-5.1.4/src CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES) CFLAGS += $(CPPFLAGS) $(ARCH) -Wall -Os CXXFLAGS += $(CFLAGS) LDFLAGS += -s -rdynamic LIBS += -lm -ldl RESFLAGS += $(DEFINES) $(INCLUDES) LDDEPS += LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS) define PREBUILDCMDS endef define PRELINKCMDS endef define POSTBUILDCMDS endef endif ifeq ($(config),debug) OBJDIR = obj/Debug TARGETDIR = ../../bin/debug TARGET = $(TARGETDIR)/premake4 DEFINES += -D_DEBUG -DLUA_USE_POSIX -DLUA_USE_DLOPEN INCLUDES += -I../../src/host/lua-5.1.4/src CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES) CFLAGS += $(CPPFLAGS) $(ARCH) -Wall -g CXXFLAGS += $(CFLAGS) LDFLAGS += -rdynamic LIBS += -lm -ldl RESFLAGS += $(DEFINES) $(INCLUDES) LDDEPS += LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS) define PREBUILDCMDS endef define PRELINKCMDS endef define POSTBUILDCMDS endef endif OBJECTS := \ $(OBJDIR)/os_chdir.o \ $(OBJDIR)/os_copyfile.o \ $(OBJDIR)/os_getcwd.o \ $(OBJDIR)/os_isdir.o \ $(OBJDIR)/os_isfile.o \ $(OBJDIR)/os_match.o \ $(OBJDIR)/os_mkdir.o \ $(OBJDIR)/os_pathsearch.o \ $(OBJDIR)/os_rmdir.o \ $(OBJDIR)/os_uuid.o \ $(OBJDIR)/path_isabsolute.o \ $(OBJDIR)/premake.o \ $(OBJDIR)/scripts.o \ $(OBJDIR)/string_endswith.o \ $(OBJDIR)/lapi.o \ $(OBJDIR)/lauxlib.o \ $(OBJDIR)/lbaselib.o \ $(OBJDIR)/lcode.o \ $(OBJDIR)/ldblib.o \ $(OBJDIR)/ldebug.o \ $(OBJDIR)/ldo.o \ $(OBJDIR)/ldump.o \ $(OBJDIR)/lfunc.o \ $(OBJDIR)/lgc.o \ $(OBJDIR)/linit.o \ $(OBJDIR)/liolib.o \ $(OBJDIR)/llex.o \ $(OBJDIR)/lmathlib.o \ $(OBJDIR)/lmem.o \ $(OBJDIR)/loadlib.o \ $(OBJDIR)/lobject.o \ $(OBJDIR)/lopcodes.o \ $(OBJDIR)/loslib.o \ $(OBJDIR)/lparser.o \ $(OBJDIR)/lstate.o \ $(OBJDIR)/lstring.o \ $(OBJDIR)/lstrlib.o \ $(OBJDIR)/ltable.o \ $(OBJDIR)/ltablib.o \ $(OBJDIR)/ltm.o \ $(OBJDIR)/lundump.o \ $(OBJDIR)/lvm.o \ $(OBJDIR)/lzio.o \ RESOURCES := \ SHELLTYPE := msdos ifeq (,$(ComSpec)$(COMSPEC)) SHELLTYPE := posix endif ifeq (/bin,$(findstring /bin,$(SHELL))) SHELLTYPE := posix endif .PHONY: clean prebuild prelink all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET) @: $(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES) @echo Linking Premake4 $(SILENT) $(LINKCMD) $(POSTBUILDCMDS) $(TARGETDIR): @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) $(SILENT) mkdir -p $(TARGETDIR) else $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) $(SILENT) mkdir -p $(OBJDIR) else $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: @echo Cleaning Premake4 ifeq (posix,$(SHELLTYPE)) $(SILENT) rm -f $(TARGET) $(SILENT) rm -rf $(OBJDIR) else $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: $(PREBUILDCMDS) prelink: $(PRELINKCMDS) ifneq (,$(PCH)) $(GCH): $(PCH) @echo $(notdir $<) -$(SILENT) cp $< $(OBJDIR) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" endif $(OBJDIR)/os_chdir.o: ../../src/host/os_chdir.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_copyfile.o: ../../src/host/os_copyfile.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_getcwd.o: ../../src/host/os_getcwd.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_isdir.o: ../../src/host/os_isdir.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_isfile.o: ../../src/host/os_isfile.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_match.o: ../../src/host/os_match.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_mkdir.o: ../../src/host/os_mkdir.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_pathsearch.o: ../../src/host/os_pathsearch.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_rmdir.o: ../../src/host/os_rmdir.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_uuid.o: ../../src/host/os_uuid.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/path_isabsolute.o: ../../src/host/path_isabsolute.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/premake.o: ../../src/host/premake.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/scripts.o: ../../src/host/scripts.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/string_endswith.o: ../../src/host/string_endswith.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lapi.o: ../../src/host/lua-5.1.4/src/lapi.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lauxlib.o: ../../src/host/lua-5.1.4/src/lauxlib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lbaselib.o: ../../src/host/lua-5.1.4/src/lbaselib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lcode.o: ../../src/host/lua-5.1.4/src/lcode.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ldblib.o: ../../src/host/lua-5.1.4/src/ldblib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ldebug.o: ../../src/host/lua-5.1.4/src/ldebug.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ldo.o: ../../src/host/lua-5.1.4/src/ldo.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ldump.o: ../../src/host/lua-5.1.4/src/ldump.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lfunc.o: ../../src/host/lua-5.1.4/src/lfunc.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lgc.o: ../../src/host/lua-5.1.4/src/lgc.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/linit.o: ../../src/host/lua-5.1.4/src/linit.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/liolib.o: ../../src/host/lua-5.1.4/src/liolib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/llex.o: ../../src/host/lua-5.1.4/src/llex.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lmathlib.o: ../../src/host/lua-5.1.4/src/lmathlib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lmem.o: ../../src/host/lua-5.1.4/src/lmem.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/loadlib.o: ../../src/host/lua-5.1.4/src/loadlib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lobject.o: ../../src/host/lua-5.1.4/src/lobject.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lopcodes.o: ../../src/host/lua-5.1.4/src/lopcodes.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/loslib.o: ../../src/host/lua-5.1.4/src/loslib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lparser.o: ../../src/host/lua-5.1.4/src/lparser.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lstate.o: ../../src/host/lua-5.1.4/src/lstate.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lstring.o: ../../src/host/lua-5.1.4/src/lstring.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lstrlib.o: ../../src/host/lua-5.1.4/src/lstrlib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ltable.o: ../../src/host/lua-5.1.4/src/ltable.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ltablib.o: ../../src/host/lua-5.1.4/src/ltablib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ltm.o: ../../src/host/lua-5.1.4/src/ltm.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lundump.o: ../../src/host/lua-5.1.4/src/lundump.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lvm.o: ../../src/host/lua-5.1.4/src/lvm.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lzio.o: ../../src/host/lua-5.1.4/src/lzio.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" -include $(OBJECTS:%.o=%.d) premake-4.3-src+repack1/build/codelite.macosx/0000755000000000000000000000000011470465413017776 5ustar rootrootpremake-4.3-src+repack1/build/codelite.macosx/Premake4.workspace0000644000000000000000000000150511470465413023367 0ustar rootroot premake-4.3-src+repack1/build/codelite.macosx/Premake4.project0000644000000000000000000003721511470465413023046 0ustar rootroot None None None None premake-4.3-src+repack1/build/gmake.windows/0000755000000000000000000000000011470465411017470 5ustar rootrootpremake-4.3-src+repack1/build/gmake.windows/Makefile0000644000000000000000000000130111470465411021123 0ustar rootroot# GNU Make solution makefile autogenerated by Premake # Type "make help" for usage help ifndef config config=release endif export config PROJECTS := Premake4 .PHONY: all clean help $(PROJECTS) all: $(PROJECTS) Premake4: @echo "==== Building Premake4 ($(config)) ====" @${MAKE} --no-print-directory -C . -f Premake4.make clean: @${MAKE} --no-print-directory -C . -f Premake4.make clean help: @echo "Usage: make [config=name] [target]" @echo "" @echo "CONFIGURATIONS:" @echo " release" @echo " debug" @echo "" @echo "TARGETS:" @echo " all (default)" @echo " clean" @echo " Premake4" @echo "" @echo "For more information, see http://industriousone.com/premake/quick-start" premake-4.3-src+repack1/build/gmake.windows/Premake4.make0000644000000000000000000002065211470465411022004 0ustar rootroot# GNU Make project makefile autogenerated by Premake ifndef config config=release endif ifndef verbose SILENT = @ endif ifndef CC CC = gcc endif ifndef CXX CXX = g++ endif ifndef AR AR = ar endif ifeq ($(config),release) OBJDIR = obj/Release TARGETDIR = ../../bin/release TARGET = $(TARGETDIR)/premake4.exe DEFINES += -DNDEBUG INCLUDES += -I../../src/host/lua-5.1.4/src CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES) CFLAGS += $(CPPFLAGS) $(ARCH) -Wall -Os CXXFLAGS += $(CFLAGS) LDFLAGS += -s LIBS += RESFLAGS += $(DEFINES) $(INCLUDES) LDDEPS += LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS) define PREBUILDCMDS endef define PRELINKCMDS endef define POSTBUILDCMDS endef endif ifeq ($(config),debug) OBJDIR = obj/Debug TARGETDIR = ../../bin/debug TARGET = $(TARGETDIR)/premake4.exe DEFINES += -D_DEBUG INCLUDES += -I../../src/host/lua-5.1.4/src CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES) CFLAGS += $(CPPFLAGS) $(ARCH) -Wall -g CXXFLAGS += $(CFLAGS) LDFLAGS += LIBS += RESFLAGS += $(DEFINES) $(INCLUDES) LDDEPS += LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS) define PREBUILDCMDS endef define PRELINKCMDS endef define POSTBUILDCMDS endef endif OBJECTS := \ $(OBJDIR)/os_chdir.o \ $(OBJDIR)/os_copyfile.o \ $(OBJDIR)/os_getcwd.o \ $(OBJDIR)/os_isdir.o \ $(OBJDIR)/os_isfile.o \ $(OBJDIR)/os_match.o \ $(OBJDIR)/os_mkdir.o \ $(OBJDIR)/os_pathsearch.o \ $(OBJDIR)/os_rmdir.o \ $(OBJDIR)/os_uuid.o \ $(OBJDIR)/path_isabsolute.o \ $(OBJDIR)/premake.o \ $(OBJDIR)/scripts.o \ $(OBJDIR)/string_endswith.o \ $(OBJDIR)/lapi.o \ $(OBJDIR)/lauxlib.o \ $(OBJDIR)/lbaselib.o \ $(OBJDIR)/lcode.o \ $(OBJDIR)/ldblib.o \ $(OBJDIR)/ldebug.o \ $(OBJDIR)/ldo.o \ $(OBJDIR)/ldump.o \ $(OBJDIR)/lfunc.o \ $(OBJDIR)/lgc.o \ $(OBJDIR)/linit.o \ $(OBJDIR)/liolib.o \ $(OBJDIR)/llex.o \ $(OBJDIR)/lmathlib.o \ $(OBJDIR)/lmem.o \ $(OBJDIR)/loadlib.o \ $(OBJDIR)/lobject.o \ $(OBJDIR)/lopcodes.o \ $(OBJDIR)/loslib.o \ $(OBJDIR)/lparser.o \ $(OBJDIR)/lstate.o \ $(OBJDIR)/lstring.o \ $(OBJDIR)/lstrlib.o \ $(OBJDIR)/ltable.o \ $(OBJDIR)/ltablib.o \ $(OBJDIR)/ltm.o \ $(OBJDIR)/lundump.o \ $(OBJDIR)/lvm.o \ $(OBJDIR)/lzio.o \ RESOURCES := \ SHELLTYPE := msdos ifeq (,$(ComSpec)$(COMSPEC)) SHELLTYPE := posix endif ifeq (/bin,$(findstring /bin,$(SHELL))) SHELLTYPE := posix endif .PHONY: clean prebuild prelink all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET) @: $(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES) @echo Linking Premake4 $(SILENT) $(LINKCMD) $(POSTBUILDCMDS) $(TARGETDIR): @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) $(SILENT) mkdir -p $(TARGETDIR) else $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) $(SILENT) mkdir -p $(OBJDIR) else $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: @echo Cleaning Premake4 ifeq (posix,$(SHELLTYPE)) $(SILENT) rm -f $(TARGET) $(SILENT) rm -rf $(OBJDIR) else $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: $(PREBUILDCMDS) prelink: $(PRELINKCMDS) ifneq (,$(PCH)) $(GCH): $(PCH) @echo $(notdir $<) -$(SILENT) cp $< $(OBJDIR) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" endif $(OBJDIR)/os_chdir.o: ../../src/host/os_chdir.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_copyfile.o: ../../src/host/os_copyfile.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_getcwd.o: ../../src/host/os_getcwd.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_isdir.o: ../../src/host/os_isdir.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_isfile.o: ../../src/host/os_isfile.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_match.o: ../../src/host/os_match.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_mkdir.o: ../../src/host/os_mkdir.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_pathsearch.o: ../../src/host/os_pathsearch.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_rmdir.o: ../../src/host/os_rmdir.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_uuid.o: ../../src/host/os_uuid.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/path_isabsolute.o: ../../src/host/path_isabsolute.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/premake.o: ../../src/host/premake.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/scripts.o: ../../src/host/scripts.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/string_endswith.o: ../../src/host/string_endswith.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lapi.o: ../../src/host/lua-5.1.4/src/lapi.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lauxlib.o: ../../src/host/lua-5.1.4/src/lauxlib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lbaselib.o: ../../src/host/lua-5.1.4/src/lbaselib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lcode.o: ../../src/host/lua-5.1.4/src/lcode.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ldblib.o: ../../src/host/lua-5.1.4/src/ldblib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ldebug.o: ../../src/host/lua-5.1.4/src/ldebug.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ldo.o: ../../src/host/lua-5.1.4/src/ldo.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ldump.o: ../../src/host/lua-5.1.4/src/ldump.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lfunc.o: ../../src/host/lua-5.1.4/src/lfunc.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lgc.o: ../../src/host/lua-5.1.4/src/lgc.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/linit.o: ../../src/host/lua-5.1.4/src/linit.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/liolib.o: ../../src/host/lua-5.1.4/src/liolib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/llex.o: ../../src/host/lua-5.1.4/src/llex.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lmathlib.o: ../../src/host/lua-5.1.4/src/lmathlib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lmem.o: ../../src/host/lua-5.1.4/src/lmem.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/loadlib.o: ../../src/host/lua-5.1.4/src/loadlib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lobject.o: ../../src/host/lua-5.1.4/src/lobject.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lopcodes.o: ../../src/host/lua-5.1.4/src/lopcodes.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/loslib.o: ../../src/host/lua-5.1.4/src/loslib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lparser.o: ../../src/host/lua-5.1.4/src/lparser.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lstate.o: ../../src/host/lua-5.1.4/src/lstate.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lstring.o: ../../src/host/lua-5.1.4/src/lstring.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lstrlib.o: ../../src/host/lua-5.1.4/src/lstrlib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ltable.o: ../../src/host/lua-5.1.4/src/ltable.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ltablib.o: ../../src/host/lua-5.1.4/src/ltablib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ltm.o: ../../src/host/lua-5.1.4/src/ltm.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lundump.o: ../../src/host/lua-5.1.4/src/lundump.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lvm.o: ../../src/host/lua-5.1.4/src/lvm.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lzio.o: ../../src/host/lua-5.1.4/src/lzio.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" -include $(OBJECTS:%.o=%.d) premake-4.3-src+repack1/build/codeblocks.unix/0000755000000000000000000000000011470465412020006 5ustar rootrootpremake-4.3-src+repack1/build/codeblocks.unix/Premake4.cbp0000644000000000000000000003004611470465412022147 0ustar rootroot premake-4.3-src+repack1/build/codeblocks.unix/Premake4.workspace0000644000000000000000000000033211470465412023374 0ustar rootroot premake-4.3-src+repack1/build/gmake.macosx/0000755000000000000000000000000011470465412017271 5ustar rootrootpremake-4.3-src+repack1/build/gmake.macosx/Makefile0000644000000000000000000000136311470465412020734 0ustar rootroot# GNU Make solution makefile autogenerated by Premake # Type "make help" for usage help ifndef config config=release endif export config PROJECTS := Premake4 .PHONY: all clean help $(PROJECTS) all: $(PROJECTS) Premake4: @echo "==== Building Premake4 ($(config)) ====" @${MAKE} --no-print-directory -C . -f Premake4.make clean: @${MAKE} --no-print-directory -C . -f Premake4.make clean help: @echo "Usage: make [config=name] [target]" @echo "" @echo "CONFIGURATIONS:" @echo " release" @echo " debug" @echo " releaseuniv32" @echo " debuguniv32" @echo "" @echo "TARGETS:" @echo " all (default)" @echo " clean" @echo " Premake4" @echo "" @echo "For more information, see http://industriousone.com/premake/quick-start" premake-4.3-src+repack1/build/gmake.macosx/Premake4.make0000644000000000000000000002401511470465412021602 0ustar rootroot# GNU Make project makefile autogenerated by Premake ifndef config config=release endif ifndef verbose SILENT = @ endif ifndef CC CC = gcc endif ifndef CXX CXX = g++ endif ifndef AR AR = ar endif ifeq ($(config),release) OBJDIR = obj/Release TARGETDIR = ../../bin/release TARGET = $(TARGETDIR)/premake4 DEFINES += -DNDEBUG -DLUA_USE_MACOSX INCLUDES += -I../../src/host/lua-5.1.4/src CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES) CFLAGS += $(CPPFLAGS) $(ARCH) -Wall -Os -mmacosx-version-min=10.1 CXXFLAGS += $(CFLAGS) LDFLAGS += -Wl,-x -lstdc++-static -mmacosx-version-min=10.1 -rdynamic LIBS += RESFLAGS += $(DEFINES) $(INCLUDES) LDDEPS += LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS) define PREBUILDCMDS endef define PRELINKCMDS endef define POSTBUILDCMDS endef endif ifeq ($(config),debug) OBJDIR = obj/Debug TARGETDIR = ../../bin/debug TARGET = $(TARGETDIR)/premake4 DEFINES += -D_DEBUG -DLUA_USE_MACOSX INCLUDES += -I../../src/host/lua-5.1.4/src CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES) CFLAGS += $(CPPFLAGS) $(ARCH) -Wall -g -mmacosx-version-min=10.1 CXXFLAGS += $(CFLAGS) LDFLAGS += -lstdc++-static -mmacosx-version-min=10.1 -rdynamic LIBS += RESFLAGS += $(DEFINES) $(INCLUDES) LDDEPS += LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS) define PREBUILDCMDS endef define PRELINKCMDS endef define POSTBUILDCMDS endef endif ifeq ($(config),releaseuniv32) OBJDIR = obj/Universal32/Release TARGETDIR = ../../bin/release TARGET = $(TARGETDIR)/premake4 DEFINES += -DNDEBUG -DLUA_USE_MACOSX INCLUDES += -I../../src/host/lua-5.1.4/src CPPFLAGS += $(DEFINES) $(INCLUDES) CFLAGS += $(CPPFLAGS) $(ARCH) -Wall -Os -arch i386 -arch ppc -mmacosx-version-min=10.1 CXXFLAGS += $(CFLAGS) LDFLAGS += -Wl,-x -arch i386 -arch ppc -lstdc++-static -mmacosx-version-min=10.1 -rdynamic LIBS += RESFLAGS += $(DEFINES) $(INCLUDES) LDDEPS += LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS) define PREBUILDCMDS endef define PRELINKCMDS endef define POSTBUILDCMDS endef endif ifeq ($(config),debuguniv32) OBJDIR = obj/Universal32/Debug TARGETDIR = ../../bin/debug TARGET = $(TARGETDIR)/premake4 DEFINES += -D_DEBUG -DLUA_USE_MACOSX INCLUDES += -I../../src/host/lua-5.1.4/src CPPFLAGS += $(DEFINES) $(INCLUDES) CFLAGS += $(CPPFLAGS) $(ARCH) -Wall -g -arch i386 -arch ppc -mmacosx-version-min=10.1 CXXFLAGS += $(CFLAGS) LDFLAGS += -arch i386 -arch ppc -lstdc++-static -mmacosx-version-min=10.1 -rdynamic LIBS += RESFLAGS += $(DEFINES) $(INCLUDES) LDDEPS += LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS) define PREBUILDCMDS endef define PRELINKCMDS endef define POSTBUILDCMDS endef endif OBJECTS := \ $(OBJDIR)/os_chdir.o \ $(OBJDIR)/os_copyfile.o \ $(OBJDIR)/os_getcwd.o \ $(OBJDIR)/os_isdir.o \ $(OBJDIR)/os_isfile.o \ $(OBJDIR)/os_match.o \ $(OBJDIR)/os_mkdir.o \ $(OBJDIR)/os_pathsearch.o \ $(OBJDIR)/os_rmdir.o \ $(OBJDIR)/os_uuid.o \ $(OBJDIR)/path_isabsolute.o \ $(OBJDIR)/premake.o \ $(OBJDIR)/scripts.o \ $(OBJDIR)/string_endswith.o \ $(OBJDIR)/lapi.o \ $(OBJDIR)/lauxlib.o \ $(OBJDIR)/lbaselib.o \ $(OBJDIR)/lcode.o \ $(OBJDIR)/ldblib.o \ $(OBJDIR)/ldebug.o \ $(OBJDIR)/ldo.o \ $(OBJDIR)/ldump.o \ $(OBJDIR)/lfunc.o \ $(OBJDIR)/lgc.o \ $(OBJDIR)/linit.o \ $(OBJDIR)/liolib.o \ $(OBJDIR)/llex.o \ $(OBJDIR)/lmathlib.o \ $(OBJDIR)/lmem.o \ $(OBJDIR)/loadlib.o \ $(OBJDIR)/lobject.o \ $(OBJDIR)/lopcodes.o \ $(OBJDIR)/loslib.o \ $(OBJDIR)/lparser.o \ $(OBJDIR)/lstate.o \ $(OBJDIR)/lstring.o \ $(OBJDIR)/lstrlib.o \ $(OBJDIR)/ltable.o \ $(OBJDIR)/ltablib.o \ $(OBJDIR)/ltm.o \ $(OBJDIR)/lundump.o \ $(OBJDIR)/lvm.o \ $(OBJDIR)/lzio.o \ RESOURCES := \ SHELLTYPE := msdos ifeq (,$(ComSpec)$(COMSPEC)) SHELLTYPE := posix endif ifeq (/bin,$(findstring /bin,$(SHELL))) SHELLTYPE := posix endif .PHONY: clean prebuild prelink all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET) @: $(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES) @echo Linking Premake4 $(SILENT) $(LINKCMD) $(POSTBUILDCMDS) $(TARGETDIR): @echo Creating $(TARGETDIR) ifeq (posix,$(SHELLTYPE)) $(SILENT) mkdir -p $(TARGETDIR) else $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) endif $(OBJDIR): @echo Creating $(OBJDIR) ifeq (posix,$(SHELLTYPE)) $(SILENT) mkdir -p $(OBJDIR) else $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) endif clean: @echo Cleaning Premake4 ifeq (posix,$(SHELLTYPE)) $(SILENT) rm -f $(TARGET) $(SILENT) rm -rf $(OBJDIR) else $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) endif prebuild: $(PREBUILDCMDS) prelink: $(PRELINKCMDS) ifneq (,$(PCH)) $(GCH): $(PCH) @echo $(notdir $<) -$(SILENT) cp $< $(OBJDIR) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" endif $(OBJDIR)/os_chdir.o: ../../src/host/os_chdir.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_copyfile.o: ../../src/host/os_copyfile.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_getcwd.o: ../../src/host/os_getcwd.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_isdir.o: ../../src/host/os_isdir.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_isfile.o: ../../src/host/os_isfile.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_match.o: ../../src/host/os_match.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_mkdir.o: ../../src/host/os_mkdir.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_pathsearch.o: ../../src/host/os_pathsearch.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_rmdir.o: ../../src/host/os_rmdir.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/os_uuid.o: ../../src/host/os_uuid.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/path_isabsolute.o: ../../src/host/path_isabsolute.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/premake.o: ../../src/host/premake.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/scripts.o: ../../src/host/scripts.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/string_endswith.o: ../../src/host/string_endswith.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lapi.o: ../../src/host/lua-5.1.4/src/lapi.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lauxlib.o: ../../src/host/lua-5.1.4/src/lauxlib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lbaselib.o: ../../src/host/lua-5.1.4/src/lbaselib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lcode.o: ../../src/host/lua-5.1.4/src/lcode.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ldblib.o: ../../src/host/lua-5.1.4/src/ldblib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ldebug.o: ../../src/host/lua-5.1.4/src/ldebug.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ldo.o: ../../src/host/lua-5.1.4/src/ldo.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ldump.o: ../../src/host/lua-5.1.4/src/ldump.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lfunc.o: ../../src/host/lua-5.1.4/src/lfunc.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lgc.o: ../../src/host/lua-5.1.4/src/lgc.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/linit.o: ../../src/host/lua-5.1.4/src/linit.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/liolib.o: ../../src/host/lua-5.1.4/src/liolib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/llex.o: ../../src/host/lua-5.1.4/src/llex.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lmathlib.o: ../../src/host/lua-5.1.4/src/lmathlib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lmem.o: ../../src/host/lua-5.1.4/src/lmem.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/loadlib.o: ../../src/host/lua-5.1.4/src/loadlib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lobject.o: ../../src/host/lua-5.1.4/src/lobject.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lopcodes.o: ../../src/host/lua-5.1.4/src/lopcodes.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/loslib.o: ../../src/host/lua-5.1.4/src/loslib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lparser.o: ../../src/host/lua-5.1.4/src/lparser.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lstate.o: ../../src/host/lua-5.1.4/src/lstate.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lstring.o: ../../src/host/lua-5.1.4/src/lstring.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lstrlib.o: ../../src/host/lua-5.1.4/src/lstrlib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ltable.o: ../../src/host/lua-5.1.4/src/ltable.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ltablib.o: ../../src/host/lua-5.1.4/src/ltablib.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/ltm.o: ../../src/host/lua-5.1.4/src/ltm.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lundump.o: ../../src/host/lua-5.1.4/src/lundump.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lvm.o: ../../src/host/lua-5.1.4/src/lvm.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" $(OBJDIR)/lzio.o: ../../src/host/lua-5.1.4/src/lzio.c @echo $(notdir $<) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" -include $(OBJECTS:%.o=%.d) premake-4.3-src+repack1/premake4.lua0000644000000000000000000000530211470465410016026 0ustar rootroot-- -- Premake 4.x build configuration script -- -- -- Define the project. Put the release configuration first so it will be the -- default when folks build using the makefile. That way they don't have to -- worry about the /scripts argument and all that. -- solution "Premake4" configurations { "Release", "Debug" } location ( _OPTIONS["to"] ) project "Premake4" targetname "premake4" language "C" kind "ConsoleApp" flags { "No64BitChecks", "ExtraWarnings", "StaticRuntime" } includedirs { "src/host/lua-5.1.4/src" } files { "*.txt", "**.lua", "src/**.h", "src/**.c", } excludes { "src/premake.lua", "src/host/lua-5.1.4/src/lua.c", "src/host/lua-5.1.4/src/luac.c", "src/host/lua-5.1.4/src/print.c", "src/host/lua-5.1.4/**.lua", "src/host/lua-5.1.4/etc/*.c" } configuration "Debug" targetdir "bin/debug" defines "_DEBUG" flags { "Symbols" } configuration "Release" targetdir "bin/release" defines "NDEBUG" flags { "OptimizeSize" } configuration "vs*" defines { "_CRT_SECURE_NO_WARNINGS" } configuration "linux" defines { "LUA_USE_POSIX", "LUA_USE_DLOPEN" } links { "m", "dl" } configuration "macosx" defines { "LUA_USE_MACOSX" } configuration { "macosx", "gmake" } buildoptions { "-mmacosx-version-min=10.1" } linkoptions { "-lstdc++-static", "-mmacosx-version-min=10.1" } configuration { "not windows", "not solaris" } linkoptions { "-rdynamic" } configuration { "solaris" } linkoptions { "-Wl,--export-dynamic" } -- -- A more thorough cleanup. -- if _ACTION == "clean" then os.rmdir("bin") os.rmdir("build") end -- -- Use the --to=path option to control where the project files get generated. I use -- this to create project files for each supported toolset, each in their own folder, -- in preparation for deployment. -- newoption { trigger = "to", value = "path", description = "Set the output location for the generated files" } -- -- Use the embed action to convert all of the Lua scripts into C strings, which -- can then be built into the executable. Always embed the scripts before creating -- a release build. -- dofile("scripts/embed.lua") newaction { trigger = "embed", description = "Embed scripts in scripts.c; required before release builds", execute = doembed } -- -- Use the release action to prepare source and binary packages for a new release. -- This action isn't complete yet; a release still requires some manual work. -- dofile("scripts/release.lua") newaction { trigger = "release", description = "Prepare a new release (incomplete)", execute = dorelease } premake-4.3-src+repack1/src/0000755000000000000000000000000011470465410014402 5ustar rootrootpremake-4.3-src+repack1/src/tools/0000755000000000000000000000000011470465410015542 5ustar rootrootpremake-4.3-src+repack1/src/tools/msc.lua0000644000000000000000000000025611470465410017032 0ustar rootroot-- -- msc.lua -- Interface for the MS C/C++ compiler. -- Copyright (c) 2009 Jason Perkins and the Premake project -- premake.msc = { } premake.msc.namestyle = "windows" premake-4.3-src+repack1/src/tools/gcc.lua0000644000000000000000000001073011470465410017002 0ustar rootroot-- -- gcc.lua -- Provides GCC-specific configuration strings. -- Copyright (c) 2002-2008 Jason Perkins and the Premake project -- premake.gcc = { } -- -- Set default tools -- premake.gcc.cc = "gcc" premake.gcc.cxx = "g++" premake.gcc.ar = "ar" -- -- Translation of Premake flags into GCC flags -- local cflags = { EnableSSE = "-msse", EnableSSE2 = "-msse2", ExtraWarnings = "-Wall", FatalWarnings = "-Werror", FloatFast = "-ffast-math", FloatStrict = "-ffloat-store", NoFramePointer = "-fomit-frame-pointer", Optimize = "-O2", OptimizeSize = "-Os", OptimizeSpeed = "-O3", Symbols = "-g", } local cxxflags = { NoExceptions = "-fno-exceptions", NoRTTI = "-fno-rtti", } -- -- Map platforms to flags -- premake.gcc.platforms = { Native = { cppflags = "-MMD -MP", }, x32 = { cppflags = "-MMD -MP", flags = "-m32", ldflags = "-L/usr/lib32", }, x64 = { cppflags = "-MMD -MP", flags = "-m64", ldflags = "-L/usr/lib64", }, Universal = { cppflags = "", flags = "-arch i386 -arch x86_64 -arch ppc -arch ppc64", }, Universal32 = { cppflags = "", flags = "-arch i386 -arch ppc", }, Universal64 = { cppflags = "", flags = "-arch x86_64 -arch ppc64", }, PS3 = { cc = "ppu-lv2-g++", cxx = "ppu-lv2-g++", ar = "ppu-lv2-ar", cppflags = "-MMD -MP", } } local platforms = premake.gcc.platforms -- -- Returns a list of compiler flags, based on the supplied configuration. -- function premake.gcc.getcppflags(cfg) local result = { } table.insert(result, platforms[cfg.platform].cppflags) return result end function premake.gcc.getcflags(cfg) local result = table.translate(cfg.flags, cflags) table.insert(result, platforms[cfg.platform].flags) if cfg.system ~= "windows" and cfg.kind == "SharedLib" then table.insert(result, "-fPIC") end return result end function premake.gcc.getcxxflags(cfg) local result = table.translate(cfg.flags, cxxflags) return result end -- -- Returns a list of linker flags, based on the supplied configuration. -- function premake.gcc.getldflags(cfg) local result = { } -- OS X has a bug, see http://lists.apple.com/archives/Darwin-dev/2006/Sep/msg00084.html if not cfg.flags.Symbols then if cfg.system == "macosx" then table.insert(result, "-Wl,-x") else table.insert(result, "-s") end end if cfg.kind == "SharedLib" then if cfg.system == "macosx" then result = table.join(result, { "-dynamiclib", "-flat_namespace" }) else table.insert(result, "-shared") end if cfg.system == "windows" and not cfg.flags.NoImportLib then table.insert(result, '-Wl,--out-implib="' .. cfg.linktarget.fullpath .. '"') end end if cfg.kind == "WindowedApp" and cfg.system == "windows" then table.insert(result, "-mwindows") end local platform = platforms[cfg.platform] table.insert(result, platform.flags) table.insert(result, platform.ldflags) return result end -- -- Return a list of library search paths. Technically part of LDFLAGS but need to -- be separated because of the way Visual Studio calls GCC for the PS3. See bug -- #1729227 for background on why library paths must be split. -- function premake.gcc.getlibdirflags(cfg) local result = { } for _, value in ipairs(premake.getlinks(cfg, "all", "directory")) do table.insert(result, '-L' .. _MAKE.esc(value)) end return result end -- -- Returns a list of linker flags for library search directories and library -- names. See bug #1729227 for background on why the path must be split. -- function premake.gcc.getlinkflags(cfg) local result = { } for _, value in ipairs(premake.getlinks(cfg, "all", "basename")) do if path.getextension(value) == ".framework" then table.insert(result, '-framework ' .. _MAKE.esc(path.getbasename(value))) else table.insert(result, '-l' .. _MAKE.esc(value)) end end return result end -- -- Decorate defines for the GCC command line. -- function premake.gcc.getdefines(defines) local result = { } for _,def in ipairs(defines) do table.insert(result, '-D' .. def) end return result end -- -- Decorate include file search paths for the GCC command line. -- function premake.gcc.getincludedirs(includedirs) local result = { } for _,dir in ipairs(includedirs) do table.insert(result, "-I" .. _MAKE.esc(dir)) end return result end premake-4.3-src+repack1/src/tools/dotnet.lua0000644000000000000000000000350111470465410017541 0ustar rootroot-- -- dotnet.lua -- Interface for the C# compilers, all of which are flag compatible. -- Copyright (c) 2002-2009 Jason Perkins and the Premake project -- premake.dotnet = { } premake.dotnet.namestyle = "windows" -- -- Translation of Premake flags into CSC flags -- local flags = { FatalWarning = "/warnaserror", Optimize = "/optimize", OptimizeSize = "/optimize", OptimizeSpeed = "/optimize", Symbols = "/debug", Unsafe = "/unsafe" } -- -- Return the default build action for a given file, based on the file extension. -- function premake.dotnet.getbuildaction(fcfg) local ext = path.getextension(fcfg.name):lower() if fcfg.buildaction == "Compile" or ext == ".cs" then return "Compile" elseif fcfg.buildaction == "Embed" or ext == ".resx" then return "EmbeddedResource" elseif fcfg.buildaction == "Copy" or ext == ".asax" or ext == ".aspx" then return "Content" else return "None" end end -- -- Returns the compiler filename (they all use the same arguments) -- function premake.dotnet.getcompilervar(cfg) if (_OPTIONS.dotnet == "msnet") then return "csc" elseif (_OPTIONS.dotnet == "mono") then if (cfg.framework <= "1.1") then return "mcs" elseif (cfg.framework >= "4.0") then return "dmcs" else return "gmcs" end else return "cscc" end end -- -- Returns a list of compiler flags, based on the supplied configuration. -- function premake.dotnet.getflags(cfg) local result = table.translate(cfg.flags, flags) return result end -- -- Translates the Premake kind into the CSC kind string. -- function premake.dotnet.getkind(cfg) if (cfg.kind == "ConsoleApp") then return "Exe" elseif (cfg.kind == "WindowedApp") then return "WinExe" elseif (cfg.kind == "SharedLib") then return "Library" end endpremake-4.3-src+repack1/src/tools/ow.lua0000644000000000000000000000415611470465410016700 0ustar rootroot-- -- ow.lua -- Provides Open Watcom-specific configuration strings. -- Copyright (c) 2008 Jason Perkins and the Premake project -- premake.ow = { } premake.ow.namestyle = "windows" -- -- Set default tools -- premake.ow.cc = "WCL386" premake.ow.cxx = "WCL386" premake.ow.ar = "ar" -- -- Translation of Premake flags into OpenWatcom flags -- local cflags = { ExtraWarnings = "-wx", FatalWarning = "-we", FloatFast = "-omn", FloatStrict = "-op", Optimize = "-ox", OptimizeSize = "-os", OptimizeSpeed = "-ot", Symbols = "-d2", } local cxxflags = { NoExceptions = "-xd", NoRTTI = "-xr", } -- -- No specific platform support yet -- premake.ow.platforms = { Native = { flags = "" }, } -- -- Returns a list of compiler flags, based on the supplied configuration. -- function premake.ow.getcppflags(cfg) return {} end function premake.ow.getcflags(cfg) local result = table.translate(cfg.flags, cflags) if (cfg.flags.Symbols) then table.insert(result, "-hw") -- Watcom debug format for Watcom debugger end return result end function premake.ow.getcxxflags(cfg) local result = table.translate(cfg.flags, cxxflags) return result end -- -- Returns a list of linker flags, based on the supplied configuration. -- function premake.ow.getldflags(cfg) local result = { } if (cfg.flags.Symbols) then table.insert(result, "op symf") end return result end -- -- Returns a list of linker flags for library search directories and -- library names. -- function premake.ow.getlinkflags(cfg) local result = { } return result end -- -- Decorate defines for the command line. -- function premake.ow.getdefines(defines) local result = { } for _,def in ipairs(defines) do table.insert(result, '-D' .. def) end return result end -- -- Decorate include file search paths for the command line. -- function premake.ow.getincludedirs(includedirs) local result = { } for _,dir in ipairs(includedirs) do table.insert(result, '-I "' .. dir .. '"') end return result end premake-4.3-src+repack1/src/_manifest.lua0000644000000000000000000000345611470465410017062 0ustar rootroot-- -- _manifest.lua -- Manage the list of built-in Premake scripts. -- Copyright (c) 2002-2010 Jason Perkins and the Premake project -- -- The master list of built-in scripts. Order is important! If you want to -- build a new script into Premake, add it to this list. return { -- core files "base/os.lua", "base/path.lua", "base/string.lua", "base/table.lua", "base/io.lua", "base/globals.lua", "base/action.lua", "base/option.lua", "base/tree.lua", "base/solution.lua", "base/project.lua", "base/configs.lua", "base/api.lua", "base/cmdline.lua", "tools/dotnet.lua", "tools/gcc.lua", "tools/msc.lua", "tools/ow.lua", "base/validate.lua", "base/help.lua", "base/premake.lua", -- CodeBlocks action "actions/codeblocks/_codeblocks.lua", "actions/codeblocks/codeblocks_workspace.lua", "actions/codeblocks/codeblocks_cbp.lua", -- CodeLite action "actions/codelite/_codelite.lua", "actions/codelite/codelite_workspace.lua", "actions/codelite/codelite_project.lua", -- GNU make action "actions/make/_make.lua", "actions/make/make_solution.lua", "actions/make/make_cpp.lua", "actions/make/make_csharp.lua", -- Visual Studio actions "actions/vstudio/_vstudio.lua", "actions/vstudio/vs2002_solution.lua", "actions/vstudio/vs2002_csproj.lua", "actions/vstudio/vs2002_csproj_user.lua", "actions/vstudio/vs200x_vcproj.lua", "actions/vstudio/vs2003_solution.lua", "actions/vstudio/vs2005_solution.lua", "actions/vstudio/vs2005_csproj.lua", "actions/vstudio/vs2005_csproj_user.lua", "actions/vstudio/vs_generic_solution.lua", "actions/vstudio/vs2010_vcxproxj.lua", -- Xcode action "actions/xcode/_xcode.lua", "actions/xcode/xcode_common.lua", "actions/xcode/xcode_project.lua", -- Clean action "actions/clean/_clean.lua", } premake-4.3-src+repack1/src/_premake_main.lua0000644000000000000000000000727011470465410017702 0ustar rootroot-- -- _premake_main.lua -- Script-side entry point for the main program logic. -- Copyright (c) 2002-2009 Jason Perkins and the Premake project -- local scriptfile = "premake4.lua" local shorthelp = "Type 'premake4 --help' for help" local versionhelp = "premake4 (Premake Build Script Generator) %s" -- -- Inject a new target platform into each solution; called if the --platform -- argument was specified on the command line. -- local function injectplatform(platform) if not platform then return true end platform = premake.checkvalue(platform, premake.fields.platforms.allowed) for sln in premake.solution.each() do local platforms = sln.platforms or { } -- an empty table is equivalent to a native build if #platforms == 0 then table.insert(platforms, "Native") end -- the solution must provide a native build in order to support this feature if not table.contains(platforms, "Native") then return false, sln.name .. " does not target native platform\nNative platform settings are required for the --platform feature." end -- add it to the end of the list, if it isn't in there already if not table.contains(platforms, platform) then table.insert(platforms, platform) end sln.platforms = platforms end return true end -- -- Script-side program entry point. -- function _premake_main(scriptpath) -- if running off the disk (in debug mode), load everything -- listed in _manifest.lua; the list divisions make sure -- everything gets initialized in the proper order. if (scriptpath) then local scripts = dofile(scriptpath .. "/_manifest.lua") for _,v in ipairs(scripts) do dofile(scriptpath .. "/" .. v) end end -- Set up the environment for the chosen action early, so side-effects -- can be picked up by the scripts. premake.action.set(_ACTION) -- Seed the random number generator so actions don't have to do it themselves math.randomseed(os.time()) -- If there is a project script available, run it to get the -- project information, available options and actions, etc. local fname = _OPTIONS["file"] or scriptfile if (os.isfile(fname)) then dofile(fname) end -- Process special options if (_OPTIONS["version"]) then printf(versionhelp, _PREMAKE_VERSION) return 1 end if (_OPTIONS["help"]) then premake.showhelp() return 1 end -- If no action was specified, show a short help message if (not _ACTION) then print(shorthelp) return 1 end -- If there wasn't a project script I've got to bail now if (not os.isfile(fname)) then error("No Premake script ("..scriptfile..") found!", 2) end -- Validate the command-line arguments. This has to happen after the -- script has run to allow for project-specific options action = premake.action.current() if (not action) then error("Error: no such action '" .. _ACTION .. "'", 0) end ok, err = premake.option.validate(_OPTIONS) if (not ok) then error("Error: " .. err, 0) end -- Sanity check the current project setup ok, err = premake.checktools() if (not ok) then error("Error: " .. err, 0) end -- If a platform was specified on the command line, inject it now ok, err = injectplatform(_OPTIONS["platform"]) if (not ok) then error("Error: " .. err, 0) end -- work-in-progress: build the configurations print("Building configurations...") premake.buildconfigs() ok, err = premake.checkprojects() if (not ok) then error("Error: " .. err, 0) end -- Hand over control to the action printf("Running action '%s'...", action.trigger) premake.action.call(action.trigger) print("Done.") return 0 end premake-4.3-src+repack1/src/host/0000755000000000000000000000000012133645023015354 5ustar rootrootpremake-4.3-src+repack1/src/host/os_mkdir.c0000644000000000000000000000105511470465410017333 0ustar rootroot/** * \file os_mkdir.c * \brief Create a subdirectory. * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project */ #include #include "premake.h" int os_mkdir(lua_State* L) { int z; const char* path = luaL_checkstring(L, 1); #if PLATFORM_WINDOWS z = CreateDirectory(path, NULL); #else z = (mkdir(path, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) == 0); #endif if (!z) { lua_pushnil(L); lua_pushfstring(L, "unable to create directory '%s'", path); return 2; } else { lua_pushboolean(L, 1); return 1; } } premake-4.3-src+repack1/src/host/os_isfile.c0000644000000000000000000000100311470465410017471 0ustar rootroot/** * \file os_isfile.c * \brief Returns true if the given file exists on the file system. * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project */ #include #include "premake.h" int os_isfile(lua_State* L) { const char* filename = luaL_checkstring(L, 1); lua_pushboolean(L, do_isfile(filename)); return 1; } int do_isfile(const char* filename) { struct stat buf; if (stat(filename, &buf) == 0) { return ((buf.st_mode & S_IFDIR) == 0); } else { return 0; } } premake-4.3-src+repack1/src/host/os_uuid.c0000644000000000000000000000174411470465410017200 0ustar rootroot/** * \file os_uuid.c * \brief Create a new UUID. * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project */ #include "premake.h" int os_uuid(lua_State* L) { unsigned char bytes[16]; char uuid[38]; #if PLATFORM_WINDOWS static int (__stdcall *CoCreateGuid)(char*) = NULL; if (CoCreateGuid == NULL) { HMODULE hOleDll = LoadLibrary("OLE32.DLL"); CoCreateGuid = (int(__stdcall*)(char*))GetProcAddress(hOleDll, "CoCreateGuid"); } CoCreateGuid((char*)bytes); #else int result; /* not sure how to get a UUID here, so I fake it */ FILE* rnd = fopen("/dev/urandom", "rb"); result = fread(bytes, 16, 1, rnd); fclose(rnd); if (!result) return 0; #endif sprintf(uuid, "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X", bytes[0], bytes[1], bytes[2], bytes[3], bytes[4], bytes[5], bytes[6], bytes[7], bytes[8], bytes[9], bytes[10], bytes[11], bytes[12], bytes[13], bytes[14], bytes[15]); lua_pushstring(L, uuid); return 1; } premake-4.3-src+repack1/src/host/os_isdir.c0000644000000000000000000000106511470465410017340 0ustar rootroot/** * \file os_isdir.c * \brief Returns true if the specified directory exists. * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project */ #include #include #include "premake.h" int os_isdir(lua_State* L) { struct stat buf; const char* path = luaL_checkstring(L, 1); /* empty path is equivalent to ".", must be true */ if (strlen(path) == 0) { lua_pushboolean(L, 1); } else if (stat(path, &buf) == 0) { lua_pushboolean(L, buf.st_mode & S_IFDIR); } else { lua_pushboolean(L, 0); } return 1; } premake-4.3-src+repack1/src/host/string_endswith.c0000644000000000000000000000107611470465410020742 0ustar rootroot/** * \file string_endswith.c * \brief Determines if a string ends with the given sequence. * \author Copyright (c) 2002-2009 Jason Perkins and the Premake project */ #include "premake.h" #include int string_endswith(lua_State* L) { const char* haystack = luaL_optstring(L, 1, NULL); const char* needle = luaL_optstring(L, 2, NULL); if (haystack && needle) { int hlen = strlen(haystack); int nlen = strlen(needle); if (hlen >= nlen) { lua_pushboolean(L, strcmp(haystack + hlen - nlen, needle) == 0); return 1; } } return 0; } premake-4.3-src+repack1/src/host/os_getcwd.c0000644000000000000000000000111211470465410017474 0ustar rootroot/** * \file os_getcwd.c * \brief Retrieve the current working directory. * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project */ #include "premake.h" int os_getcwd(lua_State* L) { char buffer[0x4000]; char* ch; int result; #if PLATFORM_WINDOWS result = (GetCurrentDirectory(0x4000, buffer) != 0); #else result = (getcwd(buffer, 0x4000) != 0); #endif if (!result) return 0; /* convert to platform-neutral directory separators */ for (ch = buffer; *ch != '\0'; ++ch) { if (*ch == '\\') *ch = '/'; } lua_pushstring(L, buffer); return 1; } premake-4.3-src+repack1/src/host/path_isabsolute.c0000644000000000000000000000067011470465410020714 0ustar rootroot/** * \file path_isabsolute.c * \brief Determines if a path is absolute or relative. * \author Copyright (c) 2002-2009 Jason Perkins and the Premake project */ #include "premake.h" int path_isabsolute(lua_State* L) { const char* path = luaL_checkstring(L, 1); if (path[0] == '/' || path[0] == '\\' || path[0] == '$' || (path[0] != '\0' && path[1] == ':')) { lua_pushboolean(L, 1); return 1; } else { return 0; } } premake-4.3-src+repack1/src/host/premake.c0000644000000000000000000001421411470465410017151 0ustar rootroot/** * \file premake.c * \brief Program entry point. * \author Copyright (c) 2002-2010 Jason Perkins and the Premake project */ #include #include #include "premake.h" #define VERSION "4.3" #define COPYRIGHT "Copyright (C) 2002-2010 Jason Perkins and the Premake Project" #define ERROR_MESSAGE "%s\n" static int process_arguments(lua_State* L, int argc, const char** argv); static int process_option(lua_State* L, const char* arg); static int load_builtin_scripts(lua_State* L); /* A search path for script files */ static const char* scripts_path = NULL; /* precompiled bytecode buffer; in bytecode.c */ extern const char* builtin_scripts[]; /* Built-in functions */ static const luaL_Reg path_functions[] = { { "isabsolute", path_isabsolute }, { NULL, NULL } }; static const luaL_Reg os_functions[] = { { "chdir", os_chdir }, { "copyfile", os_copyfile }, { "isdir", os_isdir }, { "getcwd", os_getcwd }, { "isfile", os_isfile }, { "matchdone", os_matchdone }, { "matchisfile", os_matchisfile }, { "matchname", os_matchname }, { "matchnext", os_matchnext }, { "matchstart", os_matchstart }, { "mkdir", os_mkdir }, { "pathsearch", os_pathsearch }, { "rmdir", os_rmdir }, { "uuid", os_uuid }, { NULL, NULL } }; static const luaL_Reg string_functions[] = { { "endswith", string_endswith }, { NULL, NULL } }; /** * Program entry point. */ int main(int argc, const char** argv) { lua_State* L; int z = OKAY; /* prepare Lua for use */ L = lua_open(); luaL_openlibs(L); luaL_register(L, "path", path_functions); luaL_register(L, "os", os_functions); luaL_register(L, "string", string_functions); /* push the application metadata */ lua_pushstring(L, LUA_COPYRIGHT); lua_setglobal(L, "_COPYRIGHT"); lua_pushstring(L, VERSION); lua_setglobal(L, "_PREMAKE_VERSION"); lua_pushstring(L, COPYRIGHT); lua_setglobal(L, "_PREMAKE_COPYRIGHT"); /* set the OS platform variable */ lua_pushstring(L, PLATFORM_STRING); lua_setglobal(L, "_OS"); /* Parse the command line arguments */ if (z == OKAY) z = process_arguments(L, argc, argv); /* Run the built-in Premake scripts */ if (z == OKAY) z = load_builtin_scripts(L); /* Clean up and turn off the lights */ lua_close(L); return z; } /** * Process the command line arguments, splitting them into options, the * target action, and any arguments to that action. The results are pushed * into the session for later use. I could have done this in the scripts, * but I need the value of the /scripts option to find them. * \returns OKAY if successful. */ int process_arguments(lua_State* L, int argc, const char** argv) { int i; /* Create empty lists for Options and Args */ lua_newtable(L); lua_newtable(L); for (i = 1; i < argc; ++i) { /* Options start with '/' or '--'. The first argument that isn't an option * is the action. Anything after that is an argument to the action */ if (argv[i][0] == '/') { process_option(L, argv[i] + 1); } else if (argv[i][0] == '-' && argv[i][1] == '-') { process_option(L, argv[i] + 2); } else { /* not an option, is the action */ lua_pushstring(L, argv[i++]); lua_setglobal(L, "_ACTION"); /* everything else is an argument */ while (i < argc) { lua_pushstring(L, argv[i++]); lua_rawseti(L, -2, luaL_getn(L, -2) + 1); } } } /* push the Options and Args lists */ lua_setglobal(L, "_ARGS"); lua_setglobal(L, "_OPTIONS"); return OKAY; } /** * Parse an individual command-line option. * \returns OKAY if successful. */ int process_option(lua_State* L, const char* arg) { char key[512]; const char* value; /* If a value is specified, split the option into a key/value pair */ char* ptr = strchr(arg, '='); if (ptr) { int len = ptr - arg; if (len > 511) len = 511; strncpy(key, arg, len); key[len] = '\0'; value = ptr + 1; } else { strcpy(key, arg); value = ""; } /* Store it in the Options table, which is already on the stack */ lua_pushstring(L, value); lua_setfield(L, -3, key); /* The /scripts option gets picked up here to find the built-in scripts */ if (strcmp(key, "scripts") == 0 && strlen(value) > 0) { scripts_path = value; } return OKAY; } #if defined(_DEBUG) /** * When running in debug mode, the scripts are loaded from the disk. The path to * the scripts must be provided via either the /scripts command line option or * the PREMAKE_PATH environment variable. */ int load_builtin_scripts(lua_State* L) { const char* filename; /* call os.pathsearch() to locate _premake_main.lua */ lua_pushcfunction(L, os_pathsearch); lua_pushstring(L, "_premake_main.lua"); lua_pushstring(L, scripts_path); lua_pushstring(L, getenv("PREMAKE_PATH")); lua_call(L, 3, 1); if (lua_isnil(L, -1)) { printf(ERROR_MESSAGE, "Unable to find _premake_main.lua; use /scripts option when in debug mode!\n" "Please refer to the documentation (or build in release mode instead)." ); return !OKAY; } /* run the bootstrapping script */ scripts_path = lua_tostring(L, -1); filename = lua_pushfstring(L, "%s/_premake_main.lua", scripts_path); if (luaL_dofile(L, filename)) { printf(ERROR_MESSAGE, lua_tostring(L, -1)); return !OKAY; } /* hand off control to the scripts */ lua_getglobal(L, "_premake_main"); lua_pushstring(L, scripts_path); if (lua_pcall(L, 1, 1, 0) != OKAY) { printf(ERROR_MESSAGE, lua_tostring(L, -1)); return !OKAY; } else { return (int)lua_tonumber(L, -1); } } #endif #if defined(NDEBUG) /** * When running in release mode, the scripts are loaded from a static data * buffer, where they were stored by a preprocess. To update these embedded * scripts, run `premake4 embed` then rebuild. */ int load_builtin_scripts(lua_State* L) { int i; for (i = 0; builtin_scripts[i]; ++i) { if (luaL_dostring(L, builtin_scripts[i]) != OKAY) { printf(ERROR_MESSAGE, lua_tostring(L, -1)); return !OKAY; } } /* hand off control to the scripts */ lua_getglobal(L, "_premake_main"); if (lua_pcall(L, 0, 1, 0) != OKAY) { printf(ERROR_MESSAGE, lua_tostring(L,-1)); return !OKAY; } return OKAY; } #endif premake-4.3-src+repack1/src/host/os_rmdir.c0000644000000000000000000000076711470465410017353 0ustar rootroot/** * \file os_rmdir.c * \brief Remove a subdirectory. * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project */ #include #include "premake.h" int os_rmdir(lua_State* L) { int z; const char* path = luaL_checkstring(L, 1); #if PLATFORM_WINDOWS z = RemoveDirectory(path); #else z = rmdir(path); #endif if (!z) { lua_pushnil(L); lua_pushfstring(L, "unable to remove directory '%s'", path); return 2; } else { lua_pushboolean(L, 1); return 1; } } premake-4.3-src+repack1/src/host/scripts.c0000644000000000000000000052447611470465411017235 0ustar rootroot/* Premake's Lua scripts, as static data buffers for release mode builds */ /* DO NOT EDIT - this file is autogenerated - see BUILD.txt */ /* To regenerate this file, run: premake4 embed */ const char* builtin_scripts[] = { /* base/os.lua */ "function os.executef(cmd, ...)\ncmd = string.format(cmd, unpack(arg))\nreturn os.execute(cmd)\nend\nfunction os.findlib(libname)\nlocal path, formats\nif os.is(\"windows\") then\nformats = { \"%s.dll\", \"%s\" }\npath = os.getenv(\"PATH\")\nelse\nif os.is(\"macosx\") then\nformats = { \"lib%s.dylib\", \"%s.dylib\" }\npath = os.getenv(\"DYLD_LIBRARY_PATH\")\nelse\nformats = { \"lib%s.so\", \"%s.so\" }\npath = os.getenv(\"LD_LIBRARY_PATH\") or \"\"\nio.input(\"/etc/ld.so.conf\")\nif io.input() then\nfor line in io.lines() do\npath = path .. \":\" .. line\nend\nio.input():close()\nend\nend\ntable.insert(formats, \"%s\")\npath = (path or \"\") .. \":/lib:/usr/lib:/usr/local/lib\"\nend\nfor _, fmt in ipairs(formats) do\nlocal name = string.format(fmt, libname)\nlocal result = os.pathsearch(name, path)\nif result then return result end\nend\nend\nfunction os.get()\nreturn _OPTIONS.os or _OS\nend\nfunction os.is(id)\nreturn (os.get():lower() == id:lower())\nend\nlocal function domatch(result, mask, wantfiles)\nif mas" "k:startswith(\"./\") then\nmask = mask:sub(3)\nend\nlocal basedir = mask\nlocal starpos = mask:find(\"%*\")\nif starpos then\nbasedir = basedir:sub(1, starpos - 1)\nend\nbasedir = path.getdirectory(basedir)\nif (basedir == \".\") then basedir = \"\" end\nlocal recurse = mask:find(\"**\", nil, true)\nmask = path.wildcards(mask)\nlocal function matchwalker(basedir)\nlocal wildcard = path.join(basedir, \"*\")\nlocal m = os.matchstart(wildcard)\nwhile (os.matchnext(m)) do\nlocal isfile = os.matchisfile(m)\nif ((wantfiles and isfile) or (not wantfiles and not isfile)) then\nlocal fname = path.join(basedir, os.matchname(m))\nif fname:match(mask) == fname then\ntable.insert(result, fname)\nend\nend\nend\nos.matchdone(m)\nif recurse then\nm = os.matchstart(wildcard)\nwhile (os.matchnext(m)) do\nif not os.matchisfile(m) then\nlocal dirname = os.matchname(m)\nmatchwalker(path.join(basedir, dirname))\nend\nend\nos.matchdone(m)\nend\nend\nmatchwalker(basedir)\nend\nfunction os.matchdirs(...)\nlocal result = { }\nfor _, ma" "sk in ipairs(arg) do\ndomatch(result, mask, false)\nend\nreturn result\nend\nfunction os.matchfiles(...)\nlocal result = { }\nfor _, mask in ipairs(arg) do\ndomatch(result, mask, true)\nend\nreturn result\nend\nlocal builtin_mkdir = os.mkdir\nfunction os.mkdir(p)\nlocal dir = iif(p:startswith(\"/\"), \"/\", \"\")\nfor part in p:gmatch(\"[^/]+\") do\ndir = dir .. part\nif (part ~= \"\" and not path.isabsolute(part) and not os.isdir(dir)) then\nlocal ok, err = builtin_mkdir(dir)\nif (not ok) then\nreturn nil, err\nend\nend\ndir = dir .. \"/\"\nend\nreturn true\nend\nlocal builtin_rmdir = os.rmdir\nfunction os.rmdir(p)\nlocal dirs = os.matchdirs(p .. \"/*\")\nfor _, dname in ipairs(dirs) do\nos.rmdir(dname)\nend\nlocal files = os.matchfiles(p .. \"/*\")\nfor _, fname in ipairs(files) do\nos.remove(fname)\nend\nbuiltin_rmdir(p)\nend\n", /* base/path.lua */ "function path.getabsolute(p)\np = path.translate(p, \"/\")\nif (p == \"\") then p = \".\" end\nlocal result = iif (path.isabsolute(p), nil, os.getcwd())\nfor n, part in ipairs(p:explode(\"/\", true)) do\nif (part == \"\" and n == 1) then\nresult = \"/\"\nelseif (part == \"..\") then\nresult = path.getdirectory(result)\nelseif (part ~= \".\") then\nresult = path.join(result, part)\nend\nend\nresult = iif(result:endswith(\"/\"), result:sub(1, -2), result)\nreturn result\nend\nfunction path.getbasename(p)\nlocal name = path.getname(p)\nlocal i = name:findlast(\".\", true)\nif (i) then\nreturn name:sub(1, i - 1)\nelse\nreturn name\nend\nend\nfunction path.getdirectory(p)\nlocal i = p:findlast(\"/\", true)\nif (i) then\nif i > 1 then i = i - 1 end\nreturn p:sub(1, i)\nelse\nreturn \".\"\nend\nend\nfunction path.getdrive(p)\nlocal ch1 = p:sub(1,1)\nlocal ch2 = p:sub(2,2)\nif ch2 == \":\" then\nreturn ch1\nend\nend\nfunction path.getextension(p)\nlocal i = p:findlast(\".\", true)\nif (i) then\nreturn p:sub(i)\nelse\n" "return \"\"\nend\nend\nfunction path.getname(p)\nlocal i = p:findlast(\"[/\\\\]\")\nif (i) then\nreturn p:sub(i + 1)\nelse\nreturn p\nend\nend\nfunction path.getrelative(src, dst)\nsrc = path.getabsolute(src)\ndst = path.getabsolute(dst)\nif (src == dst) then\nreturn \".\"\nend\nif dst:startswith(\"$\") then\nreturn dst\nend\nsrc = src .. \"/\"\ndst = dst .. \"/\"\nlocal idx = 0\nwhile (true) do\nlocal tst = src:find(\"/\", idx + 1, true)\nif tst then\nif src:sub(1,tst) == dst:sub(1,tst) then\nidx = tst\nelse\nbreak\nend\nelse\nbreak\nend\nend\nlocal first = src:find(\"/\", 0, true)\nif idx <= first then\nreturn dst:sub(1, -2)\nend\nsrc = src:sub(idx + 1)\ndst = dst:sub(idx + 1)\nlocal result = \"\"\nidx = src:find(\"/\")\nwhile (idx) do\nresult = result .. \"../\"\nidx = src:find(\"/\", idx + 1)\nend\nresult = result .. dst\nreturn result:sub(1, -2)\nend\nfunction path.iscfile(fname)\nlocal extensions = { \".c\", \".s\", \".m\" }\nlocal ext = path.getextension(fname):lower()\nreturn table.contains(extensions," " ext)\nend\nfunction path.iscppfile(fname)\nlocal extensions = { \".cc\", \".cpp\", \".cxx\", \".c\", \".s\", \".m\", \".mm\" }\nlocal ext = path.getextension(fname):lower()\nreturn table.contains(extensions, ext)\nend\nfunction path.isresourcefile(fname)\nlocal extensions = { \".rc\" }\nlocal ext = path.getextension(fname):lower()\nreturn table.contains(extensions, ext)\nend\nfunction path.join(leading, trailing)\nleading = leading or \"\"\nif (not trailing) then\nreturn leading\nend\nif (path.isabsolute(trailing)) then\nreturn trailing\nend\nif (leading == \".\") then\nleading = \"\"\nend\nif (leading:len() > 0 and not leading:endswith(\"/\")) then\nleading = leading .. \"/\"\nend\nreturn leading .. trailing\nend\nfunction path.rebase(p, oldbase, newbase)\np = path.getabsolute(path.join(oldbase, p))\np = path.getrelative(newbase, p)\nreturn p\nend\nfunction path.translate(p, sep)\nif (type(p) == \"table\") then\nlocal result = { }\nfor _, value in ipairs(p) do\ntable.insert(result, path.translate(value))\nen" "d\nreturn result\nelse\nif (not sep) then\nif (os.is(\"windows\")) then\nsep = \"\\\\\"\nelse\nsep = \"/\"\nend\nend\nlocal result = p:gsub(\"[/\\\\]\", sep)\nreturn result\nend\nend\nfunction path.wildcards(pattern)\npattern = pattern:gsub(\"([%+%.%-%^%$%(%)%%])\", \"%%%1\")\npattern = pattern:gsub(\"%*%*\", \"\\001\")\npattern = pattern:gsub(\"%*\", \"\\002\")\npattern = pattern:gsub(\"\\001\", \".*\")\npattern = pattern:gsub(\"\\002\", \"[^/]*\")\nreturn pattern\nend\n", /* base/string.lua */ "function string.explode(s, pattern, plain)\nif (pattern == '') then return false end\nlocal pos = 0\nlocal arr = { }\nfor st,sp in function() return s:find(pattern, pos, plain) end do\ntable.insert(arr, s:sub(pos, st-1))\npos = sp + 1\nend\ntable.insert(arr, s:sub(pos))\nreturn arr\nend\nfunction string.findlast(s, pattern, plain)\nlocal curr = 0\nrepeat\nlocal next = s:find(pattern, curr + 1, plain)\nif (next) then curr = next end\nuntil (not next)\nif (curr > 0) then\nreturn curr\nend\nend\nfunction string.startswith(haystack, needle)\nreturn (haystack:find(needle, 1, true) == 1)\nend\n", /* base/table.lua */ "function table.contains(t, value)\nfor _,v in pairs(t) do\nif (v == value) then\nreturn true\nend\nend\nreturn false\nend\nfunction table.extract(arr, fname)\nlocal result = { }\nfor _,v in ipairs(arr) do\ntable.insert(result, v[fname])\nend\nreturn result\nend\nfunction table.flatten(arr)\nlocal result = { }\nlocal function flatten(arr)\nfor _, v in ipairs(arr) do\nif type(v) == \"table\" then\nflatten(v)\nelse\ntable.insert(result, v)\nend\nend\nend\nflatten(arr)\nreturn result\nend\nfunction table.implode(arr, before, after, between)\nlocal result = \"\"\nfor _,v in ipairs(arr) do\nif (result ~= \"\" and between) then\nresult = result .. between\nend\nresult = result .. before .. v .. after\nend\nreturn result\nend\nfunction table.isempty(t)\nreturn not next(t)\nend\nfunction table.join(...)\nlocal result = { }\nfor _,t in ipairs(arg) do\nif type(t) == \"table\" then\nfor _,v in ipairs(t) do\ntable.insert(result, v)\nend\nelse\ntable.insert(result, t)\nend\nend\nreturn result\nend\nfunction table.keys(tbl)" "\nlocal keys = {}\nfor k, _ in pairs(tbl) do\ntable.insert(keys, k)\nend\nreturn keys\nend\nfunction table.translate(arr, translation)\nlocal result = { }\nfor _, value in ipairs(arr) do\nlocal tvalue\nif type(translation) == \"function\" then\ntvalue = translation(value)\nelse\ntvalue = translation[value]\nend\nif (tvalue) then\ntable.insert(result, tvalue)\nend\nend\nreturn result\nend\n", /* base/io.lua */ "function io.capture()\nio.captured = ''\nend\nfunction io.endcapture()\nlocal captured = io.captured\nio.captured = nil\nreturn captured\nend\nlocal builtin_open = io.open\nfunction io.open(fname, mode)\nif (mode) then\nif (mode:find(\"w\")) then\nlocal dir = path.getdirectory(fname)\nok, err = os.mkdir(dir)\nif (not ok) then\nerror(err, 0)\nend\nend\nend\nreturn builtin_open(fname, mode)\nend\nfunction io.printf(msg, ...)\nif (not io.eol) then\nio.eol = \"\\n\"\nend\nlocal s\nif type(msg) == \"number\" then\ns = string.rep(\"\\t\", msg) .. string.format(unpack(arg))\nelse\ns = string.format(msg, unpack(arg))\nend\nif io.captured then\nio.captured = io.captured .. s .. io.eol\nelse\nio.write(s)\nio.write(io.eol)\nend\nend\n_p = io.printf\n", /* base/globals.lua */ "premake = { }\npremake.platforms = \n{\nNative = \n{ \ncfgsuffix = \"\",\n},\nx32 = \n{ \ncfgsuffix = \"32\",\n},\nx64 = \n{ \ncfgsuffix = \"64\",\n},\nUniversal = \n{ \ncfgsuffix = \"univ\",\n},\nUniversal32 = \n{ \ncfgsuffix = \"univ32\",\n},\nUniversal64 = \n{ \ncfgsuffix = \"univ64\",\n},\nPS3 = \n{ \ncfgsuffix = \"ps3\",\niscrosscompiler = true,\nnosharedlibs = true,\nnamestyle = \"PS3\",\n},\nXbox360 = \n{ \ncfgsuffix = \"xbox360\",\niscrosscompiler = true,\nnamestyle = \"windows\",\n},\n}\nlocal builtin_dofile = dofile\nfunction dofile(fname)\nlocal oldcwd = os.getcwd()\nlocal oldfile = _SCRIPT\nif (not os.isfile(fname)) then\nlocal path = os.pathsearch(fname, _OPTIONS[\"scripts\"], os.getenv(\"PREMAKE_PATH\"))\nif (path) then\nfname = path..\"/\"..fname\nend\nend\n_SCRIPT = path.getabsolute(fname)\nlocal newcwd = path.getdirectory(_SCRIPT)\nos.chdir(newcwd)\nlocal a, b, c, d, e, f = builtin_dofile(_SCRIPT)\n_SCRIPT = oldfile\nos.chdir(oldcw" "d)\nreturn a, b, c, d, e, f\nend\nfunction iif(expr, trueval, falseval)\nif (expr) then\nreturn trueval\nelse\nreturn falseval\nend\nend\nfunction include(fname)\nreturn dofile(fname .. \"/premake4.lua\")\nend\nfunction printf(msg, ...)\nprint(string.format(msg, unpack(arg)))\nend\nlocal builtin_type = type\nfunction type(t)\nlocal mt = getmetatable(t)\nif (mt) then\nif (mt.__type) then\nreturn mt.__type\nend\nend\nreturn builtin_type(t)\nend\n", /* base/action.lua */ "premake.action = { }\npremake.action.list = { }\nfunction premake.action.add(a)\nlocal missing\nfor _, field in ipairs({\"description\", \"trigger\"}) do\nif (not a[field]) then\nmissing = field\nend\nend\nif (missing) then\nerror(\"action needs a \" .. missing, 3)\nend\npremake.action.list[a.trigger] = a\nend\nfunction premake.action.call(name)\nlocal a = premake.action.list[name]\nfor sln in premake.solution.each() do\nif a.onsolution then\na.onsolution(sln)\nend\nfor prj in premake.solution.eachproject(sln) do\nif a.onproject then\na.onproject(prj)\nend\nend\nend\nif a.execute then\na.execute()\nend\nend\nfunction premake.action.current()\nreturn premake.action.get(_ACTION)\nend\nfunction premake.action.get(name)\nreturn premake.action.list[name]\nend\nfunction premake.action.each()\nlocal keys = { }\nfor _, action in pairs(premake.action.list) do\ntable.insert(keys, action.trigger)\nend\ntable.sort(keys)\nlocal i = 0\nreturn function()\ni = i + 1\nreturn premake.action.list[keys[i]]\nend\nend\nfunction pre" "make.action.set(name)\n_ACTION = name\nlocal action = premake.action.get(name)\nif action then\n_OS = action.os or _OS\nend\nend\nfunction premake.action.supports(action, feature)\nif not action then\nreturn false\nend\nif action.valid_languages then\nif table.contains(action.valid_languages, feature) then\nreturn true\nend\nend\nif action.valid_kinds then\nif table.contains(action.valid_kinds, feature) then\nreturn true\nend\nend\nreturn false\nend\n", /* base/option.lua */ "premake.option = { }\npremake.option.list = { }\nfunction premake.option.add(opt)\nlocal missing\nfor _, field in ipairs({ \"description\", \"trigger\" }) do\nif (not opt[field]) then\nmissing = field\nend\nend\nif (missing) then\nerror(\"option needs a \" .. missing, 3)\nend\npremake.option.list[opt.trigger] = opt\nend\nfunction premake.option.get(name)\nreturn premake.option.list[name]\nend\nfunction premake.option.each()\nlocal keys = { }\nfor _, option in pairs(premake.option.list) do\ntable.insert(keys, option.trigger)\nend\ntable.sort(keys)\nlocal i = 0\nreturn function()\ni = i + 1\nreturn premake.option.list[keys[i]]\nend\nend\nfunction premake.option.validate(values)\nfor key, value in pairs(values) do\nlocal opt = premake.option.get(key)\nif (not opt) then\nreturn false, \"invalid option '\" .. key .. \"'\"\nend\nif (opt.value and value == \"\") then\nreturn false, \"no value specified for option '\" .. key .. \"'\"\nend\nif (opt.allowed) then\nfor _, match in ipairs(opt.allowed) do\nif (match[1] == " "value) then return true end\nend\nreturn false, \"invalid value '\" .. value .. \"' for option '\" .. key .. \"'\"\nend\nend\nreturn true\nend\n", /* base/tree.lua */ "premake.tree = { }\nlocal tree = premake.tree\nfunction premake.tree.new(n)\nlocal t = {\nname = n,\nchildren = { }\n}\nreturn t\nend\nfunction premake.tree.add(tr, p)\nif p == \".\" then\nreturn tr\nend\nlocal parentnode = tree.add(tr, path.getdirectory(p))\nlocal childname = path.getname(p)\nif childname == \"..\" then\nreturn parentnode\nend\nlocal childnode = parentnode.children[childname]\nif not childnode or childnode.path ~= p then\nchildnode = tree.insert(parentnode, tree.new(childname))\nchildnode.path = p\nend\nreturn childnode\nend\nfunction premake.tree.insert(parent, child)\ntable.insert(parent.children, child)\nif child.name then\nparent.children[child.name] = child\nend\nchild.parent = parent\nreturn child\nend\nfunction premake.tree.getlocalpath(node)\nif node.parent.path then\nreturn node.name\nelse\nreturn node.path\nend\nend\nfunction premake.tree.remove(node)\nlocal children = node.parent.children\nfor i = 1, #children do\nif children[i] == node then\ntable.remove(children, i)\nend\nend\nno" "de.children = {}\nend\nfunction premake.tree.sort(tr)\ntree.traverse(tr, {\nonnode = function(node)\ntable.sort(node.children, function(a,b)\nreturn a.name < b.name\nend)\nend\n}, true)\nend\nfunction premake.tree.traverse(t, fn, includeroot)\nlocal donode, dochildren\ndonode = function(node, fn, depth)\nif node.isremoved then \nreturn \nend\nif fn.onnode then \nfn.onnode(node, depth) \nend\nif #node.children > 0 then\nif fn.onbranch then \nfn.onbranch(node, depth) \nend\ndochildren(node, fn, depth + 1)\nelse\nif fn.onleaf then \nfn.onleaf(node, depth) \nend\nend\nend\ndochildren = function(parent, fn, depth)\nlocal i = 1\nwhile i <= #parent.children do\nlocal node = parent.children[i]\ndonode(node, fn, depth)\nif node == parent.children[i] then\ni = i + 1\nend\nend\nend\nif includeroot then\ndonode(t, fn, 0)\nelse\ndochildren(t, fn, 0)\nend\nend\n", /* base/solution.lua */ "premake.solution = { }\npremake.solution.list = { }\nfunction premake.solution.new(name)\nlocal sln = { }\ntable.insert(premake.solution.list, sln)\npremake.solution.list[name] = sln\nsetmetatable(sln, { __type=\"solution\" })\nsln.name = name\nsln.basedir = os.getcwd()\nsln.projects = { }\nsln.blocks = { }\nsln.configurations = { }\nreturn sln\nend\nfunction premake.solution.each()\nlocal i = 0\nreturn function ()\ni = i + 1\nif i <= #premake.solution.list then\nreturn premake.solution.list[i]\nend\nend\nend\nfunction premake.solution.eachproject(sln)\nlocal i = 0\nreturn function ()\ni = i + 1\nif (i <= #sln.projects) then\nreturn premake.solution.getproject(sln, i)\nend\nend\nend\nfunction premake.solution.get(key)\nreturn premake.solution.list[key]\nend\nfunction premake.solution.getproject(sln, idx)\nlocal prj = sln.projects[idx]\nlocal cfg = premake.getconfig(prj)\ncfg.name = prj.name\nreturn cfg\nend\n", /* base/project.lua */ "premake.project = { }\nfunction premake.project.buildsourcetree(prj)\nlocal tr = premake.tree.new(prj.name)\nfor _, fname in ipairs(prj.files) do\nlocal node = premake.tree.add(tr, fname)\nend\npremake.tree.sort(tr)\ntr.project = prj\nreturn tr\nend\nfunction premake.eachconfig(prj, platform)\nif prj.project then prj = prj.project end\nlocal cfgs = prj.solution.configurations\nlocal i = 0\nreturn function ()\ni = i + 1\nif i <= #cfgs then\nreturn premake.getconfig(prj, cfgs[i], platform)\nend\nend\nend\nfunction premake.eachfile(prj)\nif not prj.project then prj = premake.getconfig(prj) end\nlocal i = 0\nlocal t = prj.files\nreturn function ()\ni = i + 1\nif (i <= #t) then\nreturn prj.__fileconfigs[t[i]]\nend\nend\nend\nfunction premake.esc(value)\nif (type(value) == \"table\") then\nlocal result = { }\nfor _,v in ipairs(value) do\ntable.insert(result, premake.esc(v))\nend\nreturn result\nelse\nvalue = value:gsub('&', \"&\")\nvalue = value:gsub('\"', \""\")\nvalue = value:gsub(\"'\", \"'\")\nv" "alue = value:gsub('<', \"<\")\nvalue = value:gsub('>', \">\")\nvalue = value:gsub('\\r', \" \")\nvalue = value:gsub('\\n', \" \")\nreturn value\nend\nend\nfunction premake.filterplatforms(sln, map, default)\nlocal result = { }\nlocal keys = { }\nif sln.platforms then\nfor _, p in ipairs(sln.platforms) do\nif map[p] and not table.contains(keys, map[p]) then\ntable.insert(result, p)\ntable.insert(keys, map[p])\nend\nend\nend\nif #result == 0 and default then\ntable.insert(result, default)\nend\nreturn result\nend\nfunction premake.findproject(name)\nfor sln in premake.solution.each() do\nfor prj in premake.solution.eachproject(sln) do\nif (prj.name == name) then\nreturn prj\nend\nend\nend\nend\nfunction premake.findfile(prj, extension)\nfor _, fname in ipairs(prj.files) do\nif fname:endswith(extension) then return fname end\nend\nend\nfunction premake.getconfig(prj, cfgname, pltname)\nprj = prj.project or prj\nif pltname == \"Native\" or not table.contains(prj.solution.platforms or {}, pltname" ") then\npltname = nil\nend\nlocal key = (cfgname or \"\")\nif pltname then key = key .. pltname end\nreturn prj.__configs[key]\nend\nfunction premake.getconfigname(cfgname, platform, useshortname)\nif cfgname then\nlocal name = cfgname\nif platform and platform ~= \"Native\" then\nif useshortname then\nname = name .. premake.platforms[platform].cfgsuffix\nelse\nname = name .. \"|\" .. platform\nend\nend\nreturn iif(useshortname, name:lower(), name)\nend\nend\nfunction premake.getdependencies(prj)\nprj = prj.project or prj\nlocal results = { }\nfor _, cfg in pairs(prj.__configs) do\nfor _, link in ipairs(cfg.links) do\nlocal dep = premake.findproject(link)\nif dep and not table.contains(results, dep) then\ntable.insert(results, dep)\nend\nend\nend\nreturn results\nend\nfunction premake.project.getfilename(prj, pattern)\nlocal fname = pattern:gsub(\"%%%%\", prj.name)\nfname = path.join(prj.location, fname)\nreturn path.getrelative(os.getcwd(), fname)\nend\n function premake.getlinks(cfg, kind, part)\nlocal resul" "t = iif (part == \"directory\" and kind == \"all\", cfg.libdirs, {})\nlocal cfgname = iif(cfg.name == cfg.project.name, \"\", cfg.name)\nlocal pathstyle = premake.getpathstyle(cfg)\nlocal namestyle = premake.getnamestyle(cfg)\nlocal function canlink(source, target)\nif (target.kind ~= \"SharedLib\" and target.kind ~= \"StaticLib\") then \nreturn false\nend\nif premake.iscppproject(source) then\nreturn premake.iscppproject(target)\nelseif premake.isdotnetproject(source) then\nreturn premake.isdotnetproject(target)\nend\nend\nfor _, link in ipairs(cfg.links) do\nlocal item\nlocal prj = premake.findproject(link)\nif prj and kind ~= \"system\" then\nlocal prjcfg = premake.getconfig(prj, cfgname, cfg.platform)\nif kind == \"dependencies\" or canlink(cfg, prjcfg) then\nif (part == \"directory\") then\nitem = path.rebase(prjcfg.linktarget.directory, prjcfg.location, cfg.location)\nelseif (part == \"basename\") then\nitem = prjcfg.linktarget.basename\nelseif (part == \"fullpath\") then\nitem = path.rebase(prjcfg.linkt" "arget.fullpath, prjcfg.location, cfg.location)\nelseif (part == \"object\") then\nitem = prjcfg\nend\nend\nelseif not prj and (kind == \"system\" or kind == \"all\") then\nif (part == \"directory\") then\nlocal dir = path.getdirectory(link)\nif (dir ~= \".\") then\nitem = dir\nend\nelseif (part == \"fullpath\") then\nitem = link\nif namestyle == \"windows\" then\nif premake.iscppproject(cfg) then\nitem = item .. \".lib\"\nelseif premake.isdotnetproject(cfg) then\nitem = item .. \".dll\"\nend\nend\nif item:find(\"/\", nil, true) then\nitem = path.getrelative(cfg.basedir, item)\nend\nelse\nitem = link\nend\nend\nif item then\nif pathstyle == \"windows\" and part ~= \"object\" then\nitem = path.translate(item, \"\\\\\")\nend\nif not table.contains(result, item) then\ntable.insert(result, item)\nend\nend\nend\nreturn result\nend\nfunction premake.getnamestyle(cfg)\nreturn premake.platforms[cfg.platform].namestyle or premake.gettool(cfg).namestyle or \"posix\"\nend\nfunction premake.getpathstyle(cfg)\nif premake.ac" "tion.current().os == \"windows\" then\nreturn \"windows\"\nelse\nreturn \"posix\"\nend\nend\nfunction premake.gettarget(cfg, direction, pathstyle, namestyle, system)\nif system == \"bsd\" or system == \"solaris\" then \nsystem = \"linux\" \nend\nlocal kind = cfg.kind\nif premake.iscppproject(cfg) then\nif (namestyle == \"windows\" or system == \"windows\") and kind == \"SharedLib\" and direction == \"link\" then\nkind = \"StaticLib\"\nend\nif namestyle == \"posix\" and system == \"windows\" and kind ~= \"StaticLib\" then\nnamestyle = \"windows\"\nend\nend\nlocal field = iif(direction == \"build\", \"target\", \"implib\")\nlocal name = cfg[field..\"name\"] or cfg.targetname or cfg.project.name\nlocal dir = cfg[field..\"dir\"] or cfg.targetdir or path.getrelative(cfg.location, cfg.basedir)\nlocal prefix = \"\"\nlocal suffix = \"\"\nlocal ext = \"\"\nlocal bundlepath, bundlename\nif namestyle == \"windows\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".exe\"\nelseif kind" " == \"SharedLib\" then\next = \".dll\"\nelseif kind == \"StaticLib\" then\next = \".lib\"\nend\nelseif namestyle == \"posix\" then\nif kind == \"WindowedApp\" and system == \"macosx\" then\nbundlename = name .. \".app\"\nbundlepath = path.join(dir, bundlename)\ndir = path.join(bundlepath, \"Contents/MacOS\")\nelseif kind == \"SharedLib\" then\nprefix = \"lib\"\next = iif(system == \"macosx\", \".dylib\", \".so\")\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nelseif namestyle == \"PS3\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".elf\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nend\nprefix = cfg[field..\"prefix\"] or cfg.targetprefix or prefix\nsuffix = cfg[field..\"suffix\"] or cfg.targetsuffix or suffix\next = cfg[field..\"extension\"] or cfg.targetextension or ext\nlocal result = { }\nresult.basename = name .. suffix\nresult.name = prefix .. name .. suffix .. ext\nresult.directory = dir\nresult.prefix = pre" "fix\nresult.suffix = suffix\nresult.fullpath = path.join(result.directory, result.name)\nresult.bundlepath = bundlepath or result.fullpath\nif pathstyle == \"windows\" then\nresult.directory = path.translate(result.directory, \"\\\\\")\nresult.fullpath = path.translate(result.fullpath, \"\\\\\")\nend\nreturn result\nend\nfunction premake.gettool(cfg)\nif premake.iscppproject(cfg) then\nif _OPTIONS.cc then\nreturn premake[_OPTIONS.cc]\nend\nlocal action = premake.action.current()\nif action.valid_tools then\nreturn premake[action.valid_tools.cc[1]]\nend\nreturn premake.gcc\nelse\nreturn premake.dotnet\nend\nend\nfunction premake.hascppproject(sln)\nfor prj in premake.solution.eachproject(sln) do\nif premake.iscppproject(prj) then\nreturn true\nend\nend\nend\nfunction premake.hasdotnetproject(sln)\nfor prj in premake.solution.eachproject(sln) do\nif premake.isdotnetproject(prj) then\nreturn true\nend\nend\nend\nfunction premake.iscppproject(prj)\nreturn (prj.language == \"C\" or prj.language == \"C++\")" "\nend\nfunction premake.isdotnetproject(prj)\nreturn (prj.language == \"C#\")\nend\nlocal function walksources(cfg, fn, group, nestlevel, finished)\nlocal grouplen = group:len()\nlocal gname = iif(group:endswith(\"/\"), group:sub(1, -2), group)\nif (nestlevel >= 0) then\nfn(cfg, gname, \"GroupStart\", nestlevel)\nend\nfor _,fname in ipairs(cfg.files) do\nif (fname:startswith(group)) then\nlocal _,split = fname:find(\"[^\\.]/\", grouplen + 1)\nif (split) then\nlocal subgroup = fname:sub(1, split)\nif (not finished[subgroup]) then\nfinished[subgroup] = true\nwalksources(cfg, fn, subgroup, nestlevel + 1, finished)\nend\nend\nend\nend\nfor _,fname in ipairs(cfg.files) do\nif (fname:startswith(group) and not fname:find(\"[^\\.]/\", grouplen + 1)) then\nfn(cfg, fname, \"GroupItem\", nestlevel + 1)\nend\nend\nif (nestlevel >= 0) then\nfn(cfg, gname, \"GroupEnd\", nestlevel)\nend\nend\nfunction premake.walksources(cfg, fn)\nwalksources(cfg, fn, \"\", -1, {})\nend\n", /* base/configs.lua */ "premake.config = { }\nfunction premake.config.isdebugbuild(cfg)\nif cfg.flags.Optimize or cfg.flags.OptimizeSize or cfg.flags.OptimizeSpeed then\nreturn false\nend\nif not cfg.flags.Symbols then\nreturn false\nend\nreturn true\nend\nlocal nocopy = \n{\nblocks = true,\nkeywords = true,\nprojects = true,\n__configs = true,\n}\nlocal nofixup =\n{\nbasedir = true,\nlocation = true,\n}\nfunction premake.getactiveterms()\nlocal terms = { _ACTION:lower(), os.get() }\nfor key, value in pairs(_OPTIONS) do\nif value ~= \"\" then\ntable.insert(terms, value:lower())\nelse\ntable.insert(terms, key:lower())\nend\nend\nreturn terms\nend\nfunction premake.iskeywordmatch(keyword, terms)\nif keyword:startswith(\"not \") then\nreturn not premake.iskeywordmatch(keyword:sub(5), terms)\nend\nfor _, pattern in ipairs(keyword:explode(\" or \")) do\nfor termkey, term in pairs(terms) do\nif term:match(pattern) == term then\nreturn termkey\nend\nend\nend\nend\nfunction premake.iskeywordsmatch(keywords, terms)\nlocal hasrequired = " "false\nfor _, keyword in ipairs(keywords) do\nlocal matched = premake.iskeywordmatch(keyword, terms)\nif not matched then\nreturn false\nend\nif matched == \"required\" then\nhasrequired = true\nend\nend\nif terms.required and not hasrequired then\nreturn false\nelse\nreturn true\nend\nend\nlocal function adjustpaths(location, obj)\nfor name, value in pairs(obj) do\nlocal field = premake.fields[name]\nif field and value and not nofixup[name] then\nif field.kind == \"path\" then\nobj[name] = path.getrelative(location, value) \nelseif field.kind == \"dirlist\" or field.kind == \"filelist\" then\nfor i, p in ipairs(value) do\nvalue[i] = path.getrelative(location, p) \nend\nend\nend\nend\nend\nlocal function mergeobject(dest, src)\nif not src then return end\nfor field, value in pairs(src) do\nif not nocopy[field] then\nif type(value) == \"table\" then\nlocal tbl = dest[field] or { }\nfor _, item in ipairs(value) do\nif not tbl[item] then\ntable.insert(tbl, item)\ntbl[item] = item\nend\nend\ndest[field] = tbl\nels" "e\ndest[field] = value\nend\nend\nend\nend\nlocal function merge(dest, obj, basis, terms, cfgname, pltname)\nlocal key = cfgname or \"\"\npltname = pltname or \"Native\"\nif pltname ~= \"Native\" then\nkey = key .. pltname\nend\nterms.config = (cfgname or \"\"):lower()\nterms.platform = pltname:lower()\nlocal cfg = {}\nmergeobject(cfg, basis[key])\nadjustpaths(obj.location, cfg)\nmergeobject(cfg, obj)\nfor _, blk in ipairs(obj.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, terms)) then\nmergeobject(cfg, blk)\nend\nend\ncfg.name = cfgname\ncfg.platform = pltname\ncfg.terms = terms\ndest[key] = cfg\nend\nlocal function collapse(obj, basis)\nlocal result = {}\nbasis = basis or {}\nlocal sln = obj.solution or obj\nlocal terms = premake.getactiveterms()\nmerge(result, obj, basis, terms)\nif result[\"\"].kind then\nterms.kind = result[\"\"].kind:lower()\nend\nfor _, cfgname in ipairs(sln.configurations) do\nmerge(result, obj, basis, terms, cfgname, \"Native\")\nfor _, pltname in ipairs(sln.platforms" " or {}) do\nif pltname ~= \"Native\" then\nmerge(result, obj, basis, terms, cfgname, pltname)\nend\nend\nend\nreturn result\nend\nlocal function postprocess(prj, cfg)\ncfg.project = prj\ncfg.shortname = premake.getconfigname(cfg.name, cfg.platform, true)\ncfg.longname = premake.getconfigname(cfg.name, cfg.platform)\ncfg.location = cfg.location or cfg.basedir\nlocal platform = premake.platforms[cfg.platform]\nif platform.iscrosscompiler then\ncfg.system = cfg.platform\nelse\ncfg.system = os.get()\nend\nif cfg.kind == \"SharedLib\" and platform.nosharedlibs then\ncfg.kind = \"StaticLib\"\nend\nlocal files = { }\nfor _, fname in ipairs(cfg.files) do\nlocal excluded = false\nfor _, exclude in ipairs(cfg.excludes) do\nexcluded = (fname == exclude)\nif (excluded) then break end\nend\nif (not excluded) then\ntable.insert(files, fname)\nend\nend\ncfg.files = files\nfor name, field in pairs(premake.fields) do\nif field.isflags then\nlocal values = cfg[name]\nfor _, flag in ipairs(values) do values[flag] = true end\n" "end\nend\ncfg.__fileconfigs = { }\nfor _, fname in ipairs(cfg.files) do\ncfg.terms.required = fname:lower()\nlocal fcfg = {}\nfor _, blk in ipairs(cfg.project.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, cfg.terms)) then\nmergeobject(fcfg, blk)\nend\nend\nfcfg.name = fname\ncfg.__fileconfigs[fname] = fcfg\ntable.insert(cfg.__fileconfigs, fcfg)\nend\nend\nlocal function builduniquedirs()\nlocal num_variations = 4\nlocal cfg_dirs = {}\nlocal hit_counts = {}\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dirs = { }\ndirs[1] = path.getabsolute(path.join(cfg.location, cfg.objdir or cfg.project.objdir or \"obj\"))\ndirs[2] = path.join(dirs[1], iif(cfg.platform == \"Native\", \"\", cfg.platform))\ndirs[3] = path.join(dirs[2], cfg.name)\ndirs[4] = path.join(dirs[3], cfg.project.name)\ncfg_dirs[cfg] = dirs\nlocal start = iif(cfg.name, 2, 1)\nfor v = start, num_variations do\nlocal d = dirs[v]\nhit_counts[d] = (hit_counts[d] or 0) + 1" "\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dir\nlocal start = iif(cfg.name, 2, 1)\nfor v = start, num_variations do\ndir = cfg_dirs[cfg][v]\nif hit_counts[dir] == 1 then break end\nend\ncfg.objectsdir = path.getrelative(cfg.location, dir)\nend\nend\nend\nend\nlocal function buildtargets()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal pathstyle = premake.getpathstyle(cfg)\nlocal namestyle = premake.getnamestyle(cfg)\ncfg.buildtarget = premake.gettarget(cfg, \"build\", pathstyle, namestyle, cfg.system)\ncfg.linktarget = premake.gettarget(cfg, \"link\", pathstyle, namestyle, cfg.system)\nif pathstyle == \"windows\" then\ncfg.objectsdir = path.translate(cfg.objectsdir, \"\\\\\")\nend\nend\nend\nend\nend\nfunction premake.buildconfigs()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nprj.location = prj.loc" "ation or sln.location or prj.basedir\nadjustpaths(prj.location, prj)\nfor _, blk in ipairs(prj.blocks) do\nadjustpaths(prj.location, blk)\nend\nend\nsln.location = sln.location or sln.basedir\nend\nfor sln in premake.solution.each() do\nlocal basis = collapse(sln)\nfor _, prj in ipairs(sln.projects) do\nprj.__configs = collapse(prj, basis)\nfor _, cfg in pairs(prj.__configs) do\npostprocess(prj, cfg)\nend\nend\nend\nbuilduniquedirs()\nbuildtargets(cfg)\nend\n", /* base/api.lua */ "premake.fields = \n{\nbasedir =\n{\nkind = \"path\",\nscope = \"container\",\n},\nbuildaction =\n{\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"Compile\",\n\"Copy\",\n\"Embed\",\n\"None\"\n}\n},\nbuildoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nconfigurations = \n{\nkind = \"list\",\nscope = \"solution\",\n},\ndefines =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndeploymentoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nexcludes =\n{\nkind = \"filelist\",\nscope = \"config\",\n},\nfiles =\n{\nkind = \"filelist\",\nscope = \"config\",\n},\nflags =\n{\nkind = \"list\",\nscope = \"config\",\nisflags = true,\nallowed = {\n\"EnableSSE\",\n\"EnableSSE2\",\n\"ExtraWarnings\",\n\"FatalWarnings\",\n\"FloatFast\",\n\"FloatStrict\",\n\"Managed\",\n\"MFC\",\n\"NativeWChar\",\n\"No64BitChecks\",\n\"NoEditAndContinue\",\n\"NoExceptions\",\n\"NoFramePointer\",\n\"NoImportLib\",\n\"NoManifest\",\n\"NoMinimalRebuild\",\n\"NoNativeWChar\",\n\"NoPCH\",\n\"NoRTTI\",\n\"Optimize\",\n\"" "OptimizeSize\",\n\"OptimizeSpeed\",\n\"SEH\",\n\"StaticRuntime\",\n\"Symbols\",\n\"Unicode\",\n\"Unsafe\",\n\"WinMain\"\n}\n},\nframework =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"1.0\",\n\"1.1\",\n\"2.0\",\n\"3.0\",\n\"3.5\",\n\"4.0\"\n}\n},\nimagepath = \n{\nkind = \"path\",\nscope = \"config\",\n},\nimageoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nimplibdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimplibextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibname =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibsuffix =\n{\nkind = \"string\",\nscope = \"config\",\n},\nincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nkind =\n{\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"ConsoleApp\",\n\"WindowedApp\",\n\"StaticLib\",\n\"SharedLib\"\n}\n},\nlanguage =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"C\",\n\"C++\",\n\"C#\"\n}\n},\nlibd" "irs =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nlinkoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nlinks =\n{\nkind = \"list\",\nscope = \"config\",\nallowed = function(value)\nif value:find('/', nil, true) then\nvalue = path.getabsolute(value)\nend\nreturn value\nend\n},\nlocation =\n{\nkind = \"path\",\nscope = \"container\",\n},\nobjdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\npchheader =\n{\nkind = \"string\",\nscope = \"config\",\n},\npchsource =\n{\nkind = \"path\",\nscope = \"config\",\n},\nplatforms = \n{\nkind = \"list\",\nscope = \"solution\",\nallowed = table.keys(premake.platforms),\n},\npostbuildcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nprebuildcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nprelinkcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nresdefines =\n{\nkind = \"list\",\nscope = \"config\",\n},\nresincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nresoptions =\n{\nkind = \"list\",\nscope = \"config\"" ",\n},\ntargetdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\ntargetextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetname =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetsuffix =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntrimpaths =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nuuid =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = function(value)\nlocal ok = true\nif (#value ~= 36) then ok = false end\nfor i=1,36 do\nlocal ch = value:sub(i,i)\nif (not ch:find(\"[ABCDEFabcdef0123456789-]\")) then ok = false end\nend\nif (value:sub(9,9) ~= \"-\") then ok = false end\nif (value:sub(14,14) ~= \"-\") then ok = false end\nif (value:sub(19,19) ~= \"-\") then ok = false end\nif (value:sub(24,24) ~= \"-\") then ok = false end\nif (not ok) then\nreturn nil, \"invalid UUID\"\nend\nreturn value:upper()\nend\n},\n}\nfunction premake.checkvalue(value, allowed)\nif (allowed) then\nif (type(allowed) == " "\"function\") then\nreturn allowed(value)\nelse\nfor _,v in ipairs(allowed) do\nif (value:lower() == v:lower()) then\nreturn v\nend\nend\nreturn nil, \"invalid value '\" .. value .. \"'\"\nend\nelse\nreturn value\nend\nend\nfunction premake.getobject(t)\nlocal container\nif (t == \"container\" or t == \"solution\") then\ncontainer = premake.CurrentContainer\nelse\ncontainer = premake.CurrentConfiguration\nend\nif t == \"solution\" then\nif type(container) == \"project\" then\ncontainer = container.solution\nend\nif type(container) ~= \"solution\" then\ncontainer = nil\nend\nend\nlocal msg\nif (not container) then\nif (t == \"container\") then\nmsg = \"no active solution or project\"\nelseif (t == \"solution\") then\nmsg = \"no active solution\"\nelse\nmsg = \"no active solution, project, or configuration\"\nend\nend\nreturn container, msg\nend\nfunction premake.setarray(ctype, fieldname, value, allowed)\nlocal container, err = premake.getobject(ctype)\nif (not container) then\nerror(err, 4)\nend\nif (not conta" "iner[fieldname]) then\ncontainer[fieldname] = { }\nend\nlocal function doinsert(value, depth)\nif (type(value) == \"table\") then\nfor _,v in ipairs(value) do\ndoinsert(v, depth + 1)\nend\nelse\nvalue, err = premake.checkvalue(value, allowed)\nif (not value) then\nerror(err, depth)\nend\ntable.insert(container[fieldname], value)\nend\nend\nif (value) then\ndoinsert(value, 5)\nend\nreturn container[fieldname]\nend\nlocal function domatchedarray(ctype, fieldname, value, matchfunc)\nlocal result = { }\nfunction makeabsolute(value, depth)\nif (type(value) == \"table\") then\nfor _, item in ipairs(value) do\nmakeabsolute(item, depth + 1)\nend\nelseif type(value) == \"string\" then\nif value:find(\"*\") then\nmakeabsolute(matchfunc(value), depth + 1)\nelse\ntable.insert(result, path.getabsolute(value))\nend\nelse\nerror(\"Invalid value in list: expected string, got \" .. type(value), depth)\nend\nend\nmakeabsolute(value, 3)\nreturn premake.setarray(ctype, fieldname, result)\nend\nfunction premake.setdirarray(ctype, " "fieldname, value)\nreturn domatchedarray(ctype, fieldname, value, os.matchdirs)\nend\nfunction premake.setfilearray(ctype, fieldname, value)\nreturn domatchedarray(ctype, fieldname, value, os.matchfiles)\nend\nfunction premake.setstring(ctype, fieldname, value, allowed)\nlocal container, err = premake.getobject(ctype)\nif (not container) then\nerror(err, 4)\nend\nif (value) then\nvalue, err = premake.checkvalue(value, allowed)\nif (not value) then \nerror(err, 4)\nend\ncontainer[fieldname] = value\nend\nreturn container[fieldname]\nend\nlocal function accessor(name, value)\nlocal kind = premake.fields[name].kind\nlocal scope = premake.fields[name].scope\nlocal allowed = premake.fields[name].allowed\nif ((kind == \"string\" or kind == \"path\") and value) then\nif type(value) ~= \"string\" then\nerror(\"string value expected\", 3)\nend\nend\nif (kind == \"string\") then\nreturn premake.setstring(scope, name, value, allowed)\nelseif (kind == \"path\") then\nif value then value = path.getabsolute(value) end" "\nreturn premake.setstring(scope, name, value)\nelseif (kind == \"list\") then\nreturn premake.setarray(scope, name, value, allowed)\nelseif (kind == \"dirlist\") then\nreturn premake.setdirarray(scope, name, value)\nelseif (kind == \"filelist\") then\nreturn premake.setfilearray(scope, name, value)\nend\nend\nfor name,_ in pairs(premake.fields) do\n_G[name] = function(value)\nreturn accessor(name, value)\nend\nend\nfunction configuration(terms)\nif not terms then\nreturn premake.CurrentConfiguration\nend\nlocal container, err = premake.getobject(\"container\")\nif (not container) then\nerror(err, 2)\nend\nlocal cfg = { }\ncfg.terms = table.flatten({terms})\ntable.insert(container.blocks, cfg)\npremake.CurrentConfiguration = cfg\ncfg.keywords = { }\nfor _, word in ipairs(cfg.terms) do\ntable.insert(cfg.keywords, path.wildcards(word):lower())\nend\nfor name, field in pairs(premake.fields) do\nif (field.kind ~= \"string\" and field.kind ~= \"path\") then\ncfg[name] = { }\nend\nend\nreturn cfg\nend\nfunction proj" "ect(name)\nif not name then\nreturn iif(type(premake.CurrentContainer) == \"project\", premake.CurrentContainer, nil)\nend\nlocal sln\nif (type(premake.CurrentContainer) == \"project\") then\nsln = premake.CurrentContainer.solution\nelse\nsln = premake.CurrentContainer\nend\nif (type(sln) ~= \"solution\") then\nerror(\"no active solution\", 2)\nend\npremake.CurrentContainer = sln.projects[name]\nif (not premake.CurrentContainer) then\nlocal prj = { }\npremake.CurrentContainer = prj\ntable.insert(sln.projects, prj)\nsln.projects[name] = prj\nsetmetatable(prj, {\n__type = \"project\",\n})\nprj.solution = sln\nprj.name = name\nprj.basedir = os.getcwd()\nprj.uuid = os.uuid()\nprj.blocks = { }\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction solution(name)\nif not name then\nif type(premake.CurrentContainer) == \"project\" then\nreturn premake.CurrentContainer.solution\nelse\nreturn premake.CurrentContainer\nend\nend\npremake.CurrentContainer = premake" ".solution.get(name)\nif (not premake.CurrentContainer) then\npremake.CurrentContainer = premake.solution.new(name)\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction newaction(a)\npremake.action.add(a)\nend\nfunction newoption(opt)\npremake.option.add(opt)\nend\n", /* base/cmdline.lua */ "newoption \n{\ntrigger = \"cc\",\nvalue = \"VALUE\",\ndescription = \"Choose a C/C++ compiler set\",\nallowed = {\n{ \"gcc\", \"GNU GCC (gcc/g++)\" },\n{ \"ow\", \"OpenWatcom\" },\n}\n}\nnewoption\n{\ntrigger = \"dotnet\",\nvalue = \"VALUE\",\ndescription = \"Choose a .NET compiler set\",\nallowed = {\n{ \"msnet\", \"Microsoft .NET (csc)\" },\n{ \"mono\", \"Novell Mono (mcs)\" },\n{ \"pnet\", \"Portable.NET (cscc)\" },\n}\n}\nnewoption\n{\ntrigger = \"file\",\nvalue = \"FILE\",\ndescription = \"Read FILE as a Premake script; default is 'premake4.lua'\"\n}\nnewoption\n{\ntrigger = \"help\",\ndescription = \"Display this information\"\n}\nnewoption\n{\ntrigger = \"os\",\nvalue = \"VALUE\",\ndescription = \"Generate files for a different operating system\",\nallowed = {\n{ \"bsd\", \"OpenBSD, NetBSD, or FreeBSD\" },\n{ \"linux\", \"Linux\" },\n{ \"macosx\", \"Apple Mac OS X\" },\n{ \"solaris\", \"Solaris\" },\n{ \"windows\", \"Microsoft W" "indows\" },\n}\n}\nnewoption\n{\ntrigger = \"platform\",\nvalue = \"VALUE\",\ndescription = \"Add target architecture (if supported by action)\",\nallowed = {\n{ \"x32\", \"32-bit\" },\n{ \"x64\", \"64-bit\" },\n{ \"universal\", \"Mac OS X Universal, 32- and 64-bit\" },\n{ \"universal32\", \"Mac OS X Universal, 32-bit only\" },\n{ \"universal64\", \"Mac OS X Universal, 64-bit only\" },\n{ \"ps3\", \"Playstation 3 (experimental)\" },\n{ \"xbox360\", \"Xbox 360 (experimental)\" },\n}\n}\nnewoption\n{\ntrigger = \"scripts\",\nvalue = \"path\",\ndescription = \"Search for additional scripts on the given path\"\n}\nnewoption\n{\ntrigger = \"version\",\ndescription = \"Display version information\"\n}\n", /* tools/dotnet.lua */ "premake.dotnet = { }\npremake.dotnet.namestyle = \"windows\"\nlocal flags =\n{\nFatalWarning = \"/warnaserror\",\nOptimize = \"/optimize\",\nOptimizeSize = \"/optimize\",\nOptimizeSpeed = \"/optimize\",\nSymbols = \"/debug\",\nUnsafe = \"/unsafe\"\n}\nfunction premake.dotnet.getbuildaction(fcfg)\nlocal ext = path.getextension(fcfg.name):lower()\nif fcfg.buildaction == \"Compile\" or ext == \".cs\" then\nreturn \"Compile\"\nelseif fcfg.buildaction == \"Embed\" or ext == \".resx\" then\nreturn \"EmbeddedResource\"\nelseif fcfg.buildaction == \"Copy\" or ext == \".asax\" or ext == \".aspx\" then\nreturn \"Content\"\nelse\nreturn \"None\"\nend\nend\nfunction premake.dotnet.getcompilervar(cfg)\nif (_OPTIONS.dotnet == \"msnet\") then\nreturn \"csc\"\nelseif (_OPTIONS.dotnet == \"mono\") then\nif (cfg.framework <= \"1.1\") then\nreturn \"mcs\"\nelseif (cfg.framework >= \"4.0\") then\nreturn \"dmcs\"\nelse \nreturn \"gmcs\"\nend\nelse\nreturn \"cscc\"\nend\nend\nfunction premake.dotnet.getfla" "gs(cfg)\nlocal result = table.translate(cfg.flags, flags)\nreturn result\nend\nfunction premake.dotnet.getkind(cfg)\nif (cfg.kind == \"ConsoleApp\") then\nreturn \"Exe\"\nelseif (cfg.kind == \"WindowedApp\") then\nreturn \"WinExe\"\nelseif (cfg.kind == \"SharedLib\") then\nreturn \"Library\"\nend\nend", /* tools/gcc.lua */ "premake.gcc = { }\npremake.gcc.cc = \"gcc\"\npremake.gcc.cxx = \"g++\"\npremake.gcc.ar = \"ar\"\nlocal cflags =\n{\nEnableSSE = \"-msse\",\nEnableSSE2 = \"-msse2\",\nExtraWarnings = \"-Wall\",\nFatalWarnings = \"-Werror\",\nFloatFast = \"-ffast-math\",\nFloatStrict = \"-ffloat-store\",\nNoFramePointer = \"-fomit-frame-pointer\",\nOptimize = \"-O2\",\nOptimizeSize = \"-Os\",\nOptimizeSpeed = \"-O3\",\nSymbols = \"-g\",\n}\nlocal cxxflags =\n{\nNoExceptions = \"-fno-exceptions\",\nNoRTTI = \"-fno-rtti\",\n}\npremake.gcc.platforms = \n{\nNative = { \ncppflags = \"-MMD -MP\",\n},\nx32 = { \ncppflags = \"-MMD -MP\",\nflags = \"-m32\",\nldflags = \"-L/usr/lib32\", \n},\nx64 = { \ncppflags = \"-MMD -MP\",\nflags = \"-m64\",\nldflags = \"-L/usr/lib64\",\n},\nUniversal = { \ncppflags = \"\",\nflags = \"-arch i386 -arch x86_64 -arch ppc -arch ppc64\",\n},\nUniversal32 = { \ncppflags = \"\",\nflags = \"-arch i386 -arch ppc\",\n},\nUniversal64 = { \ncpp" "flags = \"\",\nflags = \"-arch x86_64 -arch ppc64\",\n},\nPS3 = {\ncc = \"ppu-lv2-g++\",\ncxx = \"ppu-lv2-g++\",\nar = \"ppu-lv2-ar\",\ncppflags = \"-MMD -MP\",\n}\n}\nlocal platforms = premake.gcc.platforms\nfunction premake.gcc.getcppflags(cfg)\nlocal result = { }\ntable.insert(result, platforms[cfg.platform].cppflags)\nreturn result\nend\nfunction premake.gcc.getcflags(cfg)\nlocal result = table.translate(cfg.flags, cflags)\ntable.insert(result, platforms[cfg.platform].flags)\nif cfg.system ~= \"windows\" and cfg.kind == \"SharedLib\" then\ntable.insert(result, \"-fPIC\")\nend\nreturn result\nend\nfunction premake.gcc.getcxxflags(cfg)\nlocal result = table.translate(cfg.flags, cxxflags)\nreturn result\nend\nfunction premake.gcc.getldflags(cfg)\nlocal result = { }\nif not cfg.flags.Symbols then\nif cfg.system == \"macosx\" then\ntable.insert(result, \"-Wl,-x\")\nelse\ntable.insert(result, \"-s\")\nend\nend\nif cfg.kind == \"SharedLib\" then\nif cfg.system == \"macosx\" then\nresul" "t = table.join(result, { \"-dynamiclib\", \"-flat_namespace\" })\nelse\ntable.insert(result, \"-shared\")\nend\nif cfg.system == \"windows\" and not cfg.flags.NoImportLib then\ntable.insert(result, '-Wl,--out-implib=\"' .. cfg.linktarget.fullpath .. '\"')\nend\nend\nif cfg.kind == \"WindowedApp\" and cfg.system == \"windows\" then\ntable.insert(result, \"-mwindows\")\nend\nlocal platform = platforms[cfg.platform]\ntable.insert(result, platform.flags)\ntable.insert(result, platform.ldflags)\nreturn result\nend\nfunction premake.gcc.getlibdirflags(cfg)\nlocal result = { }\nfor _, value in ipairs(premake.getlinks(cfg, \"all\", \"directory\")) do\ntable.insert(result, '-L' .. _MAKE.esc(value))\nend\nreturn result\nend\nfunction premake.gcc.getlinkflags(cfg)\nlocal result = { }\nfor _, value in ipairs(premake.getlinks(cfg, \"all\", \"basename\")) do\nif path.getextension(value) == \".framework\" then\ntable.insert(result, '-framework ' .. _MAKE.esc(path.getbasename(value)))\nelse\ntable.insert(result, '-l' .. _MAKE" ".esc(value))\nend\nend\nreturn result\nend\nfunction premake.gcc.getdefines(defines)\nlocal result = { }\nfor _,def in ipairs(defines) do\ntable.insert(result, '-D' .. def)\nend\nreturn result\nend\nfunction premake.gcc.getincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-I\" .. _MAKE.esc(dir))\nend\nreturn result\nend\n", /* tools/msc.lua */ "premake.msc = { }\npremake.msc.namestyle = \"windows\"\n", /* tools/ow.lua */ "premake.ow = { }\npremake.ow.namestyle = \"windows\"\npremake.ow.cc = \"WCL386\"\npremake.ow.cxx = \"WCL386\"\npremake.ow.ar = \"ar\"\nlocal cflags =\n{\nExtraWarnings = \"-wx\",\nFatalWarning = \"-we\",\nFloatFast = \"-omn\",\nFloatStrict = \"-op\",\nOptimize = \"-ox\",\nOptimizeSize = \"-os\",\nOptimizeSpeed = \"-ot\",\nSymbols = \"-d2\",\n}\nlocal cxxflags =\n{\nNoExceptions = \"-xd\",\nNoRTTI = \"-xr\",\n}\npremake.ow.platforms = \n{\nNative = { \nflags = \"\" \n},\n}\nfunction premake.ow.getcppflags(cfg)\nreturn {}\nend\nfunction premake.ow.getcflags(cfg)\nlocal result = table.translate(cfg.flags, cflags)\nif (cfg.flags.Symbols) then\ntable.insert(result, \"-hw\") -- Watcom debug format for Watcom debugger\nend\nreturn result\nend\nfunction premake.ow.getcxxflags(cfg)\nlocal result = table.translate(cfg.flags, cxxflags)\nreturn result\nend\nfunction premake.ow.getldflags(cfg)\nlocal result = { }\nif (cfg.flags.Symbols) then\ntable.insert(result, \"op symf" "\")\nend\nreturn result\nend\nfunction premake.ow.getlinkflags(cfg)\nlocal result = { }\nreturn result\nend\nfunction premake.ow.getdefines(defines)\nlocal result = { }\nfor _,def in ipairs(defines) do\ntable.insert(result, '-D' .. def)\nend\nreturn result\nend\nfunction premake.ow.getincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, '-I \"' .. dir .. '\"')\nend\nreturn result\nend\n", /* base/validate.lua */ "function premake.checkprojects()\nlocal action = premake.action.current()\nfor sln in premake.solution.each() do\nif (#sln.projects == 0) then\nreturn nil, \"solution '\" .. sln.name .. \"' needs at least one project\"\nend\nif (#sln.configurations == 0) then\nreturn nil, \"solution '\" .. sln.name .. \"' needs configurations\"\nend\nfor prj in premake.solution.eachproject(sln) do\nif (not prj.language) then\nreturn nil, \"project '\" ..prj.name .. \"' needs a language\"\nend\nif (action.valid_languages) then\nif (not table.contains(action.valid_languages, prj.language)) then\nreturn nil, \"the \" .. action.shortname .. \" action does not support \" .. prj.language .. \" projects\"\nend\nend\nfor cfg in premake.eachconfig(prj) do\nif (not cfg.kind) then\nreturn nil, \"project '\" ..prj.name .. \"' needs a kind in configuration '\" .. cfg.name .. \"'\"\nend\nif (action.valid_kinds) then\nif (not table.contains(action.valid_kinds, cfg.kind)) then\nreturn nil, \"the \" .. action.shortname .. \" action does not su" "pport \" .. cfg.kind .. \" projects\"\nend\nend\nend\nif action.oncheckproject then\naction.oncheckproject(prj)\nend\nend\nend\nreturn true\nend\nfunction premake.checktools()\nlocal action = premake.action.current()\nif (not action.valid_tools) then \nreturn true \nend\nfor tool, values in pairs(action.valid_tools) do\nif (_OPTIONS[tool]) then\nif (not table.contains(values, _OPTIONS[tool])) then\nreturn nil, \"the \" .. action.shortname .. \" action does not support /\" .. tool .. \"=\" .. _OPTIONS[tool] .. \" (yet)\"\nend\nelse\n_OPTIONS[tool] = values[1]\nend\nend\nreturn true\nend\n", /* base/help.lua */ "function premake.showhelp()\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(\"\")\nprintf(\"OPTIONS\")\nprintf(\"\")\nfor option in premake.option.each() do\nlocal trigger = option.trigger\nlocal description = option.description\nif (option.value) then trigger = trigger .. \"=\" .. option.value end\nif (option.allowed) then description = description .. \"; one of:\" end\nprintf(\" --%-15s %s\", trigger, description) \nif (option.allowed) then\nfor _, value in ipairs(option.allowed) do\nprintf(\" %-14s %s\", value[1], value[2])\nend\nend\nprintf(\"\")\nend\nprintf(\"ACTIONS\")\nprintf(\"\")\nfor action in premake.action.each() do\nprintf(\" %-17s %s\", action.trigger, action.description)\nend\nprintf(\"\")\nprintf(\"For additional information, see http://industriousone.com/premake\")\nend\n", /* base/premake.lua */ "function premake.generate(obj, filename, callback)\nfilename = premake.project.getfilename(obj, filename)\nprintf(\"Generating %s...\", filename)\nlocal f, err = io.open(filename, \"wb\")\nif (not f) then\nerror(err, 0)\nend\nio.output(f)\ncallback(obj)\nf:close()\nend\n", /* actions/codeblocks/_codeblocks.lua */ "newaction {\ntrigger = \"codeblocks\",\nshortname = \"Code::Blocks\",\ndescription = \"Generate Code::Blocks project files\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\", \"ow\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.workspace\", premake.codeblocks_workspace)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.cbp\", premake.codeblocks_cbp)\nend,\noncleansolution = function(sln)\npremake.clean.file(sln, \"%%.workspace\")\nend,\noncleanproject = function(prj)\npremake.clean.file(prj, \"%%.cbp\")\npremake.clean.file(prj, \"%%.depend\")\npremake.clean.file(prj, \"%%.layout\")\nend\n}\n", /* actions/codeblocks/codeblocks_workspace.lua */ "function premake.codeblocks_workspace(sln)\n_p('')\n_p('')\n_p(1,'', sln.name)\nfor prj in premake.solution.eachproject(sln) do\nlocal fname = path.join(path.getrelative(sln.location, prj.location), prj.name)\nlocal active = iif(prj.project == sln.projects[1], ' active=\"1\"', '')\n_p(2,'', fname, active)\nfor _,dep in ipairs(premake.getdependencies(prj)) do\n_p(3,'', path.join(path.getrelative(sln.location, dep.location), dep.name))\nend\n_p(2,'')\nend\n_p(1,'')\n_p('')\nend\n", /* actions/codeblocks/codeblocks_cbp.lua */ "function premake.codeblocks_cbp(prj)\nlocal cc = premake.gettool(prj)\n_p('')\n_p('')\n_p(1,'')\n_p(1,'')\n_p(2,'')\n_p('')\n_p('')\nend\n", /* actions/codelite/_codelite.lua */ "newaction {\ntrigger = \"codelite\",\nshortname = \"CodeLite\",\ndescription = \"Generate CodeLite project files\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.workspace\", premake.codelite_workspace)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.project\", premake.codelite_project)\nend,\noncleansolution = function(sln)\npremake.clean.file(sln, \"%%.workspace\")\npremake.clean.file(sln, \"%%_wsp.mk\")\npremake.clean.file(sln, \"%%.tags\")\nend,\noncleanproject = function(prj)\npremake.clean.file(prj, \"%%.project\")\npremake.clean.file(prj, \"%%.mk\")\npremake.clean.file(prj, \"%%.list\")\npremake.clean.file(prj, \"%%.out\")\nend\n}\n", /* actions/codelite/codelite_workspace.lua */ "function premake.codelite_workspace(sln)\n_p('')\n_p('', premake.esc(sln.name), premake.esc(sln.name))\nfor i,prj in ipairs(sln.projects) do\nlocal name = premake.esc(prj.name)\nlocal fname = path.join(path.getrelative(sln.location, prj.location), prj.name)\nlocal active = iif(i==1, \"Yes\", \"No\")\n_p(' ', name, fname, active)\nend\nlocal platforms = premake.filterplatforms(sln, premake[_OPTIONS.cc].platforms, \"Native\")\nfor i = #platforms, 1, -1 do\nif premake.platforms[platforms[i]].iscrosscompiler then\ntable.remove(platforms, i)\nend\nend \n_p(' ')\nfor _, platform in ipairs(platforms) do\nfor _, cfgname in ipairs(sln.configurations) do\nlocal name = premake.getconfigname(cfgname, platform)\n_p(' ', name)\nfor _,prj in ipairs(sln.projects) do\n_p(' ', prj.name, name)\nend\n_p(' ')\nend\nend\n_p(' ')\n_p('')\nend\n", /* actions/codelite/codelite_project.lua */ "function premake.codelite_project(prj)\n_p('')\n_p('', premake.esc(prj.name))\npremake.walksources(prj, premake.codelite_files)\nlocal types = { \nConsoleApp = \"Executable\", \nWindowedApp = \"Executable\", \nStaticLib = \"Static Library\",\nSharedLib = \"Dynamic Library\",\n}\n_p(' ', types[prj.kind])\nlocal platforms = premake.filterplatforms(prj.solution, premake[_OPTIONS.cc].platforms, \"Native\")\nfor i = #platforms, 1, -1 do\nif premake.platforms[platforms[i]].iscrosscompiler then\ntable.remove(platforms, i)\nend\nend \nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\nlocal name = premake.esc(cfg.longname)\nlocal compiler = iif(cfg.language == \"C\", \"gcc\", \"g++\")\n_p(' ', name, compiler, types[cfg.kind])\nlocal fname = premake.esc(cfg.buildtarget.fullpath)\nloc" "al objdir = premake.esc(cfg.objectsdir)\nlocal runcmd = cfg.buildtarget.name\nlocal rundir = cfg.buildtarget.directory\nlocal pause = iif(cfg.kind == \"WindowedApp\", \"no\", \"yes\")\n_p(' ', fname, objdir, runcmd, rundir, pause)\nlocal flags = premake.esc(table.join(premake.gcc.getcflags(cfg), premake.gcc.getcxxflags(cfg), cfg.buildoptions))\n_p(' ', table.concat(flags, \";\"))\nfor _,v in ipairs(cfg.includedirs) do\n_p(' ', premake.esc(v))\nend\nfor _,v in ipairs(cfg.defines) do\n_p(' ', premake.esc(v))\nend\n_p(' ')\nflags = premake.esc(table.join(premake.gcc.getldflags(cfg), cfg.linkoptions))\n_p(' ', table.concat(flags, \";\"))\nfor _,v in ipairs(premake.getlinks(cfg, \"al" "l\", \"directory\")) do\n_p(' ', premake.esc(v))\nend\nfor _,v in ipairs(premake.getlinks(cfg, \"all\", \"basename\")) do\n_p(' ', premake.esc(v))\nend\n_p(' ')\nif premake.findfile(cfg, \".rc\") then\nlocal defines = table.implode(table.join(cfg.defines, cfg.resdefines), \"-D\", \";\", \"\")\nlocal options = table.concat(cfg.resoptions, \";\")\n_p(' ', defines, options)\nfor _,v in ipairs(table.join(cfg.includedirs, cfg.resincludedirs)) do\n_p(' ', premake.esc(v))\nend\n_p(' ')\nelse\n_p(' ')\nend\nif #cfg.prebuildcommands > 0 then\n_p(' ')\nfor _,v in ipairs(cfg.prebuildcommands) do\n_p(' %s', premake.esc(v))\nend\n_p(' ')\nend\nif #cfg.postbuildcommands > 0 then\n_p(' ')\nfor " "_,v in ipairs(cfg.postbuildcommands) do\n_p(' %s', premake.esc(v))\nend\n_p(' ')\nend\n_p(' ')\n_p(' ')\n_p(' ')\n_p(' ')\n_p(' ')\n_p(' None')\n_p(' ')\n_p(' ')\n_p(' ')\n_p(' ')\n_p(' ')\n_p(' ')\n_p(' ')\nend\nend\n_p(' ')\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\n_p(' ', cfg.longname)\nfor _,dep in ipairs(premake.getdependencies(prj)) do\n_p(' ', dep.name)\nend\n_p(' ')\nend\nend\n_p('')\nend\nfunction premake.codelite_files(prj, fname, state, nestlevel)\nlocal indent = string.rep(\" \", nestlevel + 1)\nif (state == \"GroupStart\") then\nio.write(indent .. '\\n')\nelseif (state == \"GroupEnd\") then\nio.write(indent .. '\\n')\nelse\nio.write(indent .. '\\n')\nend\nend\n", /* actions/make/_make.lua */ "_MAKE = { }\npremake.make = { }\nfunction _MAKE.esc(value)\nlocal result\nif (type(value) == \"table\") then\nresult = { }\nfor _,v in ipairs(value) do\ntable.insert(result, _MAKE.esc(v))\nend\nreturn result\nelse\nresult = value:gsub(\"\\\\\", \"\\\\\\\\\")\nresult = result:gsub(\" \", \"\\\\ \")\nresult = result:gsub(\"%(\", \"\\\\%(\")\nresult = result:gsub(\"%)\", \"\\\\%)\")\nresult = result:gsub(\"$\\\\%((.-)\\\\%)\", \"$%(%1%)\")\nreturn result\nend\nend\nfunction premake.make_copyrule(source, target)\n_p('%s: %s', target, source)\n_p('\\t@echo Copying $(notdir %s)', target)\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) cp -fR %s %s', source, target)\n_p('else')\n_p('\\t$(SILENT) copy /Y $(subst /,\\\\\\\\,%s) $(subst /,\\\\\\\\,%s)', source, target)\n_p('endif')\nend\nfunction premake.make_mkdirrule(var)\n_p('\\t@echo Creating %s', var)\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) mkdir -p %s', var)\n_p('else')\n_p('\\t$(SILENT) mkdir $(subst /,\\\\\\\\,%s)', var)\n_p('endif')\n_p('')\nend\n" "function _MAKE.getmakefilename(this, searchprjs)\nlocal count = 0\nfor sln in premake.solution.each() do\nif (sln.location == this.location) then count = count + 1 end\nif (searchprjs) then\nfor _,prj in ipairs(sln.projects) do\nif (prj.location == this.location) then count = count + 1 end\nend\nend\nend\nif (count == 1) then\nreturn \"Makefile\"\nelse\nreturn this.name .. \".make\"\nend\nend\nfunction _MAKE.getnames(tbl)\nlocal result = table.extract(tbl, \"name\")\nfor k,v in pairs(result) do\nresult[k] = _MAKE.esc(v)\nend\nreturn result\nend\nnewaction {\ntrigger = \"gmake\",\nshortname = \"GNU Make\",\ndescription = \"Generate GNU makefiles for POSIX, MinGW, and Cygwin\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"gcc\" },\ndotnet = { \"mono\", \"msnet\", \"pnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, _MAKE.getmakefilename(sln, false), premake.ma" "ke_solution)\nend,\nonproject = function(prj)\nlocal makefile = _MAKE.getmakefilename(prj, true)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, makefile, premake.make_csharp)\nelse\npremake.generate(prj, makefile, premake.make_cpp)\nend\nend,\noncleansolution = function(sln)\npremake.clean.file(sln, _MAKE.getmakefilename(sln, false))\nend,\noncleanproject = function(prj)\npremake.clean.file(prj, _MAKE.getmakefilename(prj, true))\nend\n}\n", /* actions/make/make_solution.lua */ "function premake.make_solution(sln)\nlocal cc = premake[_OPTIONS.cc]\nlocal platforms = premake.filterplatforms(sln, cc.platforms, \"Native\")\n_p('# %s solution makefile autogenerated by Premake', premake.action.current().shortname)\n_p('# Type \"make help\" for usage help')\n_p('')\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(sln.configurations[1], platforms[1], true)))\n_p('endif')\n_p('export config')\n_p('')\n_p('PROJECTS := %s', table.concat(_MAKE.esc(table.extract(sln.projects, \"name\")), \" \"))\n_p('')\n_p('.PHONY: all clean help $(PROJECTS)')\n_p('')\n_p('all: $(PROJECTS)')\n_p('')\nfor _, prj in ipairs(sln.projects) do\n_p('%s: %s', _MAKE.esc(prj.name), table.concat(_MAKE.esc(table.extract(premake.getdependencies(prj), \"name\")), \" \"))\n_p('\\t@echo \"==== Building %s ($(config)) ====\"', prj.name)\n_p('\\t@${MAKE} --no-print-directory -C %s -f %s', _MAKE.esc(path.getrelative(sln.location, prj.location)), _MAKE.esc(_MAKE.getmakefilename(prj, true)))\n_p('')\nend\n_p('c" "lean:')\nfor _ ,prj in ipairs(sln.projects) do\n_p('\\t@${MAKE} --no-print-directory -C %s -f %s clean', _MAKE.esc(path.getrelative(sln.location, prj.location)), _MAKE.esc(_MAKE.getmakefilename(prj, true)))\nend\n_p('')\n_p('help:')\n_p(1,'@echo \"Usage: make [config=name] [target]\"')\n_p(1,'@echo \"\"')\n_p(1,'@echo \"CONFIGURATIONS:\"')\nlocal cfgpairs = { }\nfor _, platform in ipairs(platforms) do\nfor _, cfgname in ipairs(sln.configurations) do\n_p(1,'@echo \" %s\"', premake.getconfigname(cfgname, platform, true))\nend\nend\n_p(1,'@echo \"\"')\n_p(1,'@echo \"TARGETS:\"')\n_p(1,'@echo \" all (default)\"')\n_p(1,'@echo \" clean\"')\nfor _, prj in ipairs(sln.projects) do\n_p(1,'@echo \" %s\"', prj.name)\nend\n_p(1,'@echo \"\"')\n_p(1,'@echo \"For more information, see http://industriousone.com/premake/quick-start\"')\nend\n", /* actions/make/make_cpp.lua */ "premake.make.cpp = { }\nlocal _ = premake.make.cpp\nfunction premake.make_cpp(prj)\nlocal cc = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\npremake.gmake_cpp_header(prj, cc, platforms)\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.gmake_cpp_config(cfg, cc)\nend\nend\n_p('OBJECTS := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.iscppfile(file) then\n_p('\\t$(OBJDIR)/%s.o \\\\', _MAKE.esc(path.getbasename(file)))\nend\nend\n_p('')\n \n_p('RESOURCES := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.isresourcefile(file) then\n_p('\\t$(OBJDIR)/%s.res \\\\', _MAKE.esc(path.getbasename(file)))\nend\nend\n_p('')\n \n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == " "\"WindowedApp\" then\n_p('all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist')\nelse\n_p('all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET)')\nend\n_p('\\t@:')\n_p('')\n_p('$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)')\n_p('\\t@echo Linking %s', prj.name)\n_p('\\t$(SILENT) $(LINKCMD)')\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIR):')\npremake.make_mkdirrule(\"$(OBJDIR)\")\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" then\n_p('$(dir $(TARGETDIR))PkgInfo:')\n_p('$(dir $(TARGETDIR))Info.plist:')\n_p('')\nend\n_p('clean:')\n_p('\\t@echo Cleaning %s', prj.name)\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')" "\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\n_.pchrules(prj)\nfor _, file in ipairs(prj.files) do\nif path.iscppfile(file) then\n_p('$(OBJDIR)/%s.o: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\n_p('\\t@echo $(notdir $<)')\nif (path.iscfile(file)) then\n_p('\\t$(SILENT) $(CC) $(CFLAGS) -o \"$@\" -c \"$<\"')\nelse\n_p('\\t$(SILENT) $(CXX) $(CXXFLAGS) -o \"$@\" -c \"$<\"')\nend\nelseif (path.getextension(file) == \".rc\") then\n_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\n_p('\\t@echo $(notdir $<)')\n_p('\\t$(SILENT) windres $< -O coff -o \"$@\" $(RESFLAGS)')\nend\nend\n_p('')\n_p('-include $(OBJECTS:%%.o=%%.d)')\nend\nfunction premake.gmake_cpp_header(prj, cc, platforms)\n_p('# %s project makefile autogenerated by Premake', premake.action.current().shortname)\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('" "endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('ifndef CC')\n_p(' CC = %s', cc.cc)\n_p('endif')\n_p('')\n_p('ifndef CXX')\n_p(' CXX = %s', cc.cxx)\n_p('endif')\n_p('')\n_p('ifndef AR')\n_p(' AR = %s', cc.ar)\n_p('endif')\n_p('')\nend\nfunction premake.gmake_cpp_config(cfg, cc)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\nlocal platform = cc.platforms[cfg.platform]\nif platform.cc then\n_p(' CC = %s', platform.cc)\nend\nif platform.cxx then\n_p(' CXX = %s', platform.cxx)\nend\nif platform.ar then\n_p(' AR = %s', platform.ar)\nend\n_p(' OBJDIR = %s', _MAKE.esc(cfg.objectsdir))\n_p(' TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory))\n_p(' TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p(' DEFINES += %s', table.concat(cc.getdefines(cfg.defines), \" \"))\n_p(' INCLUDES += %s', table.concat(cc.getincludedirs(cfg.includedirs), \" \"))\n_p(' CPPFLAGS += %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflag" "s(cfg), \" \"))\n_.pchconfig(cfg)\n_p(' CFLAGS += $(CPPFLAGS) $(ARCH) %s', table.concat(table.join(cc.getcflags(cfg), cfg.buildoptions), \" \"))\n_p(' CXXFLAGS += $(CFLAGS) %s', table.concat(cc.getcxxflags(cfg), \" \"))\n_p(' LDFLAGS += %s', table.concat(table.join(cc.getldflags(cfg), cfg.linkoptions, cc.getlibdirflags(cfg)), \" \"))\n_p(' LIBS += %s', table.concat(cc.getlinkflags(cfg), \" \"))\n_p(' RESFLAGS += $(DEFINES) $(INCLUDES) %s', table.concat(table.join(cc.getdefines(cfg.resdefines), cc.getincludedirs(cfg.resincludedirs), cfg.resoptions), \" \"))\n_p(' LDDEPS += %s', table.concat(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\")), \" \"))\nif cfg.kind == \"StaticLib\" then\nif cfg.platform:startswith(\"Universal\") then\n_p(' LINKCMD = libtool -o $(TARGET) $(OBJECTS)')\nelse\n_p(' LINKCMD = $(AR) -rcs $(TARGET) $(OBJECTS)')\nend\nelse\n_p(' LINKCMD = $(%s) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS)', iif(cfg.language == \"C\", \"CC\", \"" "CXX\"))\nend\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p('endif')\n_p('')\nend\nfunction _.pchconfig(cfg)\nif not cfg.flags.NoPCH and cfg.pchheader then\n_p(' PCH = %s', _MAKE.esc(path.getrelative(cfg.location, cfg.pchheader)))\n_p(' GCH = $(OBJDIR)/%s.gch', _MAKE.esc(path.getname(cfg.pchheader))) \n_p(' CPPFLAGS += -I$(OBJDIR) -include $(OBJDIR)/%s', _MAKE.esc(path.getname(cfg.pchheader)))\nend\nend\nfunction _.pchrules(prj)\n_p('ifneq (,$" "(PCH))')\n_p('$(GCH): $(PCH)')\n_p('\\t@echo $(notdir $<)')\n_p('\\t-$(SILENT) cp $< $(OBJDIR)')\nif prj.language == \"C\" then\n_p('\\t$(SILENT) $(CC) $(CFLAGS) -o \"$@\" -c \"$<\"')\nelse\n_p('\\t$(SILENT) $(CXX) $(CXXFLAGS) -o \"$@\" -c \"$<\"')\nend\n_p('endif')\n_p('')\nend\n", /* actions/make/make_csharp.lua */ "local function getresourcefilename(cfg, fname)\nif path.getextension(fname) == \".resx\" then\n local name = cfg.buildtarget.basename .. \".\"\n local dir = path.getdirectory(fname)\n if dir ~= \".\" then \nname = name .. path.translate(dir, \".\") .. \".\"\nend\nreturn \"$(OBJDIR)/\" .. _MAKE.esc(name .. path.getbasename(fname)) .. \".resources\"\nelse\nreturn fname\nend\nend\nfunction premake.make_csharp(prj)\nlocal csc = premake.dotnet\nlocal cfglibs = { }\nlocal cfgpairs = { }\nlocal anycfg\nfor cfg in premake.eachconfig(prj) do\nanycfg = cfg\ncfglibs[cfg] = premake.getlinks(cfg, \"siblings\", \"fullpath\")\ncfgpairs[cfg] = { }\nfor _, fname in ipairs(cfglibs[cfg]) do\nif path.getdirectory(fname) ~= cfg.buildtarget.directory then\ncfgpairs[cfg][\"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(fname))] = _MAKE.esc(fname)\nend\nend\nend\nlocal sources = {}\nlocal embedded = { }\nlocal copypairs = { }\nfor fcfg in premake.eachfile(prj) do\nlocal action = csc.getbuildaction(fcfg)\nif action == \"Compile\" " "then\ntable.insert(sources, fcfg.name)\nelseif action == \"EmbeddedResource\" then\ntable.insert(embedded, fcfg.name)\nelseif action == \"Content\" then\ncopypairs[\"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(fcfg.name))] = _MAKE.esc(fcfg.name)\nelseif path.getname(fcfg.name):lower() == \"app.config\" then\ncopypairs[\"$(TARGET).config\"] = _MAKE.esc(fcfg.name)\nend\nend\nlocal paths = table.translate(prj.libdirs, function(v) return path.join(prj.basedir, v) end)\npaths = table.join({prj.basedir}, paths)\nfor _, libname in ipairs(premake.getlinks(prj, \"system\", \"fullpath\")) do\nlocal libdir = os.pathsearch(libname..\".dll\", unpack(paths))\nif (libdir) then\nlocal target = \"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(libname))\nlocal source = path.getrelative(prj.basedir, path.join(libdir, libname))..\".dll\"\ncopypairs[target] = _MAKE.esc(source)\nend\nend\n_p('# %s project makefile autogenerated by Premake', premake.action.current().shortname)\n_p('')\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(prj.c" "onfigurations[1]:lower()))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('ifndef CSC')\n_p(' CSC=%s', csc.getcompilervar(prj))\n_p('endif')\n_p('')\n_p('ifndef RESGEN')\n_p(' RESGEN=resgen')\n_p('endif')\n_p('')\nlocal platforms = premake.filterplatforms(prj.solution, premake[_OPTIONS.cc].platforms)\ntable.insert(platforms, 1, \"\")\nfor cfg in premake.eachconfig(prj) do\npremake.gmake_cs_config(cfg, csc, cfglibs)\nend\n_p('# To maintain compatibility with VS.NET, these values must be set at the project level')\n_p('TARGET := $(TARGETDIR)/%s', _MAKE.esc(prj.buildtarget.name))\n_p('FLAGS += /t:%s %s', csc.getkind(prj):lower(), table.implode(_MAKE.esc(prj.libdirs), \"/lib:\", \"\", \" \"))\n_p('REFERENCES += %s', table.implode(_MAKE.esc(premake.getlinks(prj, \"system\", \"basename\")), \"/r:\", \".dll\", \" \"))\n_p('')\n_p('SOURCES := \\\\')\nfor _, fname in ipairs(sources) do\n_p('\\t%s \\\\', _MAKE.esc(path.translate(fname)))\nend\n_p('')\n_p('EMBEDFILES :=" " \\\\')\nfor _, fname in ipairs(embedded) do\n_p('\\t%s \\\\', getresourcefilename(prj, fname))\nend\n_p('')\n_p('COPYFILES += \\\\')\nfor target, source in pairs(cfgpairs[anycfg]) do\n_p('\\t%s \\\\', target)\nend\nfor target, source in pairs(copypairs) do\n_p('\\t%s \\\\', target)\nend\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\n_p('all: $(TARGETDIR) $(OBJDIR) prebuild $(EMBEDFILES) $(COPYFILES) prelink $(TARGET)')\n_p('')\n_p('$(TARGET): $(SOURCES) $(EMBEDFILES) $(DEPENDS)')\n_p('\\t$(SILENT) $(CSC) /nologo /out:$@ $(FLAGS) $(REFERENCES) $(SOURCES) $(patsubst %%,/resource:%%,$(EMBEDFILES))')\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIR):')\npremake.make_mkdirrule(\"$(OBJDIR)\")\n_p('clean:')\n_p('\\t@echo Cleaning %s', prj.name)\n_p('i" "feq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGETDIR)/%s.* $(COPYFILES)', prj.buildtarget.basename)\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGETDIR)/%s.*) del $(subst /,\\\\\\\\,$(TARGETDIR)/%s.*)', prj.buildtarget.basename, prj.buildtarget.basename)\nfor target, source in pairs(cfgpairs[anycfg]) do\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,%s) del $(subst /,\\\\\\\\,%s)', target, target)\nend\nfor target, source in pairs(copypairs) do\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,%s) del $(subst /,\\\\\\\\,%s)', target, target)\nend\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\n_p('# Per-configuration copied file rules')\nfor cfg in premake.eachconfig(prj) do\n_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))\nfor target, source in pairs(cfgpa" "irs[cfg]) do\npremake.make_copyrule(source, target)\nend\n_p('endif')\n_p('')\nend\n_p('# Copied file rules')\nfor target, source in pairs(copypairs) do\npremake.make_copyrule(source, target)\nend\n_p('# Embedded file rules')\nfor _, fname in ipairs(embedded) do \nif path.getextension(fname) == \".resx\" then\n_p('%s: %s', getresourcefilename(prj, fname), _MAKE.esc(fname))\n_p('\\t$(SILENT) $(RESGEN) $^ $@')\nend\n_p('')\nend\nend\nfunction premake.gmake_cs_config(cfg, csc, cfglibs)\n_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))\n_p(' TARGETDIR := %s', _MAKE.esc(cfg.buildtarget.directory))\n_p(' OBJDIR := %s', _MAKE.esc(cfg.objectsdir))\n_p(' DEPENDS := %s', table.concat(_MAKE.esc(premake.getlinks(cfg, \"dependencies\", \"fullpath\")), \" \"))\n_p(' REFERENCES := %s', table.implode(_MAKE.esc(cfglibs[cfg]), \"/r:\", \"\", \" \"))\n_p(' FLAGS += %s %s', table.implode(cfg.defines, \"/d:\", \"\", \" \"), table.concat(table.join(csc.getflags(cfg), cfg.buildoptions), \" \")" ")\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p('endif')\n_p('')\nend\n", /* actions/vstudio/_vstudio.lua */ "_VS = { } -- deprecated, will remove eventually\npremake.vstudio = { }\nlocal vstudio = premake.vstudio\npremake.vstudio_platforms = { \nany = \"Any CPU\", \nmixed = \"Mixed Platforms\", \nNative = \"Win32\",\nx32 = \"Win32\", \nx64 = \"x64\",\nPS3 = \"PS3\",\nXbox360 = \"Xbox 360\",\n}\nfunction _VS.arch(prj)\nif (prj.language == \"C#\") then\nif (_ACTION < \"vs2005\") then\nreturn \".NET\"\nelse\nreturn \"Any CPU\"\nend\nelse\nreturn \"Win32\"\nend\nend\nfunction _VS.bool(value)\nif (_ACTION < \"vs2005\") then\nreturn iif(value, \"TRUE\", \"FALSE\")\nelse\nreturn iif(value, \"true\", \"false\")\nend\nend\nfunction premake.vstudio_buildconfigs(sln)\nlocal cfgs = { }\nlocal platforms = premake.filterplatforms(sln, premake.vstudio_platforms, \"Native\")\nlocal hascpp = premake.hascppproject(sln)\nlocal hasdotnet = premake.hasdotnetproject(sln)\nif hasdotnet then\ntable.insert(platforms, 1, \"any\")\nend\nif hasdotnet and hascpp then\ntable.insert(platforms, 2, \"mixed\")\nend\nfor _, buil" "dcfg in ipairs(sln.configurations) do\nfor _, platform in ipairs(platforms) do\nlocal entry = { }\nentry.src_buildcfg = buildcfg\nentry.src_platform = platform\nif platform ~= \"PS3\" then\nentry.buildcfg = buildcfg\nentry.platform = premake.vstudio_platforms[platform]\nelse\nentry.buildcfg = platform .. \" \" .. buildcfg\nentry.platform = \"Win32\"\nend\nentry.name = entry.buildcfg .. \"|\" .. entry.platform\nentry.isreal = (platform ~= \"any\" and platform ~= \"mixed\")\ntable.insert(cfgs, entry)\nend\nend\nreturn cfgs\nend\nfunction _VS.cfgtype(cfg)\nif (cfg.kind == \"SharedLib\") then\nreturn 2\nelseif (cfg.kind == \"StaticLib\") then\nreturn 4\nelse\nreturn 1\nend\nend\nfunction premake.vstudio.cleansolution(sln)\npremake.clean.file(sln, \"%%.sln\")\npremake.clean.file(sln, \"%%.suo\")\npremake.clean.file(sln, \"%%.ncb\")\npremake.clean.file(sln, \"%%.userprefs\")\npremake.clean.file(sln, \"%%.usertasks\")\nend\nfunction premake.vstudio.cleanproject(prj)\nlocal fname = premake.project.getfilename(prj, \"%" "%\")\nos.remove(fname .. \".vcproj\")\nos.remove(fname .. \".vcproj.user\")\nos.remove(fname .. \".vcxproj\")\nos.remove(fname .. \".vcxproj.user\")\nos.remove(fname .. \".vcxproj.filters\")\nos.remove(fname .. \".csproj\")\nos.remove(fname .. \".csproj.user\")\nos.remove(fname .. \".pidb\")\nos.remove(fname .. \".sdf\")\nend\nfunction premake.vstudio.cleantarget(name)\nos.remove(name .. \".pdb\")\nos.remove(name .. \".idb\")\nos.remove(name .. \".ilk\")\nos.remove(name .. \".vshost.exe\")\nos.remove(name .. \".exe.manifest\")\nend\nlocal function output(indent, value)\n_p(indent .. value)\nend\nlocal function attrib(indent, name, value)\n_p(indent .. \"\\t\" .. name .. '=\"' .. value .. '\"')\nend\nfunction _VS.files(prj, fname, state, nestlevel)\nlocal indent = string.rep(\"\\t\", nestlevel + 2)\nif (state == \"GroupStart\") then\noutput(indent, \"\")\nelseif (state == \"GroupEnd\") then\noutput(" "indent, \"\")\nelse\noutput(indent, \"\")\nif (not prj.flags.NoPCH and prj.pchsource == fname) then\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nif cfginfo.isreal then\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\noutput(indent, \"\\t\")\noutput(indent, \"\\t\\t\")\noutput(indent, \"\\t\")\nend\nend\nend\noutput(indent, \"\")\nend\nend\nfunction _VS.optimization(cfg)\nlocal result = 0\nfor _, value in ipairs(cfg.flags) do\nif (value == \"Optimize\") then\nresult = 3\nelseif (value == \"OptimizeSize\") then\nresult = 1\nelseif (value == \"Optim" "izeSpeed\") then\nresult = 2\nend\nend\nreturn result\nend\nfunction _VS.projectfile(prj)\nlocal extension\nif (prj.language == \"C#\") then\nextension = \".csproj\"\nelseif (_ACTION == \"vs2010\" and prj.language == \"C++\" )then\nextension = \".vcxproj\"\nelseif (_ACTION == \"vs2010\" and prj.language == \"C\" )then\nextension = \".vcxproj\"\nelse\nextension = \".vcproj\"\nend\nlocal fname = path.join(prj.location, prj.name)\nreturn fname..extension\nend\nfunction _VS.tool(prj)\nif (prj.language == \"C#\") then\nreturn \"FAE04EC0-301F-11D3-BF4B-00C04F79EFBC\"\nelse\nreturn \"8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942\"\nend\nend\nnewaction {\ntrigger = \"vs2002\",\nshortname = \"Visual Studio 2002\",\ndescription = \"Generate Microsoft Visual Studio 2002 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"ms" "net\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs2002_solution)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", premake.vs2002_csproj)\npremake.generate(prj, \"%%.csproj.user\", premake.vs2002_csproj_user)\nelse\npremake.generate(prj, \"%%.vcproj\", premake.vs200x_vcproj)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget\n}\nnewaction {\ntrigger = \"vs2003\",\nshortname = \"Visual Studio 2003\",\ndescription = \"Generate Microsoft Visual Studio 2003 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs2003_solution)\nen" "d,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", premake.vs2002_csproj)\npremake.generate(prj, \"%%.csproj.user\", premake.vs2002_csproj_user)\nelse\npremake.generate(prj, \"%%.vcproj\", premake.vs200x_vcproj)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget\n}\nnewaction {\ntrigger = \"vs2005\",\nshortname = \"Visual Studio 2005\",\ndescription = \"Generate Microsoft Visual Studio 2005 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs2005_solution)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\"" ", premake.vs2005_csproj)\npremake.generate(prj, \"%%.csproj.user\", premake.vs2005_csproj_user)\nelse\npremake.generate(prj, \"%%.vcproj\", premake.vs200x_vcproj)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget\n}\nnewaction {\ntrigger = \"vs2008\",\nshortname = \"Visual Studio 2008\",\ndescription = \"Generate Microsoft Visual Studio 2008 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs2005_solution)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", premake.vs2005_csproj)\npremake.generate(prj, \"%%.csproj.user\", premake.vs2005_csproj_user)\nelse\np" "remake.generate(prj, \"%%.vcproj\", premake.vs200x_vcproj)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget\n}\nnewaction \n{\ntrigger = \"vs2010\",\nshortname = \"Visual Studio 2010\",\ndescription = \"Generate Visual Studio 2010 project files (experimental)\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C++\",\"C\"},\nvalid_tools = {\ncc = { \"msc\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs_generic_solution)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.vcxproj\", premake.vs2010_vcxproj)\npremake.generate(prj, \"%%.vcxproj.user\", premake.vs2010_vcxproj_user)\npremake.generate(prj, \"%%.vcxproj.filters\", premake.vs2010_vcxproj_filters)\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio." "cleanproject,\noncleantarget = premake.vstudio.cleantarget\n}", /* actions/vstudio/vs2002_solution.lua */ "function premake.vs2002_solution(sln)\nio.eol = '\\r\\n'\nsln.vstudio_configs = premake.vstudio_buildconfigs(sln)\n_p('Microsoft Visual Studio Solution File, Format Version 7.00')\nfor prj in premake.solution.eachproject(sln) do\nlocal projpath = path.translate(path.getrelative(sln.location, _VS.projectfile(prj)))\n_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"', _VS.tool(prj), prj.name, projpath, prj.uuid)\n_p('EndProject')\nend\n_p('Global')\n_p(1,'GlobalSection(SolutionConfiguration) = preSolution')\nfor i, cfgname in ipairs(sln.configurations) do\n_p(2,'ConfigName.%d = %s', i - 1, cfgname)\nend\n_p(1,'EndGlobalSection')\n_p(1,'GlobalSection(ProjectDependencies) = postSolution')\n_p(1,'EndGlobalSection')\n_p(1,'GlobalSection(ProjectConfiguration) = postSolution')\nfor prj in premake.solution.eachproject(sln) do\nfor _, cfgname in ipairs(sln.configurations) do\n_p(2,'{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfgname, cfgname, _VS.arch(prj))\n_p(2,'{%s}.%s.Build.0 = %s|%s', prj.uuid, cfgname, cfgname, _VS.arch(" "prj))\nend\nend\n_p(1,'EndGlobalSection')\n_p(1,'GlobalSection(ExtensibilityGlobals) = postSolution')\n_p(1,'EndGlobalSection')\n_p(1,'GlobalSection(ExtensibilityAddIns) = postSolution')\n_p(1,'EndGlobalSection')\n_p('EndGlobal')\nend\n", /* actions/vstudio/vs2002_csproj.lua */ "local function getelements(prj, action, fname)\nif action == \"Compile\" and fname:endswith(\".cs\") then\nreturn \"SubTypeCode\"\nend\nif action == \"EmbeddedResource\" and fname:endswith(\".resx\") then\nlocal basename = fname:sub(1, -6)\nlocal testname = path.getname(basename .. \".cs\")\nif premake.findfile(prj, testname) then\nreturn \"Dependency\", testname\nend\nend\nreturn \"None\"\nend\nfunction premake.vs2002_csproj(prj)\nio.eol = \"\\r\\n\"\n_p('')\n_p(1,'')\n_p(2,'')\n_p(3,'')\nfor cfg in premake.eachconfig(prj) do\n_p(4,'')\nend\n_p(3,'')\n_p(3,'')\nfor _, ref in ipairs(premake.getlinks(prj, \"siblings\", \"object\")) do\n_p(4,'')\nend\nfor _, linkname in ipairs(premake.getlinks(prj, \"system\", \"fullpath\")) do\n_p(4,'')\nend\n_p(3,'')\n_p(2,'')\n_p(2,'')\n_p(3,'')\nfor fcfg in premake.eachfile(prj) do\nlocal action = premake.dotnet.getbuildaction(fcfg)\nlocal fname = path.translate(premake.esc(fcfg.name), \"\\\\\")\nlocal elements, dependency = getelements(prj, action, fcfg.name)\n_p(4,'')\nend\n_p(3,'')\n_p(2,'')\n_p(1,'')\n_p('')\nend\n", /* actions/vstudio/vs2002_csproj_user.lua */ "function premake.vs2002_csproj_user(prj)\nio.eol = \"\\r\\n\"\n_p('')\n_p(1,'')\n_p(2,'')\nlocal refpaths = table.translate(prj.libdirs, function(v) return path.getabsolute(prj.location .. \"/\" .. v) end)\n_p(3,'', path.translate(table.concat(refpaths, \";\"), \"\\\\\"))\nfor cfg in premake.eachconfig(prj) do\n_p(4,'')\nend\n_p(3,'')\n_p(2,'')\n_p(2,'')\n_p(1,'')\n_p('')\nend\n", /* actions/vstudio/vs200x_vcproj.lua */ "premake.vstudio.vcproj = { }\nlocal vcproj = premake.vstudio.vcproj\nfunction vcproj.Configuration(name, cfg)\n_p(2,'')\nend\nfunction premake.vs200x_vcproj_platforms(prj)\nlocal used = { }\n_p(1,'')\nfor _, cfg in ipairs(prj.solution.vstudio_configs) do\nif cfg.isreal and not table.contains(used, cfg.platform) then\ntable.insert(used, cfg.platform)\n_p(2,'')\nend\nend\n_p(1,'')\nend\nfunction premake.vs200x_vcproj_symbols(cfg)\nif (not cfg.flags.Symbols) then\nreturn 0\nelse\nif cfg.flags.NoEditAndConti" "nue or \n _VS.optimization(cfg) ~= 0 or \n cfg.flags.Managed or \n cfg.platform == \"x64\" then\nreturn 3\nelse\nreturn 4\nend\nend\nend\nfunction premake.vs200x_vcproj_VCCLCompilerTool(cfg)\n_p(3,' 0 then\n_p(4,'AdditionalOptions=\"%s\"', table.concat(premake.esc(cfg.buildoptions), \" \"))\nend\n_p(4,'Optimization=\"%s\"', _VS.optimization(cfg))\nif cfg.flags.NoFramePointer then\n_p(4,'OmitFramePointers=\"%s\"', _VS.bool(true))\nend\nif #cfg.includedirs > 0 then\n_p(4,'AdditionalIncludeDirectories=\"%s\"', premake.esc(path.translate(table.concat(cfg.includedirs, \";\"), '\\\\')))\nend\nif #cfg.defines > 0 then\n_p(4,'PreprocessorDefinitions=\"%s\"', premake.esc(table.concat(cfg.defines, \";\")))\nend\nif premake.config.isdebugbuild(cfg) and not cfg.flags.NoMinimalRebuild and not cfg.flags.Managed then\n_p(4,'MinimalRebuild=\"%s\"', _VS.bool(true))\nend\nif cfg.flags.NoExc" "eptions then\n_p(4,'ExceptionHandling=\"%s\"', iif(_ACTION < \"vs2005\", \"FALSE\", 0))\nelseif cfg.flags.SEH and _ACTION > \"vs2003\" then\n_p(4,'ExceptionHandling=\"2\"')\nend\nif _VS.optimization(cfg) == 0 and not cfg.flags.Managed then\n_p(4,'BasicRuntimeChecks=\"3\"')\nend\nif _VS.optimization(cfg) ~= 0 then\n_p(4,'StringPooling=\"%s\"', _VS.bool(true))\nend\nlocal runtime\nif premake.config.isdebugbuild(cfg) then\nruntime = iif(cfg.flags.StaticRuntime, 1, 3)\nelse\nruntime = iif(cfg.flags.StaticRuntime, 0, 2)\nend\n_p(4,'RuntimeLibrary=\"%s\"', runtime)\n_p(4,'EnableFunctionLevelLinking=\"%s\"', _VS.bool(true))\nif _ACTION > \"vs2003\" and cfg.platform ~= \"Xbox360\" and cfg.platform ~= \"x64\" then\nif cfg.flags.EnableSSE then\n_p(4,'EnableEnhancedInstructionSet=\"1\"')\nelseif cfg.flags.EnableSSE2 then\n_p(4,'EnableEnhancedInstructionSet=\"2\"')\nend\nend\nif _ACTION < \"vs2005\" then\nif cfg.flags.FloatFast then\n_p(4,'ImproveFloatingPointConsistency=\"%s\"', _VS.bool(false))\nelseif cfg.flags.FloatSt" "rict then\n_p(4,'ImproveFloatingPointConsistency=\"%s\"', _VS.bool(true))\nend\nelse\nif cfg.flags.FloatFast then\n_p(4,'FloatingPointModel=\"2\"')\nelseif cfg.flags.FloatStrict then\n_p(4,'FloatingPointModel=\"1\"')\nend\nend\nif _ACTION < \"vs2005\" and not cfg.flags.NoRTTI then\n_p(4,'RuntimeTypeInfo=\"%s\"', _VS.bool(true))\nelseif _ACTION > \"vs2003\" and cfg.flags.NoRTTI then\n_p(4,'RuntimeTypeInfo=\"%s\"', _VS.bool(false))\nend\nif cfg.flags.NativeWChar then\n_p(4,'TreatWChar_tAsBuiltInType=\"%s\"', _VS.bool(true))\nelseif cfg.flags.NoNativeWChar then\n_p(4,'TreatWChar_tAsBuiltInType=\"%s\"', _VS.bool(false))\nend\nif not cfg.flags.NoPCH and cfg.pchheader then\n_p(4,'UsePrecompiledHeader=\"%s\"', iif(_ACTION < \"vs2005\", 3, 2))\n_p(4,'PrecompiledHeaderThrough=\"%s\"', path.getname(cfg.pchheader))\nelse\n_p(4,'UsePrecompiledHeader=\"%s\"', iif(_ACTION > \"vs2003\" or cfg.flags.NoPCH, 0, 2))\nend\n_p(4,'WarningLevel=\"%s\"', iif(cfg.flags.ExtraWarnings, 4, 3))\nif cfg.flags.FatalWarnings then\n_p(4,'Warn" "AsError=\"%s\"', _VS.bool(true))\nend\nif _ACTION < \"vs2008\" and not cfg.flags.Managed then\n_p(4,'Detect64BitPortabilityProblems=\"%s\"', _VS.bool(not cfg.flags.No64BitChecks))\nend\n_p(4,'ProgramDataBaseFileName=\"$(OutDir)\\\\%s.pdb\"', path.getbasename(cfg.buildtarget.name))\n_p(4,'DebugInformationFormat=\"%s\"', premake.vs200x_vcproj_symbols(cfg))\nif cfg.language == \"C\" then\n_p(4, 'CompileAs=\"1\"')\nend\n_p(3,'/>')\nend\nfunction premake.vs200x_vcproj_VCLinkerTool(cfg)\n_p(3,' 0 then\n_p(4,'AdditionalOptions=\"%s\"', table.concat(premake.esc(cfg.linkoptions), \" \"))\nend\nif #cfg.links > 0 then\n_p(4,'AdditionalDependencies=\"%s\"', table.concat(premake.getlinks(cfg, \"all\", \"fullpath\"), \" \"))\nend\n_p(4,'OutputFile=\"$(OutDir)\\\\%s\"', cfg.buildta" "rget.name)\n_p(4,'LinkIncremental=\"%s\"', iif(_VS.optimization(cfg) == 0, 2, 1))\n_p(4,'AdditionalLibraryDirectories=\"%s\"', table.concat(premake.esc(path.translate(cfg.libdirs, '\\\\')) , \";\"))\nlocal deffile = premake.findfile(cfg, \".def\")\nif deffile then\n_p(4,'ModuleDefinitionFile=\"%s\"', deffile)\nend\nif cfg.flags.NoManifest then\n_p(4,'GenerateManifest=\"%s\"', _VS.bool(false))\nend\n_p(4,'GenerateDebugInformation=\"%s\"', _VS.bool(premake.vs200x_vcproj_symbols(cfg) ~= 0))\nif premake.vs200x_vcproj_symbols(cfg) ~= 0 then\n_p(4,'ProgramDataBaseFileName=\"$(OutDir)\\\\%s.pdb\"', path.getbasename(cfg.buildtarget.name))\nend\n_p(4,'SubSystem=\"%s\"', iif(cfg.kind == \"ConsoleApp\", 1, 2))\nif _VS.optimization(cfg) ~= 0 then\n_p(4,'OptimizeReferences=\"2\"')\n_p(4,'EnableCOMDATFolding=\"2\"')\nend\nif (cfg.kind == \"ConsoleApp\" or cfg.kind == \"WindowedApp\") and not cfg.flags.WinMain then\n_p(4,'EntryPointSymbol=\"mainCRTStartup\"')\nend\nif cfg.kind == \"SharedLib\" then\nlocal implibname = cfg.li" "nktarget.fullpath\n_p(4,'ImportLibrary=\"%s\"', iif(cfg.flags.NoImportLib, cfg.objectsdir .. \"\\\\\" .. path.getname(implibname), implibname))\nend\n_p(4,'TargetMachine=\"%d\"', iif(cfg.platform == \"x64\", 17, 1))\nelse\n_p(4,'Name=\"VCLibrarianTool\"')\nif #cfg.links > 0 then\n_p(4,'AdditionalDependencies=\"%s\"', table.concat(premake.getlinks(cfg, \"all\", \"fullpath\"), \" \"))\nend\n_p(4,'OutputFile=\"$(OutDir)\\\\%s\"', cfg.buildtarget.name)\nif #cfg.libdirs > 0 then\n_p(4,'AdditionalLibraryDirectories=\"%s\"', premake.esc(path.translate(table.concat(cfg.libdirs , \";\"))))\nend\nif #cfg.linkoptions > 0 then\n_p(4,'AdditionalOptions=\"%s\"', table.concat(premake.esc(cfg.linkoptions), \" \"))\nend\nend\n_p(3,'/>')\nend\nfunction premake.vs200x_vcproj_VCCLCompilerTool_GCC(cfg)\n_p(3,' 0 then\n_p(4,'AdditionalOptions=\"%s\"', premake.esc(" "table.concat(buildoptions, \" \")))\nend\nif #cfg.includedirs > 0 then\n_p(4,'AdditionalIncludeDirectories=\"%s\"', premake.esc(path.translate(table.concat(cfg.includedirs, \";\"), '\\\\')))\nend\nif #cfg.defines > 0 then\n_p(4,'PreprocessorDefinitions=\"%s\"', table.concat(premake.esc(cfg.defines), \";\"))\nend\n_p(4,'ProgramDataBaseFileName=\"$(OutDir)\\\\%s.pdb\"', path.getbasename(cfg.buildtarget.name))\n_p(4,'DebugInformationFormat=\"0\"')\n_p(4,'CompileAs=\"0\"')\n_p(3,'/>')\nend\nfunction premake.vs200x_vcproj_VCLinkerTool_GCC(cfg)\n_p(3,' 0 then\n_p(4,'AdditionalOptions=\"%s\"', premake.esc(table.concat(buildoptions, \" \")))\nend\nif #cfg.links > 0 then\n_p(4,'AdditionalDependencies=\"%s\"', table.concat(premake.getlinks(cfg, \"all\", \"fullpath\"), \" \"))\nend\n_p(4,'OutputFile=\"$(OutDir)\\\\%s\"', cfg.buildtarget.name)\n_p(4,'Li" "nkIncremental=\"0\"')\n_p(4,'AdditionalLibraryDirectories=\"%s\"', table.concat(premake.esc(path.translate(cfg.libdirs, '\\\\')) , \";\"))\n_p(4,'GenerateManifest=\"%s\"', _VS.bool(false))\n_p(4,'ProgramDatabaseFile=\"\"')\n_p(4,'RandomizedBaseAddress=\"1\"')\n_p(4,'DataExecutionPrevention=\"0\"')\nelse\n_p(4,'Name=\"VCLibrarianTool\"')\nlocal buildoptions = table.join(premake.gcc.getldflags(cfg), cfg.linkoptions)\nif #buildoptions > 0 then\n_p(4,'AdditionalOptions=\"%s\"', premake.esc(table.concat(buildoptions, \" \")))\nend\nif #cfg.links > 0 then\n_p(4,'AdditionalDependencies=\"%s\"', table.concat(premake.getlinks(cfg, \"all\", \"fullpath\"), \" \"))\nend\n_p(4,'OutputFile=\"$(OutDir)\\\\%s\"', cfg.buildtarget.name)\nif #cfg.libdirs > 0 then\n_p(4,'AdditionalLibraryDirectories=\"%s\"', premake.esc(path.translate(table.concat(cfg.libdirs , \";\"))))\nend\nend\n_p(3,'/>')\nend\nfunction premake.vs200x_vcproj_VCResourceCompilerTool(cfg)\n_p(3,' 0 then\n_p(4,'AdditionalOptions=\"%s\"', table.concat(premake.esc(cfg.resoptions), \" \"))\nend\nif #cfg.defines > 0 or #cfg.resdefines > 0 then\n_p(4,'PreprocessorDefinitions=\"%s\"', table.concat(premake.esc(table.join(cfg.defines, cfg.resdefines)), \";\"))\nend\nif #cfg.includedirs > 0 or #cfg.resincludedirs > 0 then\nlocal dirs = table.join(cfg.includedirs, cfg.resincludedirs)\n_p(4,'AdditionalIncludeDirectories=\"%s\"', premake.esc(path.translate(table.concat(dirs, \";\"), '\\\\')))\nend\n_p(3,'/>')\nend\nfunction premake.vs200x_vcproj_VCManifestTool(cfg)\nlocal manifests = { }\nfor _, fname in ipairs(cfg.files) do\nif path.getextension(fname) == \".manifest\" then\ntable.insert(manifests, fname)\nend\nend\n_p(3,' 0 then\n_p(4,'AdditionalManifestFiles=\"%s\"', premake.esc(table.concat(manifests, \";\")))\nend\n_p(3,'/>')\nend\nfunction premake.vs200x_vcproj_VCMIDLTool(cfg)\n_p(3,'')\nend\nfunction premake.vs200x_vcproj_buildstepsblock(name, steps)\n_p(3,' 0 then\n_p(4,'CommandLine=\"%s\"', premake.esc(table.implode(steps, \"\", \"\", \"\\r\\n\")))\nend\n_p(3,'/>')\nend\nlocal blockmap = \n{\nVCCLCompilerTool = premake.vs200x_vcproj_VCCLCompilerTool,\nVCCLCompilerTool_GCC = premake.vs200x_vcproj_VCCLCompilerTool_GCC,\nVCLinkerTool = premake.vs200x_vcproj_VCLinkerTool,\nVCLinkerTool_GCC = premake.vs200x_vcproj_VCLinkerTool_GCC,\nVCManifestTool = premake.vs200x_vcproj_VCManifestTool,\nVCMIDLTool = premake.vs200x_vcproj_VCMIDLTool,\nVCResourceCompilerTool = premake.vs200x_vcproj_VCResourceCompilerTool,\n}\nlocal function getsections(version, platform)\nif version == \"vs2002\" then\nreturn {\n\"VCCLCompilerTool\",\n\"VCCustomBuildTool\",\n\"VCLinkerTool\",\n\"VCMIDLTool\",\n\"VCPostBuildEventTool\",\n\"VCPreBuildEventTool\",\n\"VCPreLinkEventTool\"," "\n\"VCResourceCompilerTool\",\n\"VCWebServiceProxyGeneratorTool\",\n\"VCWebDeploymentTool\"\n}\nend\nif version == \"vs2003\" then\nreturn {\n\"VCCLCompilerTool\",\n\"VCCustomBuildTool\",\n\"VCLinkerTool\",\n\"VCMIDLTool\",\n\"VCPostBuildEventTool\",\n\"VCPreBuildEventTool\",\n\"VCPreLinkEventTool\",\n\"VCResourceCompilerTool\",\n\"VCWebServiceProxyGeneratorTool\",\n\"VCXMLDataGeneratorTool\",\n\"VCWebDeploymentTool\",\n\"VCManagedWrapperGeneratorTool\",\n\"VCAuxiliaryManagedWrapperGeneratorTool\"\n}\nend\nif platform == \"Xbox360\" then\nreturn {\n\"VCPreBuildEventTool\",\n\"VCCustomBuildTool\",\n\"VCXMLDataGeneratorTool\",\n\"VCWebServiceProxyGeneratorTool\",\n\"VCMIDLTool\",\n\"VCCLCompilerTool\",\n\"VCManagedResourceCompilerTool\",\n\"VCResourceCompilerTool\",\n\"VCPreLinkEventTool\",\n\"VCLinkerTool\",\n\"VCALinkTool\",\n\"VCX360ImageTool\",\n\"VCBscMakeTool\",\n\"VCX360DeploymentTool\",\n\"VCPostBuildEventTool\",\n\"DebuggerTool\",\n}\nend\nif platform == \"PS3\" then\nreturn {\n\"VCPreBuildEventTool\"," "\n\"VCCustomBuildTool\",\n\"VCXMLDataGeneratorTool\",\n\"VCWebServiceProxyGeneratorTool\",\n\"VCMIDLTool\",\n\"VCCLCompilerTool_GCC\",\n\"VCManagedResourceCompilerTool\",\n\"VCResourceCompilerTool\",\n\"VCPreLinkEventTool\",\n\"VCLinkerTool_GCC\",\n\"VCALinkTool\",\n\"VCManifestTool\",\n\"VCXDCMakeTool\",\n\"VCBscMakeTool\",\n\"VCFxCopTool\",\n\"VCAppVerifierTool\",\n\"VCWebDeploymentTool\",\n\"VCPostBuildEventTool\"\n}\nelse\nreturn {\n\"VCPreBuildEventTool\",\n\"VCCustomBuildTool\",\n\"VCXMLDataGeneratorTool\",\n\"VCWebServiceProxyGeneratorTool\",\n\"VCMIDLTool\",\n\"VCCLCompilerTool\",\n\"VCManagedResourceCompilerTool\",\n\"VCResourceCompilerTool\",\n\"VCPreLinkEventTool\",\n\"VCLinkerTool\",\n\"VCALinkTool\",\n\"VCManifestTool\",\n\"VCXDCMakeTool\",\n\"VCBscMakeTool\",\n\"VCFxCopTool\",\n\"VCAppVerifierTool\",\n\"VCWebDeploymentTool\",\n\"VCPostBuildEventTool\"\n}\nend\nend\nfunction premake.vs200x_vcproj(prj)\nio.eol = \"\\r\\n\"\n_p('')\n_p(' \"vs2003\" then\n_p(1,'RootNamespace=\"%s\"', prj.name)\nend\n_p(1,'Keyword=\"%s\"', iif(prj.flags.Managed, \"ManagedCProj\", \"Win32Proj\"))\n_p(1,'>')\npremake.vs200x_vcproj_platforms(prj)\nif _ACTION > \"vs2003\" then\n_p(1,'')\n_p(1,'')\nend\n_p(1,'')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nif cfginfo.isreal then\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nvcproj.Configuration(cfginfo.name, cfg)\nfor _, block in ipairs(getsections(_ACTION, cfginfo.src_platform)) do\nif blockmap[block] then\nblockmap[block](cfg)\nelseif block == \"V" "CPreBuildEventTool\" then\npremake.vs200x_vcproj_buildstepsblock(\"VCPreBuildEventTool\", cfg.prebuildcommands)\nelseif block == \"VCPreLinkEventTool\" then\npremake.vs200x_vcproj_buildstepsblock(\"VCPreLinkEventTool\", cfg.prelinkcommands)\nelseif block == \"VCPostBuildEventTool\" then\npremake.vs200x_vcproj_buildstepsblock(\"VCPostBuildEventTool\", cfg.postbuildcommands)\nelseif block == \"VCX360DeploymentTool\" then\n_p(3,' 0 then\n_p(4,'AdditionalOptions=\"%s\"', table.concat(premake.esc(cfg.deploymentoptions), \" \"))\nend\n_p(3,'/>')\nelseif block == \"VCX360ImageTool\" then\n_p(3,' 0 then\n_p(4,'AdditionalOptions=\"%s\"', table.concat(premake.esc(cfg.imageoptions), \" \"))\nend\nif cfg.imagepath ~= nil then\n_p(4,'OutputFileName=\"%s\"', premake.esc(path.translate(cfg.imagepath)))\nend\n_p(3,'/>')\nelseif block == \"DebuggerTool\" then" "\n_p(3,'')\nelse\n_p(3,'')\nend\nend\n_p(2,'')\nend\nend\n_p(1,'')\n_p(1,'')\n_p(1,'')\n_p(1,'')\npremake.walksources(prj, _VS.files)\n_p(1,'')\n_p(1,'')\n_p(1,'')\n_p('')\nend\n", /* actions/vstudio/vs2003_solution.lua */ "function premake.vs2003_solution(sln)\nio.eol = '\\r\\n'\nsln.vstudio_configs = premake.vstudio_buildconfigs(sln)\n_p('Microsoft Visual Studio Solution File, Format Version 8.00')\nfor prj in premake.solution.eachproject(sln) do\nlocal projpath = path.translate(path.getrelative(sln.location, _VS.projectfile(prj)))\n_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"', _VS.tool(prj), prj.name, projpath, prj.uuid)\nlocal deps = premake.getdependencies(prj)\nif #deps > 0 then\n_p('\\tProjectSection(ProjectDependencies) = postProject')\nfor _, dep in ipairs(deps) do\n_p('\\t\\t{%s} = {%s}', dep.uuid, dep.uuid)\nend\n_p('\\tEndProjectSection')\nend\n_p('EndProject')\nend\n_p('Global')\n_p('\\tGlobalSection(SolutionConfiguration) = preSolution')\nfor _, cfgname in ipairs(sln.configurations) do\n_p('\\t\\t%s = %s', cfgname, cfgname)\nend\n_p('\\tEndGlobalSection')\n_p('\\tGlobalSection(ProjectDependencies) = postSolution')\n_p('\\tEndGlobalSection')\n_p('\\tGlobalSection(ProjectConfiguration) = postSolution')\nfor prj i" "n premake.solution.eachproject(sln) do\nfor _, cfgname in ipairs(sln.configurations) do\n_p('\\t\\t{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfgname, cfgname, _VS.arch(prj))\n_p('\\t\\t{%s}.%s.Build.0 = %s|%s', prj.uuid, cfgname, cfgname, _VS.arch(prj))\nend\nend\n_p('\\tEndGlobalSection')\n_p('\\tGlobalSection(ExtensibilityGlobals) = postSolution')\n_p('\\tEndGlobalSection')\n_p('\\tGlobalSection(ExtensibilityAddIns) = postSolution')\n_p('\\tEndGlobalSection')\n_p('EndGlobal')\nend\n", /* actions/vstudio/vs2005_solution.lua */ "function premake.vs2005_solution(sln)\nio.eol = '\\r\\n'\nsln.vstudio_configs = premake.vstudio_buildconfigs(sln)\n_p('\\239\\187\\191')\n_p('Microsoft Visual Studio Solution File, Format Version %s', iif(_ACTION == 'vs2005', '9.00', '10.00'))\n_p('# Visual Studio %s', iif(_ACTION == 'vs2005', '2005', '2008'))\nfor prj in premake.solution.eachproject(sln) do\nlocal projpath = path.translate(path.getrelative(sln.location, _VS.projectfile(prj)), \"\\\\\")\n_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"', _VS.tool(prj), prj.name, projpath, prj.uuid)\nlocal deps = premake.getdependencies(prj)\nif #deps > 0 then\n_p('\\tProjectSection(ProjectDependencies) = postProject')\nfor _, dep in ipairs(deps) do\n_p('\\t\\t{%s} = {%s}', dep.uuid, dep.uuid)\nend\n_p('\\tEndProjectSection')\nend\n_p('EndProject')\nend\n_p('Global')\npremake.vs2005_solution_platforms(sln)\npremake.vs2005_solution_project_platforms(sln)\npremake.vs2005_solution_properties(sln)\n_p('EndGlobal')\nend\nfunction premake.vs2005_solution_platforms(sl" "n)\n_p('\\tGlobalSection(SolutionConfigurationPlatforms) = preSolution')\nfor _, cfg in ipairs(sln.vstudio_configs) do\n_p('\\t\\t%s = %s', cfg.name, cfg.name)\nend\n_p('\\tEndGlobalSection')\nend\nfunction premake.vs2005_solution_project_platforms(sln)\n_p('\\tGlobalSection(ProjectConfigurationPlatforms) = postSolution')\nfor prj in premake.solution.eachproject(sln) do\nfor _, cfg in ipairs(sln.vstudio_configs) do\nlocal mapped\nif premake.isdotnetproject(prj) then\nmapped = \"Any CPU\"\nelse\nif cfg.platform == \"Any CPU\" or cfg.platform == \"Mixed Platforms\" then\nmapped = sln.vstudio_configs[3].platform\nelse\nmapped = cfg.platform\nend\nend\n_p('\\t\\t{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\nif mapped == cfg.platform or cfg.platform == \"Mixed Platforms\" then\n_p('\\t\\t{%s}.%s.Build.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\nend\nend\nend\n_p('\\tEndGlobalSection')\nend\nfunction premake.vs2005_solution_properties(sln)\n_p('\\tGlobalSection(SolutionProperties" ") = preSolution')\n_p('\\t\\tHideSolutionNode = FALSE')\n_p('\\tEndGlobalSection')\nend\n", /* actions/vstudio/vs2005_csproj.lua */ "premake.vstudio.cs2005 = { }\nlocal vstudio = premake.vstudio\nlocal cs2005 = premake.vstudio.cs2005\nlocal function getelements(prj, action, fname)\nif action == \"Compile\" and fname:endswith(\".cs\") then\nif fname:endswith(\".Designer.cs\") then\nlocal basename = fname:sub(1, -13)\nlocal testname = basename .. \".cs\"\nif premake.findfile(prj, testname) then\nreturn \"Dependency\", testname\nend\ntestname = basename .. \".resx\"\nif premake.findfile(prj, testname) then\nreturn \"AutoGen\", testname\nend\nelse\nlocal basename = fname:sub(1, -4)\nlocal testname = basename .. \".Designer.cs\"\nif premake.findfile(prj, testname) then\nreturn \"SubTypeForm\"\nend\nend\nend\nif action == \"EmbeddedResource\" and fname:endswith(\".resx\") then\nlocal basename = fname:sub(1, -6)\nlocal testname = path.getname(basename .. \".cs\")\nif premake.findfile(prj, testname) then\nif premake.findfile(prj, basename .. \".Designer.cs\") then\nreturn \"DesignerType\", testname\nelse\nreturn \"Dependency\", testname\nend\nelse" "\ntestname = path.getname(basename .. \".Designer.cs\")\nif premake.findfile(prj, testname) then\nreturn \"AutoGenerated\"\nend\nend\nend\nif action == \"Content\" then\nreturn \"CopyNewest\"\nend\nreturn \"None\"\nend\nfunction cs2005.projectelement(prj)\n_p('', iif(_ACTION == 'vs2005', '', ' ToolsVersion=\"3.5\"'))\nend\nfunction cs2005.projectsettings(prj)\n_p(' ')\n_p(' %s', premake.esc(prj.solution.configurations[1]))\n_p(' AnyCPU')\n_p(' %s', iif(_ACTION == \"vs2005\", \"8.0.50727\", \"9.0.21022\"))\n_p(' 2.0')\n_p(' {%s}', prj.uuid)\n_p(' %s', premake.dotnet.getkind(prj))\n_p(' Properties')\n_p(' %s', prj.buildtarget.basename)\n_p(' %s', prj.buildtarget.basename)\nif prj.framework then\n_p(' v%s', prj.framework)\nend\n_p(' ')\nend\nfunction premake.vs2005_csproj(prj)\nio.eol = \"\\r\\n\"\nlocal vsversion, toolversion\nif _ACTION == \"vs2005\" then\nvsversion = \"8.0.50727\"\ntoolversion = nil\nelseif _ACTION == \"vs2008\" then\nvsversion = \"9.0.21022\"\ntoolversion = \"3.5\"\nend\nif toolversion then\n_p('', toolversion)\nelse\n_p('')\nend\n_p(' ')\n_p(' %s', premake.esc(prj.solution.configurations[1]))\n_p(' AnyCPU')\n_p(' %s', vsversion)\n_p(' 2.0')\n_p(' {%s}', prj.uuid)\n_p(' %s', premake.dotnet.getkind(prj))\n_p(' Properties')\n_p(' %s', prj.buildtarget.basename)\n_p(' %s', prj.buildtarget.basename)\n_p(' ')\nfor cfg in premake.eachconfig(prj) do\n_p(' ', premake.esc(cfg.name))\nif cfg.flags.Symbols then\n_p(' true')\n_p(' full')\nelse\n_p(' pdbonly')\nend\n_p(' %s', iif(cfg.flags.Optimize or cfg.flags.OptimizeSize or cfg.flags.OptimizeSpeed, \"true\", \"false\"))\n_p(' %s', cfg.buildtarget.directory)\n_p('" " %s', table.concat(premake.esc(cfg.defines), \";\"))\n_p(' prompt')\n_p(' 4')\nif cfg.flags.Unsafe then\n_p(' true')\nend\nif cfg.flags.FatalWarnings then\n_p(' true')\nend\n_p(' ')\nend\n_p(' ')\nfor _, ref in ipairs(premake.getlinks(prj, \"siblings\", \"object\")) do\n_p(' ', path.translate(path.getrelative(prj.location, _VS.projectfile(ref)), \"\\\\\"))\n_p(' {%s}', ref.uuid)\n_p(' %s', premake.esc(ref.name))\n_p(' ')\nend\nfor _, linkname in ipairs(premake.getlinks(prj, \"system\", \"basename\")) do\n_p(' ', premake.esc(linkname))\nend\n_p(' ')\n_p(' ')\nfor fcfg in premake.eachfile(prj) do\nlocal action = premake.dotnet.getbuildaction(" "fcfg)\nlocal fname = path.translate(premake.esc(fcfg.name), \"\\\\\")\nlocal elements, dependency = getelements(prj, action, fcfg.name)\nif elements == \"None\" then\n_p(' <%s Include=\"%s\" />', action, fname)\nelse\n_p(' <%s Include=\"%s\">', action, fname)\nif elements == \"AutoGen\" then\n_p(' True')\nelseif elements == \"AutoGenerated\" then\n_p(' Designer')\n_p(' ResXFileCodeGenerator')\n_p(' %s.Designer.cs', premake.esc(path.getbasename(fcfg.name)))\nelseif elements == \"SubTypeDesigner\" then\n_p(' Designer')\nelseif elements == \"SubTypeForm\" then\n_p(' Form')\nelseif elements == \"PreserveNewest\" then\n_p(' PreserveNewest')\nend\nif dependency then\n_p(' %s', path.translate(premake.esc(dependency), \"\\\\\"))\nend\n_p(' ', action)\nend\nend" "\n_p(' ')\n_p(' ')\n_p(' ')\n_p('')\nend\n", /* actions/vstudio/vs2005_csproj_user.lua */ "function premake.vs2005_csproj_user(prj)\nio.eol = \"\\r\\n\"\n_p('')\n_p(' ')\nlocal refpaths = table.translate(prj.libdirs, function(v) return path.getabsolute(prj.location .. \"/\" .. v) end)\n_p(' %s', path.translate(table.concat(refpaths, \";\"), \"\\\\\"))\n_p(' ')\n_p('')\nend\n", /* actions/vstudio/vs_generic_solution.lua */ "\nlocal vs_format_version = function()\nlocal t =\n{\nvs2005 = '9.00',\n vs2008 = '10.00',\n vs2010 = '11.00'\n}\nreturn t[_ACTION]\nend\nlocal vs_version = function()\nlocal t =\n{\nvs2005 = '2005',\n vs2008 = '2008',\n vs2010 = '2010'\n}\nreturn t[_ACTION]\nend\nlocal vs_write_version_info = function()\n_p('Microsoft Visual Studio Solution File, Format Version %s', vs_format_version())\n_p('# Visual Studio %s', vs_version() )\nend\nlocal vs_write_projects = function(sln)\nfor prj in premake.solution.eachproject(sln) do\nlocal projpath = path.translate(path.getrelative(sln.location, _VS.projectfile(prj)), \"\\\\\")\n_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"', _VS.tool(prj), prj.name, projpath, prj.uuid)\nlocal deps = premake.getdependencies(prj)\nif #deps > 0 then\n_p('\\tProjectSection(ProjectDependencies) = postProject')\nfor _, dep in ipairs(deps) do\n_p('\\t\\t{%s} = {%s}', dep.uuid, dep.uuid)\nend\n_p('\\tEndProjectSection')\nend\n_p('EndProject')\nend\nend\nlocal vs_write_pre_version " "= function(sln)\nio.eol = '\\r\\n'\nsln.vstudio_configs = premake.vstudio_buildconfigs(sln)\n_p('\\239\\187\\191')\nend\nfunction premake.vs_generic_solution(sln)\nvs_write_pre_version(sln)\nvs_write_version_info()\nvs_write_projects(sln)\n_p('Global')\npremake.vs2005_solution_platforms(sln)\npremake.vs2005_solution_project_platforms(sln)\npremake.vs2005_solution_properties(sln)\n_p('EndGlobal')\nend", /* actions/vstudio/vs2010_vcxproxj.lua */ "\npremake.vstudio.vs10_helpers = { }\nlocal vs10_helpers = premake.vstudio.vs10_helpers\nfunction vs10_helpers.remove_relative_path(file)\nfile = file:gsub(\"%.%.\\\\\",'')\nfile = file:gsub(\"%.\\\\\",'')\nreturn file\nend\nfunction vs10_helpers.file_path(file)\nfile = vs10_helpers.remove_relative_path(file)\nlocal path = string.find(file,'\\\\[%w%.%_%-]+$')\nif path then\nreturn string.sub(file,1,path-1)\nelse\nreturn nil\nend\nend\nfunction vs10_helpers.list_of_directories_in_path(path)\nlocal list={}\npath = vs10_helpers.remove_relative_path(path)\nif path then\nfor dir in string.gmatch(path,\"[%w%-%_%.]+\\\\\")do\nif #list == 0 then\nlist[1] = dir:sub(1,#dir-1)\nelse\nlist[#list +1] = list[#list] ..\"\\\\\" ..dir:sub(1,#dir-1)\nend\nend\nend\nreturn list\nend\nfunction vs10_helpers.table_of_file_filters(files)\nlocal filters ={}\nfor _, valueTable in pairs(files) do\nfor _, entry in ipairs(valueTable) do\nlocal result = vs10_helpers.list_of_directories_in_path(entry)\nfor __,dir in ipairs(result) do\nif t" "able.contains(filters,dir) ~= true then\nfilters[#filters +1] = dir\nend\nend\nend\nend\nreturn filters\nend\nfunction vs10_helpers.get_file_extension(file)\nlocal ext_start,ext_end = string.find(file,\"%.[%w_%-]+$\")\nif ext_start then\nreturn string.sub(file,ext_start+1,ext_end)\nend\nend\nfunction vs10_helpers.sort_input_files(files,sorted_container)\nlocal types = \n{\nh= \"ClInclude\",\nhpp= \"ClInclude\",\nhxx= \"ClInclude\",\nc= \"ClCompile\",\ncpp= \"ClCompile\",\ncxx= \"ClCompile\",\ncc= \"ClCompile\",\nrc = \"ResourceCompile\"\n}\nfor _, current_file in ipairs(files) do\nlocal translated_path = path.translate(current_file, '\\\\')\nlocal ext = vs10_helpers.get_file_extension(translated_path)\nif ext then\nlocal type = types[ext]\nif type then\ntable.insert(sorted_container[type],translated_path)\nelse\ntable.insert(sorted_container.None,translated_path)\nend\nend\nend\nend\nlocal function vs2010_config(prj)\n_p(1,'')\nfor _, cfginfo in ipairs(prj.solution." "vstudio_configs) do\n_p(2,'', premake.esc(cfginfo.name))\n_p(3,'%s',cfginfo.buildcfg)\n_p(3,'%s',cfginfo.platform)\n_p(2,'')\nend\n_p(1,'')\nend\nlocal function vs2010_globals(prj)\n_p(1,'')\n_p(2,'{%s}',prj.uuid)\n_p(2,'%s',prj.name)\n_p(2,'Win32Proj')\n_p(1,'')\nend\nfunction vs10_helpers.config_type(config)\nlocal t =\n{\nSharedLib = \"DynamicLibrary\",\nStaticLib = \"StaticLibrary\",\nConsoleApp = \"Application\",\nWindowedApp = \"Application\"\n}\nreturn t[config.kind]\nend\nlocal function if_config_and_platform()\nreturn 'Condition=\"\\'$(Configuration)|$(Platform)\\'==\\'%s\\'\"'\nend\nlocal function optimisation(cfg)\nlocal result = \"Disabled\"\nfor _, value in ipairs(cfg.flags) do\nif (value == \"Optimize\") then\nresult = \"Full\"\nelseif (value == \"Opt" "imizeSize\") then\nresult = \"MinSpace\"\nelseif (value == \"OptimizeSpeed\") then\nresult = \"MaxSpeed\"\nend\nend\nreturn result\nend\nlocal function config_type_block(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,''\n, premake.esc(cfginfo.name))\n_p(2,'%s',vs10_helpers.config_type(cfg))\n_p(2,'%s',iif(cfg.flags.Unicode,\"Unicode\",\"MultiByte\"))\nif cfg.flags.MFC then\n_p(2,'Dynamic')\nend\nlocal use_debug = \"false\"\nif optimisation(cfg) == \"Disabled\" then \nuse_debug = \"true\" \nelse\n_p(2,'true')\nend\n_p(2,'%s',use_debug)\n_p(1,'')\nend\nend\nlocal function import_props(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do" "\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,''\n,premake.esc(cfginfo.name))\n_p(2,'')\n_p(1,'')\nend\nend\nlocal function incremental_link(cfg,cfginfo)\nif cfg.kind ~= \"StaticLib\" then\nShoudLinkIncrementally = 'false'\nif optimisation(cfg) == \"Disabled\" then\nShoudLinkIncrementally = 'true'\nend\n_p(2,'%s'\n,premake.esc(cfginfo.name),ShoudLinkIncrementally)\nend\nend\nlocal function ignore_import_lib(cfg,cfginfo)\nif cfg.kind == \"SharedLib\" then\nlocal shouldIgnore = \"false\"\nif cfg.flags.NoImportLib then shouldIgnore = \"true\" end\n _p(2,'%s'\n,pre" "make.esc(cfginfo.name),shouldIgnore)\nend\nend\nlocal function intermediate_and_out_dirs(prj)\n_p(1,'')\n_p(2,'<_ProjectFileVersion>10.0.30319.1')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(2,'%s\\\\'\n, premake.esc(cfginfo.name),premake.esc(cfg.buildtarget.directory) )\n_p(2,'%s\\\\'\n, premake.esc(cfginfo.name), premake.esc(cfg.objectsdir))\n_p(2,'%s'\n,premake.esc(cfginfo.name),path.getbasename(cfg.buildtarget.name))\nignore_import_lib(cfg,cfginfo)\nincremental_link(cfg,cfginfo)\nif cfg.flags.NoManifest then\n_p(2,'false'\n,premake.esc(cfginfo.name))\nend\nend\n_p(1,'')\nend\nlocal function runtime(cfg)\nlocal runtime\nif premake.config." "isdebugbuild(cfg) then\nruntime = iif(cfg.flags.StaticRuntime,\"MultiThreadedDebug\", \"MultiThreadedDebugDLL\")\nelse\nruntime = iif(cfg.flags.StaticRuntime, \"MultiThreaded\", \"MultiThreadedDLL\")\nend\nreturn runtime\nend\nlocal function precompiled_header(cfg)\n if not cfg.flags.NoPCH and cfg.pchheader then\n_p(3,'Use')\n_p(3,'%s', path.getname(cfg.pchheader))\nelse\n_p(3,'')\nend\nend\nlocal function preprocessor(indent,cfg)\nif #cfg.defines > 0 then\n_p(indent,'%s;%%(PreprocessorDefinitions)'\n,premake.esc(table.concat(cfg.defines, \";\")))\nelse\n_p(indent,'')\nend\nend\nlocal function include_dirs(indent,cfg)\nif #cfg.includedirs > 0 then\n_p(indent,'%s;%%(AdditionalIncludeDirectories)'\n,premake.esc(path.translat" "e(table.concat(cfg.includedirs, \";\"), '\\\\')))\nend\nend\nlocal function resource_compile(cfg)\n_p(2,'')\npreprocessor(3,cfg)\ninclude_dirs(3,cfg)\n_p(2,'')\nend\nlocal function exceptions(cfg)\nif cfg.flags.NoExceptions then\n_p(2,'false')\nelseif cfg.flags.SEH then\n_p(2,'Async')\nend\nend\nlocal function rtti(cfg)\nif cfg.flags.NoRTTI then\n_p(3,'false')\nend\nend\nlocal function wchar_t_buildin(cfg)\nif cfg.flags.NativeWChar then\n_p(3,'true')\nelseif cfg.flags.NoNativeWChar then\n_p(3,'false')\nend\nend\nlocal function sse(cfg)\nif cfg.flags.EnableSSE then\n_p(3,'StreamingSIMDExtensions')\nelseif cfg.flags.EnableSSE2 then\n_p(3,'StreamingSIMDExtensions2')\nend\nend\nlocal function floating_point(cfg)\n if cfg.flags.FloatFast then\n_p(3,'Fast')\nelseif cfg.flags.FloatStrict then\n_p(3,'Strict')\nend\nend\nlocal function debug_info(cfg)\nlocal debug_info = ''\nif cfg.flags.Symbols then\nif optimisation(cfg) ~= \"Disabled\" or cfg.flags.NoEditAndContinue then\ndebug_info = \"ProgramDatabase\"\nelseif cfg.platform ~= \"x64\" then\ndebug_info = \"EditAndContinue\"\nelse\ndebug_info = \"OldStyle\"\nend\nend\n_p(3,'%s',debug_info)\nend\nlocal function minimal_build(cfg)\nif premake.config.isdebugbuild(cfg) and not cfg.flags.NoMinimalRebuild then\n_p(3,'true')\nelse\n_p(3,'false')\nend\nend\nlocal function compile_language(cfg)\nif cfg.language == \"C\" then\n_p(3,'CompileAsC')\nend\nend\nlocal function vs10_clcompile(cfg)" "\n_p(2,'')\nif #cfg.buildoptions > 0 then\n_p(3,'%s %%(AdditionalOptions)',\ntable.concat(premake.esc(cfg.buildoptions), \" \"))\nend\n_p(3,'%s',optimisation(cfg))\ninclude_dirs(3,cfg)\npreprocessor(3,cfg)\nminimal_build(cfg)\nif optimisation(cfg) == \"Disabled\" then\n_p(3,'EnableFastChecks')\nif cfg.flags.ExtraWarnings then\n_p(3,'true')\nend\nelse\n_p(3,'true')\nend\n_p(3,'%s', runtime(cfg))\n_p(3,'true')\nprecompiled_header(cfg)\nif cfg.flags.ExtraWarnings then\n_p(3,'Level4')\nelse\n_p(3,'Level3')\nend\nif cfg.flags.FatalWarnings then\n_p(3,'true')\nend\nexceptions(cfg)\nrtti(cfg)\nwchar_t_buildin(cfg)\nsse(cfg)\nfloating_point(cfg)\ndebug_info(" "cfg)\nif cfg.flags.NoFramePointer then\n_p(3,'true')\nend\ncompile_language(cfg)\n_p(2,'')\nend\nlocal function event_hooks(cfg)\nif #cfg.postbuildcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.postbuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nif #cfg.prebuildcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.prebuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nif #cfg.prelinkcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.prelinkcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nend\nlocal function additional_options(indent,cfg)\nif #cfg.linkoptions > 0 then\n_p(indent,'%s %%(AdditionalOptions)',\ntable.concat(premake.esc(cfg.linkoptions), \" \"))\nend\nend\nlocal function item_def_lib(" "cfg)\nif cfg.kind == 'StaticLib' then\n_p(1,'')\n_p(2,'$(OutDir)%s',cfg.buildtarget.name)\nadditional_options(2,cfg)\n_p(1,'')\nend\nend\nlocal function link_target_machine(cfg)\nlocal target\nif cfg.platform == nil or cfg.platform == \"x32\" then target =\"MachineX86\"\nelseif cfg.platform == \"x64\" then target =\"MachineX64\"\nend\n_p(3,'%s', target)\nend\nlocal function import_lib(cfg)\nif cfg.kind == \"SharedLib\" then\nlocal implibname = cfg.linktarget.fullpath\n_p(3,'%s',iif(cfg.flags.NoImportLib, cfg.objectsdir .. \"\\\\\" .. path.getname(implibname), implibname))\nend\nend\nlocal function common_link_section(cfg)\n_p(3,'%s',iif(cfg.kind == \"ConsoleApp\",\"Console\", \"Windows\"))\nif cfg.flags.Symbols then \n_p(3,'true')\nelse\n_p(3,'false')\nend\nif optimisation(cfg) ~= \"Disa" "bled\" then\n_p(3,'true')\n_p(3,'true')\nend\nif cfg.flags.Symbols then\n_p(3,'$(OutDir)%s.pdb'\n, path.getbasename(cfg.buildtarget.name))\nend\nend\nlocal function item_link(cfg)\n_p(2,'')\nif cfg.kind ~= 'StaticLib' then\nif #cfg.links > 0 then\n_p(3,'%s;%%(AdditionalDependencies)',\ntable.concat(premake.getlinks(cfg, \"all\", \"fullpath\"), \";\"))\nend\n_p(3,'$(OutDir)%s', cfg.buildtarget.name)\n_p(3,'%s%s%%(AdditionalLibraryDirectories)',\ntable.concat(premake.esc(path.translate(cfg.libdirs, '\\\\')) , \";\"),\niif(cfg.libdirs and #cfg.libdirs >0,';',''))\ncommon_link_section(cfg)\nif vs10_helpers.config_type(cfg) == 'Application' and not cfg.flags.WinMain then\n_p(3,'mainCRTStartup')\nend\nimport_" "lib(cfg)\n_p(3,'%s', iif(cfg.platform == \"x64\", \"MachineX64\", \"MachineX86\"))\nadditional_options(3,cfg)\nelse\ncommon_link_section(cfg)\nend\n_p(2,'')\nend\nlocal function item_definitions(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,''\n,premake.esc(cfginfo.name))\nvs10_clcompile(cfg)\nresource_compile(cfg)\nitem_def_lib(cfg)\nitem_link(cfg)\nevent_hooks(cfg)\n_p(1,'')\nend\nend\n -- \n -- {8fd826f8-3739-44e6-8cc8-997122e53b8d}\n -- \n -- \nlocal function write_file_type_block(files,group_type)\nif #files > 0 then\n_p(1,'')\nfor _, current_file in ipairs(files) do\n_p(2,'<%s Include=\\\"%s\\\" />', group_type,current_file)\nend\n_p(1,'')\nend\nend\nloc" "al function write_file_compile_block(files,prj,configs)\nif #files > 0 then\nlocal config_mappings = {}\nfor _, cfginfo in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = path.translate(cfg.pchsource, \"\\\\\")\nend\nend\n_p(1,'')\nfor _, current_file in ipairs(files) do\n_p(2,'', current_file)\nfor _, cfginfo in ipairs(configs) do\nif config_mappings[cfginfo] and current_file == config_mappings[cfginfo] then \n_p(3,'Create'\n,premake.esc(cfginfo.name))\nconfig_mappings[cfginfo] = nil\n_p(2,'')\nend\nend\n_p(2,'')\nend\n_p(1,'')\nend\nend\nlocal function vcxproj_files(prj)\nlocal sorted =\n{\nClCompile={},\nClInclude={},\nNone={},\nResourceCompile ={}\n}\ncfg = premake.getconfig(prj)\nvs10_helpers.sort_input_files(cfg.fi" "les,sorted)\nwrite_file_type_block(sorted.ClInclude,\"ClInclude\")\nwrite_file_compile_block(sorted.ClCompile,prj,prj.solution.vstudio_configs)\nwrite_file_type_block(sorted.None,'None')\nwrite_file_type_block(sorted.ResourceCompile,'ResourceCompile')\nend\nlocal function write_filter_includes(sorted_table)\nlocal directories = vs10_helpers.table_of_file_filters(sorted_table)\nif #directories >0 then\n_p(1,'')\nfor _, dir in pairs(directories) do\n_p(2,'',dir)\n_p(3,'{%s}',os.uuid())\n_p(2,'')\nend\n_p(1,'')\nend\nend\nlocal function write_file_filter_block(files,group_type)\nif #files > 0 then\n_p(1,'')\nfor _, current_file in ipairs(files) do\nlocal path_to_file = vs10_helpers.file_path(current_file)\nif path_to_file then\n_p(2,'<%s Include=\\\"%s\\\">', group_type,path.translate(current_file, \"\\\\\"))\n_p(3,'%s',path_to_file)\n_p(2,'',group_type)\nelse\n_p(2,'<%s Include=\\\"%s\\\"" " />', group_type,path.translate(current_file, \"\\\\\"))\nend\nend\n_p(1,'')\nend\nend\nlocal tool_version_and_xmlns = 'ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\"'\nlocal xml_version_and_encoding = ''\nlocal function vcxproj_filter_files(prj)\nlocal sorted =\n{\nClCompile={},\nClInclude={},\nNone={},\nResourceCompile ={}\n}\ncfg = premake.getconfig(prj)\nvs10_helpers.sort_input_files(cfg.files,sorted)\nio.eol = \"\\r\\n\"\n_p(xml_version_and_encoding)\n_p('')\nwrite_filter_includes(sorted)\nwrite_file_filter_block(sorted.ClInclude,\"ClInclude\")\nwrite_file_filter_block(sorted.ClCompile,\"ClCompile\")\nwrite_file_filter_block(sorted.None,\"None\")\nwrite_file_filter_block(sorted.ResourceCompile,\"ResourceCompile\")\n_p('')\nend\nfunction premake.vs2010_vcxproj(prj)\nio.eol = \"\\r\\n\"\n_p(xml_version_and_encoding)\n_p('')\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'')\nconfig_type_block(prj)\n_p(1,'')\n_p(1,'')\n_p(1,'')\nimport_props(prj)\n_p(1,'')\nintermediate_and_out_dirs(prj)\nitem_definitions(prj)\nvcxproj_files(prj)\n_p(1,'')\n_p(1,'')\n_p(1,'')\n_p('')\nend\nfunction premake.vs2010_vcxproj_user(prj)\n_p(xml_version_and_encoding)\n_p('')\n_p('')\nend\nfunction premake.vs2010_vcxproj_filters(prj)\nvcxproj_filter_files(prj)\nend\n", /* actions/xcode/_xcode.lua */ "premake.xcode = { }\nnewaction \n{\ntrigger = \"xcode3\",\nshortname = \"Xcode 3\",\ndescription = \"Generate Apple Xcode 3 project files (experimental)\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"SharedLib\", \"StaticLib\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = { \nNative = \"Native\", \nx32 = \"Native 32-bit\", \nx64 = \"Native 64-bit\", \nUniversal32 = \"32-bit Universal\", \nUniversal64 = \"64-bit Universal\", \nUniversal = \"Universal\",\n},\ndefault_platform = \"Universal\",\nonsolution = function(sln)\npremake.xcode.preparesolution(sln)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.xcodeproj/project.pbxproj\", premake.xcode.project)\nend,\noncleanproject = function(prj)\npremake.clean.directory(prj, \"%%.xcodeproj\")\nend,\noncheckproject = function(prj)\nlocal last\nfor cfg in premake.eachconfig(prj) do\nif last and last ~= cfg.kind then\nerror(\"Project '" "\" .. prj.name .. \"' uses more than one target kind; not supported by Xcode\", 0)\nend\nlast = cfg.kind\nend\nend,\n}\n", /* actions/xcode/xcode_common.lua */ "local xcode = premake.xcode\nlocal tree = premake.tree\nfunction xcode.getbuildcategory(node)\nlocal categories = {\n[\".a\"] = \"Frameworks\",\n[\".c\"] = \"Sources\",\n[\".cc\"] = \"Sources\",\n[\".cpp\"] = \"Sources\",\n[\".cxx\"] = \"Sources\",\n[\".dylib\"] = \"Frameworks\",\n[\".framework\"] = \"Frameworks\",\n[\".m\"] = \"Sources\",\n[\".mm\"] = \"Sources\",\n[\".strings\"] = \"Resources\",\n[\".nib\"] = \"Resources\",\n[\".xib\"] = \"Resources\",\n[\".icns\"] = \"Resources\",\n}\nreturn categories[path.getextension(node.name)]\nend\nfunction xcode.getconfigname(cfg)\nlocal name = cfg.name\nif #cfg.project.solution.xcode.platforms > 1 then\nname = name .. \" \" .. premake.action.current().valid_platforms[cfg.platform]\nend\nreturn name\nend\nfunction xcode.getfiletype(node)\nlocal types = {\n[\".c\"] = \"sourcecode.c.c\",\n[\".cc\"] = \"sourcecode.cpp.cpp\",\n[\".cpp\"] = \"sourcecode.cpp.cpp\",\n[\".css\"] = \"text.css\",\n[\".cxx\"] = \"sourcecode.cpp.cpp\",\n[\".fram" "ework\"] = \"wrapper.framework\",\n[\".gif\"] = \"image.gif\",\n[\".h\"] = \"sourcecode.c.h\",\n[\".html\"] = \"text.html\",\n[\".lua\"] = \"sourcecode.lua\",\n[\".m\"] = \"sourcecode.c.objc\",\n[\".mm\"] = \"sourcecode.cpp.objc\",\n[\".nib\"] = \"wrapper.nib\",\n[\".pch\"] = \"sourcecode.c.h\",\n[\".plist\"] = \"text.plist.xml\",\n[\".strings\"] = \"text.plist.strings\",\n[\".xib\"] = \"file.xib\",\n[\".icns\"] = \"image.icns\",\n}\nreturn types[path.getextension(node.path)] or \"text\"\nend\nfunction xcode.getproducttype(node)\nlocal types = {\nConsoleApp = \"com.apple.product-type.tool\",\nWindowedApp = \"com.apple.product-type.application\",\nStaticLib = \"com.apple.product-type.library.static\",\nSharedLib = \"com.apple.product-type.library.dynamic\",\n}\nreturn types[node.cfg.kind]\nend\nfunction xcode.gettargettype(node)\nlocal types = {\nConsoleApp = \"\\\"compiled.mach-o.executable\\\"\",\nWindowedApp = \"wrapper.application\"," "\nStaticLib = \"archive.ar\",\nSharedLib = \"\\\"compiled.mach-o.dylib\\\"\",\n}\nreturn types[node.cfg.kind]\nend\nfunction xcode.getxcodeprojname(prj)\nlocal fname = premake.project.getfilename(prj, \"%%.xcodeproj\")\nreturn fname\nend\nfunction xcode.isframework(fname)\nreturn (path.getextension(fname) == \".framework\")\nend\nfunction xcode.newid()\nreturn string.format(\"%04X%04X%04X%04X%04X%04X\",\nmath.random(0, 32767),\nmath.random(0, 32767),\nmath.random(0, 32767),\nmath.random(0, 32767),\nmath.random(0, 32767),\nmath.random(0, 32767))\nend\nfunction xcode.preparesolution(sln)\nsln.xcode = { }\nsln.xcode.platforms = premake.filterplatforms(sln, premake.action.current().valid_platforms, \"Universal\")\nfor prj in premake.solution.eachproject(sln) do\nlocal cfg = premake.getconfig(prj, prj.configurations[1], sln.xcode.platforms[1])\nlocal node = premake.tree.new(path.getname(cfg.buildtarget.bundlepath))\nnode.cfg = cfg\nnode.id = premake.xcode.newid(node, \"product\")\nnode.targetid = premake.xcode." "newid(node, \"target\")\nprj.xcode = {}\nprj.xcode.projectnode = node\nend\nend\nfunction xcode.printlist(list, tag)\nif #list > 0 then\n_p(4,'%s = (', tag)\nfor _, item in ipairs(list) do\n_p(5, '\"%s\",', item)\nend\n_p(4,');')\nend\nend\nfunction xcode.Header()\n_p('// !$*UTF8*$!')\n_p('{')\n_p(1,'archiveVersion = 1;')\n_p(1,'classes = {')\n_p(1,'};')\n_p(1,'objectVersion = 45;')\n_p(1,'objects = {')\n_p('')\nend\nfunction xcode.PBXBuildFile(tr)\n_p('/* Begin PBXBuildFile section */')\ntree.traverse(tr, {\nonnode = function(node)\nif node.buildid then\n_p(2,'%s /* %s in %s */ = {isa = PBXBuildFile; fileRef = %s /* %s */; };', \nnode.buildid, node.name, xcode.getbuildcategory(node), node.id, node.name)\nend\nend\n})\n_p('/* End PBXBuildFile section */')\n_p('')\nend\nfunction xcode.PBXContainerItemProxy(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXContainerItemProxy section */')\nfor _, node in ipairs(tr.projects.children) do\n_p(2,'%s /* PBXContainerItemProxy */ = {', node.productproxyid)\n_p(3,'" "isa = PBXContainerItemProxy;')\n_p(3,'containerPortal = %s /* %s */;', node.id, path.getname(node.path))\n_p(3,'proxyType = 2;')\n_p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.id)\n_p(3,'remoteInfo = \"%s\";', node.project.xcode.projectnode.name)\n_p(2,'};')\n_p(2,'%s /* PBXContainerItemProxy */ = {', node.targetproxyid)\n_p(3,'isa = PBXContainerItemProxy;')\n_p(3,'containerPortal = %s /* %s */;', node.id, path.getname(node.path))\n_p(3,'proxyType = 1;')\n_p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.targetid)\n_p(3,'remoteInfo = \"%s\";', node.project.xcode.projectnode.name)\n_p(2,'};')\nend\n_p('/* End PBXContainerItemProxy section */')\n_p('')\nend\nend\nfunction xcode.PBXFileReference(tr)\n_p('/* Begin PBXFileReference section */')\ntree.traverse(tr, {\nonleaf = function(node)\nif not node.path then\nreturn\nend\nif node.kind == \"product\" then\n_p(2,'%s /* %s */ = {isa = PBXFileReference; explicitFileType = %s; includeInIndex = 0; name = \"%s\"; path = \"%s\"; sour" "ceTree = BUILT_PRODUCTS_DIR; };',\nnode.id, node.name, xcode.gettargettype(node), node.name, path.getname(node.cfg.buildtarget.bundlepath))\nelseif node.parent.parent == tr.projects then\nlocal relpath = path.getrelative(tr.project.location, node.parent.project.location)\n_p(2,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = \"%s\"; path = \"%s\"; sourceTree = SOURCE_ROOT; };',\nnode.parent.id, node.parent.name, node.parent.name, path.join(relpath, node.parent.name))\nelse\nlocal pth, src\nif xcode.isframework(node.path) then\npth = \"/System/Library/Frameworks/\" .. node.path\nsrc = \"absolute\"\nelse\npth = tree.getlocalpath(node)\nsrc = \"group\"\nend\n_p(2,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = %s; name = \"%s\"; path = \"%s\"; sourceTree = \"<%s>\"; };',\nnode.id, node.name, xcode.getfiletype(node), node.name, pth, src)\nend\nend\n})\n_p('/* End PBXFileReference section */')\n_p('')\nend\nfunction xcode.PBXFrameworksBuildPhase(tr)\n_p('/* Begi" "n PBXFrameworksBuildPhase section */')\n_p(2,'%s /* Frameworks */ = {', tr.products.children[1].fxstageid)\n_p(3,'isa = PBXFrameworksBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\ntree.traverse(tr.frameworks, {\nonleaf = function(node)\n_p(4,'%s /* %s in Frameworks */,', node.buildid, node.name)\nend\n})\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(4,'%s /* %s in Frameworks */,', node.buildid, node.name)\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\n_p('/* End PBXFrameworksBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXGroup(tr)\n_p('/* Begin PBXGroup section */')\ntree.traverse(tr, {\nonnode = function(node)\nif (node.path and #node.children == 0) or node.kind == \"vgroup\" then\nreturn\nend\nif node.parent == tr.projects then\n_p(2,'%s /* Products */ = {', node.productgroupid)\nelse\n_p(2,'%s /* %s */ = {', node.id, node.name)\nend\n_p(3,'isa = PBXGroup;')\n_p(3,'children = (')\nfor _, childnode in ipairs(node.children) do" "\n_p(4,'%s /* %s */,', childnode.id, childnode.name)\nend\n_p(3,');')\nif node.parent == tr.projects then\n_p(3,'name = Products;')\nelse\n_p(3,'name = \"%s\";', node.name)\nif node.path then\nlocal p = node.path\nif node.parent.path then\np = path.getrelative(node.parent.path, node.path)\nend\n_p(3,'path = %s;', p)\nend\nend\n_p(3,'sourceTree = \"\";')\n_p(2,'};')\nend\n}, true)\n_p('/* End PBXGroup section */')\n_p('')\nend\nfunction xcode.PBXNativeTarget(tr)\n_p('/* Begin PBXNativeTarget section */')\nfor _, node in ipairs(tr.products.children) do\nlocal name = tr.project.name\n_p(2,'%s /* %s */ = {', node.targetid, name)\n_p(3,'isa = PBXNativeTarget;')\n_p(3,'buildConfigurationList = %s /* Build configuration list for PBXNativeTarget \"%s\" */;', node.cfgsection, name)\n_p(3,'buildPhases = (')\nif #tr.project.prebuildcommands > 0 then\n_p(4,'9607AE1010C857E500CD1376 /* Prebuild */,')\nend\n_p(4,'%s /* Resources */,', node.resstageid)\n_p(4,'%s /* Sources */,', node.sourcesid)\nif #tr.project.prelink" "commands > 0 then\n_p(4,'9607AE3510C85E7E00CD1376 /* Prelink */,')\nend\n_p(4,'%s /* Frameworks */,', node.fxstageid)\nif #tr.project.postbuildcommands > 0 then\n_p(4,'9607AE3710C85E8F00CD1376 /* Postbuild */,')\nend\n_p(3,');')\n_p(3,'buildRules = (')\n_p(3,');')\n_p(3,'dependencies = (')\nfor _, node in ipairs(tr.projects.children) do\n_p(4,'%s /* PBXTargetDependency */,', node.targetdependid)\nend\n_p(3,');')\n_p(3,'name = \"%s\";', name)\nlocal p\nif node.cfg.kind == \"ConsoleApp\" then\np = \"$(HOME)/bin\"\nelseif node.cfg.kind == \"WindowedApp\" then\np = \"$(HOME)/Applications\"\nend\nif p then\n_p(3,'productInstallPath = \"%s\";', p)\nend\n_p(3,'productName = \"%s\";', name)\n_p(3,'productReference = %s /* %s */;', node.id, node.name)\n_p(3,'productType = \"%s\";', xcode.getproducttype(node))\n_p(2,'};')\nend\n_p('/* End PBXNativeTarget section */')\n_p('')\nend\nfunction xcode.PBXProject(tr)\n_p('/* Begin PBXProject section */')\n_p(2,'08FB7793FE84155DC02AAC07 /* Project object */ = {')\n_p(3,'isa = P" "BXProject;')\n_p(3,'buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject \"%s\" */;', tr.name)\n_p(3,'compatibilityVersion = \"Xcode 3.1\";')\n_p(3,'hasScannedForEncodings = 1;')\n_p(3,'mainGroup = %s /* %s */;', tr.id, tr.name)\n_p(3,'projectDirPath = \"\";')\nif #tr.projects.children > 0 then\n_p(3,'projectReferences = (')\nfor _, node in ipairs(tr.projects.children) do\n_p(4,'{')\n_p(5,'ProductGroup = %s /* Products */;', node.productgroupid)\n_p(5,'ProjectRef = %s /* %s */;', node.id, path.getname(node.path))\n_p(4,'},')\nend\n_p(3,');')\nend\n_p(3,'projectRoot = \"\";')\n_p(3,'targets = (')\nfor _, node in ipairs(tr.products.children) do\n_p(4,'%s /* %s */,', node.targetid, node.name)\nend\n_p(3,');')\n_p(2,'};')\n_p('/* End PBXProject section */')\n_p('')\nend\nfunction xcode.PBXReferenceProxy(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXReferenceProxy section */')\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(2,'%s /* %s */ = {', node.id, n" "ode.name)\n_p(3,'isa = PBXReferenceProxy;')\n_p(3,'fileType = %s;', xcode.gettargettype(node))\n_p(3,'path = \"%s\";', node.path)\n_p(3,'remoteRef = %s /* PBXContainerItemProxy */;', node.parent.productproxyid)\n_p(3,'sourceTree = BUILT_PRODUCTS_DIR;')\n_p(2,'};')\nend\n})\n_p('/* End PBXReferenceProxy section */')\n_p('')\nend\nend\nfunction xcode.PBXResourcesBuildPhase(tr)\n_p('/* Begin PBXResourcesBuildPhase section */')\nfor _, target in ipairs(tr.products.children) do\n_p(2,'%s /* Resources */ = {', target.resstageid)\n_p(3,'isa = PBXResourcesBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\ntree.traverse(tr, {\nonnode = function(node)\nif xcode.getbuildcategory(node) == \"Resources\" then\n_p(4,'%s /* %s in Resources */,', node.buildid, node.name)\nend\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\nend\n_p('/* End PBXResourcesBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXShellScriptBuildPhase(tr)\nlocal wrapperWritten = false\nlocal fun" "ction doblock(id, name, which)\nlocal prjcmds = tr.project[which]\nlocal commands = table.join(prjcmds, {})\nfor _, cfg in ipairs(tr.configs) do\nlocal cfgcmds = cfg[which]\nif #cfgcmds > #prjcmds then\ntable.insert(commands, 'if [ \"${CONFIGURATION}\" = \"' .. xcode.getconfigname(cfg) .. '\" ]; then')\nfor i = #prjcmds + 1, #cfgcmds do\ntable.insert(commands, cfgcmds[i])\nend\ntable.insert(commands, 'fi')\nend\nend\nif #commands > 0 then\nif not wrapperWritten then\n_p('/* Begin PBXShellScriptBuildPhase section */')\nwrapperWritten = true\nend\n_p(2,'%s /* %s */ = {', id, name)\n_p(3,'isa = PBXShellScriptBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\n_p(3,');')\n_p(3,'inputPaths = (');\n_p(3,');');\n_p(3,'name = %s;', name);\n_p(3,'outputPaths = (');\n_p(3,');');\n_p(3,'runOnlyForDeploymentPostprocessing = 0;');\n_p(3,'shellPath = /bin/sh;');\n_p(3,'shellScript = \"%s\";', table.concat(commands, \"\\\\n\"):gsub('\"', '\\\\\"'))\n_p(2,'};')\nend\nend\ndoblock(\"9607AE1010C857E500CD137" "6\", \"Prebuild\", \"prebuildcommands\")\ndoblock(\"9607AE3510C85E7E00CD1376\", \"Prelink\", \"prelinkcommands\")\ndoblock(\"9607AE3710C85E8F00CD1376\", \"Postbuild\", \"postbuildcommands\")\nif wrapperWritten then\n_p('/* End PBXShellScriptBuildPhase section */')\nend\nend\nfunction xcode.PBXSourcesBuildPhase(tr)\n_p('/* Begin PBXSourcesBuildPhase section */')\nfor _, target in ipairs(tr.products.children) do\n_p(2,'%s /* Sources */ = {', target.sourcesid)\n_p(3,'isa = PBXSourcesBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\ntree.traverse(tr, {\nonleaf = function(node)\nif xcode.getbuildcategory(node) == \"Sources\" then\n_p(4,'%s /* %s in Sources */,', node.buildid, node.name)\nend\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\nend\n_p('/* End PBXSourcesBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXVariantGroup(tr)\n_p('/* Begin PBXVariantGroup section */')\ntree.traverse(tr, {\nonbranch = function(node)\nif node.kind == \"vgroup\" then" "\n_p(2,'%s /* %s */ = {', node.id, node.name)\n_p(3,'isa = PBXVariantGroup;')\n_p(3,'children = (')\nfor _, lang in ipairs(node.children) do\n_p(4,'%s /* %s */,', lang.id, lang.name)\nend\n_p(3,');')\n_p(3,'name = %s;', node.name)\n_p(3,'sourceTree = \"\";')\n_p(2,'};')\nend\nend\n})\n_p('/* End PBXVariantGroup section */')\n_p('')\nend\nfunction xcode.PBXTargetDependency(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXTargetDependency section */')\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(2,'%s /* PBXTargetDependency */ = {', node.parent.targetdependid)\n_p(3,'isa = PBXTargetDependency;')\n_p(3,'name = \"%s\";', node.name)\n_p(3,'targetProxy = %s /* PBXContainerItemProxy */;', node.parent.targetproxyid)\n_p(2,'};')\nend\n})\n_p('/* End PBXTargetDependency section */')\n_p('')\nend\nend\nfunction xcode.XCBuildConfiguration_Target(tr, target, cfg)\nlocal cfgname = xcode.getconfigname(cfg)\n_p(2,'%s /* %s */ = {', cfg.xcode.targetid, cfgname)\n_p(3,'isa = XCBuildConfiguration;')\n" "_p(3,'buildSettings = {')\n_p(4,'ALWAYS_SEARCH_USER_PATHS = NO;')\nif not cfg.flags.Symbols then\n_p(4,'DEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";')\nend\nif cfg.kind ~= \"StaticLib\" and cfg.buildtarget.prefix ~= \"\" then\n_p(4,'EXECUTABLE_PREFIX = %s;', cfg.buildtarget.prefix)\nend\nlocal outdir = path.getdirectory(cfg.buildtarget.bundlepath)\nif outdir ~= \".\" then\n_p(4,'CONFIGURATION_BUILD_DIR = %s;', outdir)\nend\n_p(4,'GCC_DYNAMIC_NO_PIC = NO;')\n_p(4,'GCC_MODEL_TUNING = G5;')\nif tr.infoplist then\n_p(4,'INFOPLIST_FILE = \"%s\";', tr.infoplist.path)\nend\ninstallpaths = {\nConsoleApp = '/usr/local/bin',\nWindowedApp = '\"$(HOME)/Applications\"',\nSharedLib = '/usr/local/lib',\nStaticLib = '/usr/local/lib',\n}\n_p(4,'INSTALL_PATH = %s;', installpaths[cfg.kind])\n_p(4,'PRODUCT_NAME = \"%s\";', cfg.buildtarget.basename)\n_p(3,'};')\n_p(3,'name = \"%s\";', cfgname)\n_p(2,'};')\nend\nfunction xcode.XCBuildConfiguration_Project(tr, cfg)\nlocal cfgname = xcode.getconfigname(cfg)\n_p(2,'%s /* %s */ = {'" ", cfg.xcode.projectid, cfgname)\n_p(3,'isa = XCBuildConfiguration;')\n_p(3,'buildSettings = {')\nlocal archs = {\nNative = \"$(NATIVE_ARCH_ACTUAL)\",\nx32 = \"i386\",\nx64 = \"x86_64\",\nUniversal32 = \"$(ARCHS_STANDARD_32_BIT)\",\nUniversal64 = \"$(ARCHS_STANDARD_64_BIT)\",\nUniversal = \"$(ARCHS_STANDARD_32_64_BIT)\",\n}\n_p(4,'ARCHS = \"%s\";', archs[cfg.platform])\nlocal targetdir = path.getdirectory(cfg.buildtarget.bundlepath)\nif targetdir ~= \".\" then\n_p(4,'CONFIGURATION_BUILD_DIR = \"$(SYMROOT)\";');\nend\n_p(4,'CONFIGURATION_TEMP_DIR = \"$(OBJROOT)\";')\nif cfg.flags.Symbols then\n_p(4,'COPY_PHASE_STRIP = NO;')\nend\n_p(4,'GCC_C_LANGUAGE_STANDARD = gnu99;')\nif cfg.flags.NoExceptions then\n_p(4,'GCC_ENABLE_CPP_EXCEPTIONS = NO;')\nend\nif cfg.flags.NoRTTI then\n_p(4,'GCC_ENABLE_CPP_RTTI = NO;')\nend\nif cfg.flags.Symbols and not cfg.flags.NoEditAndContinue then\n_p(4,'GCC_ENABLE_FIX_AND_CONTINUE = YES;')\nend\nif cfg.flags.NoExceptions then\n_p(4,'GCC_ENABLE_OBJC_EXCEPTIONS = NO;')\nend\nif cfg" ".flags.Optimize or cfg.flags.OptimizeSize then\n_p(4,'GCC_OPTIMIZATION_LEVEL = s;')\nelseif cfg.flags.OptimizeSpeed then\n_p(4,'GCC_OPTIMIZATION_LEVEL = 3;')\nelse\n_p(4,'GCC_OPTIMIZATION_LEVEL = 0;')\nend\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p(4,'GCC_PRECOMPILE_PREFIX_HEADER = YES;')\n_p(4,'GCC_PREFIX_HEADER = \"%s\";', cfg.pchheader)\nend\nxcode.printlist(cfg.defines, 'GCC_PREPROCESSOR_DEFINITIONS')\nif cfg.flags.FatalWarnings then\n_p(4,'GCC_TREAT_WARNINGS_AS_ERRORS = YES;')\nend\n_p(4,'GCC_WARN_ABOUT_RETURN_TYPE = YES;')\n_p(4,'GCC_WARN_UNUSED_VARIABLE = YES;')\nxcode.printlist(cfg.includedirs, 'HEADER_SEARCH_PATHS')\nxcode.printlist(cfg.libdirs, 'LIBRARY_SEARCH_PATHS')\n_p(4,'OBJROOT = \"%s\";', cfg.objectsdir)\n_p(4,'ONLY_ACTIVE_ARCH = NO;')\nlocal checks = {\n[\"-ffast-math\"] = cfg.flags.FloatFast,\n[\"-ffloat-store\"] = cfg.flags.FloatStrict,\n[\"-fomit-frame-pointer\"] = cfg.flags.NoFramePointer,\n}\nlocal flags = { }\nfor flag, check in pairs(checks) do\nif check then\nta" "ble.insert(flags, flag)\nend\nend\nxcode.printlist(table.join(flags, cfg.buildoptions), 'OTHER_CFLAGS')\nflags = { }\nfor _, lib in ipairs(premake.getlinks(cfg, \"system\")) do\nif not xcode.isframework(lib) then\ntable.insert(flags, \"-l\" .. lib)\nend\nend\nflags = table.join(flags, cfg.linkoptions)\nxcode.printlist(flags, 'OTHER_LDFLAGS')\n_p(4,'PREBINDING = NO;')\nif cfg.flags.StaticRuntime then\n_p(4,'STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static;')\nend\nif targetdir ~= \".\" then\n_p(4,'SYMROOT = \"%s\";', targetdir)\nend\nif cfg.flags.ExtraWarnings then\n_p(4,'WARNING_CFLAGS = \"-Wall\";')\nend\n_p(3,'};')\n_p(3,'name = \"%s\";', cfgname)\n_p(2,'};')\nend\nfunction xcode.XCBuildConfiguration(tr)\n_p('/* Begin XCBuildConfiguration section */')\nfor _, target in ipairs(tr.products.children) do\nfor _, cfg in ipairs(tr.configs) do\nxcode.XCBuildConfiguration_Target(tr, target, cfg)\nend\nend\nfor _, cfg in ipairs(tr.configs) do\nxcode.XCBuildConfiguration_Project(tr, cfg)\nend\n_p('/* End XCBuildConfiguratio" "n section */')\n_p('')\nend\nfunction xcode.XCBuildConfigurationList(tr)\nlocal sln = tr.project.solution\n_p('/* Begin XCConfigurationList section */')\nfor _, target in ipairs(tr.products.children) do\n_p(2,'%s /* Build configuration list for PBXNativeTarget \"%s\" */ = {', target.cfgsection, target.name)\n_p(3,'isa = XCConfigurationList;')\n_p(3,'buildConfigurations = (')\nfor _, cfg in ipairs(tr.configs) do\n_p(4,'%s /* %s */,', cfg.xcode.targetid, xcode.getconfigname(cfg))\nend\n_p(3,');')\n_p(3,'defaultConfigurationIsVisible = 0;')\n_p(3,'defaultConfigurationName = \"%s\";', xcode.getconfigname(tr.configs[1]))\n_p(2,'};')\nend\n_p(2,'1DEB928908733DD80010E9CD /* Build configuration list for PBXProject \"%s\" */ = {', tr.name)\n_p(3,'isa = XCConfigurationList;')\n_p(3,'buildConfigurations = (')\nfor _, cfg in ipairs(tr.configs) do\n_p(4,'%s /* %s */,', cfg.xcode.projectid, xcode.getconfigname(cfg))\nend\n_p(3,');')\n_p(3,'defaultConfigurationIsVisible = 0;')\n_p(3,'defaultConfigurationName = \"%s\";', xcod" "e.getconfigname(tr.configs[1]))\n_p(2,'};')\n_p('/* End XCConfigurationList section */')\n_p('')\nend\nfunction xcode.Footer()\n_p(1,'};')\n_p('\\trootObject = 08FB7793FE84155DC02AAC07 /* Project object */;')\n_p('}')\nend\n", /* actions/xcode/xcode_project.lua */ "local xcode = premake.xcode\nlocal tree = premake.tree\nfunction xcode.buildprjtree(prj)\nlocal tr = premake.project.buildsourcetree(prj)\ntr.configs = {}\nfor _, cfgname in ipairs(prj.solution.configurations) do\nfor _, platform in ipairs(prj.solution.xcode.platforms) do\nlocal cfg = premake.getconfig(prj, cfgname, platform)\ncfg.xcode = {}\ncfg.xcode.targetid = xcode.newid(prj.xcode.projectnode, cfgname)\ncfg.xcode.projectid = xcode.newid(tr, cfgname)\ntable.insert(tr.configs, cfg)\nend\nend\ntree.traverse(tr, {\nonbranch = function(node)\nif path.getextension(node.name) == \".lproj\" then\nlocal lang = path.getbasename(node.name) -- \"English\", \"French\", etc.\nfor _, filenode in ipairs(node.children) do\nlocal grpnode = node.parent.children[filenode.name]\nif not grpnode then\ngrpnode = tree.insert(node.parent, tree.new(filenode.name))\ngrpnode.kind = \"vgroup\"\nend\nfilenode.name = path.getbasename(lang)\ntree.insert(grpnode, filenode)\nend\ntree.remove(node)\nend\nend\n})\ntr.frameworks = tree.new(\"" "Frameworks\")\nfor cfg in premake.eachconfig(prj) do\nfor _, link in ipairs(premake.getlinks(cfg, \"system\", \"fullpath\")) do\nlocal name = path.getname(link)\nif xcode.isframework(name) and not tr.frameworks.children[name] then\nnode = tree.insert(tr.frameworks, tree.new(name))\nnode.path = link\nend\nend\nend\nif #tr.frameworks.children > 0 then \ntree.insert(tr, tr.frameworks)\nend\ntr.products = tree.insert(tr, tree.new(\"Products\"))\ntr.projects = tree.new(\"Projects\")\nfor _, dep in ipairs(premake.getdependencies(prj, \"sibling\", \"object\")) do\nlocal xcpath = xcode.getxcodeprojname(dep)\nlocal xcnode = tree.insert(tr.projects, tree.new(path.getname(xcpath)))\nxcnode.path = xcpath\nxcnode.project = dep\nxcnode.productgroupid = xcode.newid(xcnode, \"prodgrp\")\nxcnode.productproxyid = xcode.newid(xcnode, \"prodprox\")\nxcnode.targetproxyid = xcode.newid(xcnode, \"targprox\")\nxcnode.targetdependid = xcode.newid(xcnode, \"targdep\")\nlocal cfg = premake.getconfig(dep, prj.configurations[1])\nnode = " "tree.insert(xcnode, tree.new(cfg.linktarget.name))\nnode.path = cfg.linktarget.fullpath\nnode.cfg = cfg\nend\nif #tr.projects.children > 0 then\ntree.insert(tr, tr.projects)\nend\ntree.traverse(tr, {\nonnode = function(node)\nnode.id = xcode.newid(node)\nif xcode.getbuildcategory(node) then\nnode.buildid = xcode.newid(node, \"build\")\nend\nif string.endswith(node.name, \"Info.plist\") then\ntr.infoplist = node\nend\nend\n}, true)\nnode = tree.insert(tr.products, prj.xcode.projectnode)\nnode.kind = \"product\"\nnode.path = node.cfg.buildtarget.fullpath\nnode.cfgsection = xcode.newid(node, \"cfg\")\nnode.resstageid = xcode.newid(node, \"rez\")\nnode.sourcesid = xcode.newid(node, \"src\")\nnode.fxstageid = xcode.newid(node, \"fxs\")\nreturn tr\nend\nfunction premake.xcode.project(prj)\nlocal tr = xcode.buildprjtree(prj)\nxcode.Header(tr)\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(tr)\nxcode.PBXNativeTarget(tr)\nxcode.P" "BXProject(tr)\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr)\nxcode.XCBuildConfigurationList(tr)\nxcode.Footer(tr)\nend\n", /* actions/clean/_clean.lua */ "premake.clean = { }\nfunction premake.clean.directory(obj, pattern)\nlocal fname = premake.project.getfilename(obj, pattern)\nos.rmdir(fname)\nend\nfunction premake.clean.file(obj, pattern)\nlocal fname = premake.project.getfilename(obj, pattern)\nos.remove(fname)\nend\nnewaction {\ntrigger = \"clean\",\ndescription = \"Remove all binaries and generated files\",\nonsolution = function(sln)\nfor action in premake.action.each() do\nif action.oncleansolution then\naction.oncleansolution(sln)\nend\nend\nend,\nonproject = function(prj)\nfor action in premake.action.each() do\nif action.oncleanproject then\naction.oncleanproject(prj)\nend\nend\nif (prj.objectsdir) then\npremake.clean.directory(prj, prj.objectsdir)\nend\nlocal platforms = prj.solution.platforms or { }\nif not table.contains(platforms, \"Native\") then\nplatforms = table.join(platforms, { \"Native\" })\nend\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.clean.directory(prj, cfg.objectsdir)\nprema" "ke.clean.file(prj, premake.gettarget(cfg, \"build\", \"posix\", \"windows\", \"windows\").fullpath)\npremake.clean.file(prj, premake.gettarget(cfg, \"build\", \"posix\", \"posix\", \"linux\").fullpath)\npremake.clean.file(prj, premake.gettarget(cfg, \"build\", \"posix\", \"posix\", \"macosx\").fullpath)\npremake.clean.file(prj, premake.gettarget(cfg, \"build\", \"posix\", \"PS3\", \"windows\").fullpath)\nif cfg.kind == \"WindowedApp\" then\npremake.clean.directory(prj, premake.gettarget(cfg, \"build\", \"posix\", \"posix\", \"linux\").fullpath .. \".app\")\nend\npremake.clean.file(prj, premake.gettarget(cfg, \"link\", \"windows\", \"windows\", \"windows\").fullpath)\npremake.clean.file(prj, premake.gettarget(cfg, \"link\", \"posix\", \"posix\", \"linux\").fullpath)\nlocal target = path.join(premake.project.getfilename(prj, cfg.buildtarget.directory), cfg.buildtarget.basename)\nfor action in premake.action.each() do\nif action.oncleantarget then\naction.oncleantarget(target)\nend\nend\nend\nend\nend\n}\n", /* _premake_main.lua */ "local scriptfile = \"premake4.lua\"\nlocal shorthelp = \"Type 'premake4 --help' for help\"\nlocal versionhelp = \"premake4 (Premake Build Script Generator) %s\"\nlocal function injectplatform(platform)\nif not platform then return true end\nplatform = premake.checkvalue(platform, premake.fields.platforms.allowed)\nfor sln in premake.solution.each() do\nlocal platforms = sln.platforms or { }\nif #platforms == 0 then\ntable.insert(platforms, \"Native\")\nend\nif not table.contains(platforms, \"Native\") then\nreturn false, sln.name .. \" does not target native platform\\nNative platform settings are required for the --platform feature.\"\nend\nif not table.contains(platforms, platform) then\ntable.insert(platforms, platform)\nend\nsln.platforms = platforms\nend\nreturn true\nend\nfunction _premake_main(scriptpath)\nif (scriptpath) then\nlocal scripts = dofile(scriptpath .. \"/_manifest.lua\")\nfor _,v in ipairs(scripts) do\ndofile(scriptpath .. \"/\" .. v)\nend\nend\npremake.action.set(_ACTION)\nmath.r" "andomseed(os.time())\nlocal fname = _OPTIONS[\"file\"] or scriptfile\nif (os.isfile(fname)) then\ndofile(fname)\nend\nif (_OPTIONS[\"version\"]) then\nprintf(versionhelp, _PREMAKE_VERSION)\nreturn 1\nend\nif (_OPTIONS[\"help\"]) then\npremake.showhelp()\nreturn 1\nend\nif (not _ACTION) then\nprint(shorthelp)\nreturn 1\nend\nif (not os.isfile(fname)) then\nerror(\"No Premake script (\"..scriptfile..\") found!\", 2)\nend\naction = premake.action.current()\nif (not action) then\nerror(\"Error: no such action '\" .. _ACTION .. \"'\", 0)\nend\nok, err = premake.option.validate(_OPTIONS)\nif (not ok) then error(\"Error: \" .. err, 0) end\nok, err = premake.checktools()\nif (not ok) then error(\"Error: \" .. err, 0) end\nok, err = injectplatform(_OPTIONS[\"platform\"])\nif (not ok) then error(\"Error: \" .. err, 0) end\nprint(\"Building configurations...\")\npremake.buildconfigs()\nok, err = premake.checkprojects()\nif (not ok) then error(\"Error: \" .. err, 0) end\nprintf(\"Running action '%s'...\", action.trigger)" "\npremake.action.call(action.trigger)\nprint(\"Done.\")\nreturn 0\nend\n", 0 }; premake-4.3-src+repack1/src/host/os_pathsearch.c0000644000000000000000000000314611470465410020352 0ustar rootroot/** * \file os_pathsearch.c * \brief Locates a file, given a set of search paths. * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project * * \note This function is required by the bootstrapping code; it must be * implemented here in the host and not scripted. */ #include #include "premake.h" int os_pathsearch(lua_State* L) { int i; for (i = 2; i <= lua_gettop(L); ++i) { const char* path; if (lua_isnil(L, i)) continue; path = luaL_checkstring(L, i); do { const char* split; /* look for the closest path separator ; or : */ /* can't use : on windows because it breaks on C:\path */ const char* semi = strchr(path, ';'); #if !defined(PLATFORM_WINDOWS) const char* full = strchr(path, ':'); #else const char* full = NULL; #endif if (!semi) { split = full; } else if (!full) { split = semi; } else { split = (semi < full) ? semi : full; } /* push this piece of the full search string onto the stack */ if (split) { lua_pushlstring(L, path, split - path); } else { lua_pushstring(L, path); } /* keep an extra copy around, so I can return it if I have a match */ lua_pushvalue(L, -1); /* append the filename to make the full test path */ lua_pushstring(L, "/"); lua_pushvalue(L, 1); lua_concat(L, 3); /* test it - if it exists return the path */ if (do_isfile(lua_tostring(L, -1))) { lua_pop(L, 1); return 1; } /* no match, set up the next try */ lua_pop(L, 2); path = (split) ? split + 1 : NULL; } while (path); } return 0; } premake-4.3-src+repack1/src/host/os_chdir.c0000644000000000000000000000077211470465410017323 0ustar rootroot/** * \file os_chdir.c * \brief Change the current working directory. * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project */ #include "premake.h" int os_chdir(lua_State* L) { int z; const char* path = luaL_checkstring(L, 1); #if PLATFORM_WINDOWS z = SetCurrentDirectory(path); #else z = !chdir(path); #endif if (!z) { lua_pushnil(L); lua_pushfstring(L, "unable to switch to directory '%s'", path); return 2; } else { lua_pushboolean(L, 1); return 1; } } premake-4.3-src+repack1/src/host/os_copyfile.c0000644000000000000000000000117211470465410020037 0ustar rootroot/** * \file os_copyfile.c * \brief Copy a file from one location to another. * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project */ #include #include "premake.h" int os_copyfile(lua_State* L) { int z; const char* src = luaL_checkstring(L, 1); const char* dst = luaL_checkstring(L, 2); #if PLATFORM_WINDOWS z = CopyFile(src, dst, FALSE); #else lua_pushfstring(L, "cp %s %s", src, dst); z = (system(lua_tostring(L, -1)) == 0); #endif if (!z) { lua_pushnil(L); lua_pushfstring(L, "unable to copy file to '%s'", dst); return 2; } else { lua_pushboolean(L, 1); return 1; } } premake-4.3-src+repack1/src/host/os_match.c0000644000000000000000000000647111470465410017330 0ustar rootroot/** * \file os_match.c * \brief Match files and directories. * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project */ #include #include #include "premake.h" #if PLATFORM_WINDOWS #define WIN32_LEAN_AND_MEAN #include typedef struct struct_MatchInfo { HANDLE handle; int is_first; WIN32_FIND_DATA entry; } MatchInfo; int os_matchstart(lua_State* L) { const char* mask = luaL_checkstring(L, 1); MatchInfo* m = (MatchInfo*)malloc(sizeof(MatchInfo)); m->handle = FindFirstFile(mask, &m->entry); m->is_first = 1; lua_pushlightuserdata(L, m); return 1; } int os_matchdone(lua_State* L) { MatchInfo* m = (MatchInfo*)lua_touserdata(L, 1); if (m->handle != INVALID_HANDLE_VALUE) FindClose(m->handle); free(m); return 0; } int os_matchname(lua_State* L) { MatchInfo* m = (MatchInfo*)lua_touserdata(L, 1); lua_pushstring(L, m->entry.cFileName); return 1; } int os_matchisfile(lua_State* L) { MatchInfo* m = (MatchInfo*)lua_touserdata(L, 1); lua_pushboolean(L, (m->entry.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0); return 1; } int os_matchnext(lua_State* L) { MatchInfo* m = (MatchInfo*)lua_touserdata(L, 1); if (m->handle == INVALID_HANDLE_VALUE) return 0; while (m) /* loop forever */ { if (!m->is_first) { if (!FindNextFile(m->handle, &m->entry)) return 0; } m->is_first = 0; if (m->entry.cFileName[0] != '.') { lua_pushboolean(L, 1); return 1; } } return 0; } #else #include #include #include typedef struct struct_MatchInfo { DIR* handle; struct dirent* entry; char* path; char* mask; } MatchInfo; int os_matchstart(lua_State* L) { const char* split; const char* mask = luaL_checkstring(L, 1); MatchInfo* m = (MatchInfo*)malloc(sizeof(MatchInfo)); /* split the mask into path and filename components */ split = strrchr(mask, '/'); if (split) { m->path = (char*)malloc(split - mask + 1); strncpy(m->path, mask, split - mask); m->path[split - mask] = '\0'; m->mask = (char*)malloc(mask + strlen(mask) - split); strcpy(m->mask, split + 1); } else { m->path = (char*)malloc(2); strcpy(m->path, "."); m->mask = (char*)malloc(strlen(mask)+1); strcpy(m->mask, mask); } m->handle = opendir(m->path); lua_pushlightuserdata(L, m); return 1; } int os_matchdone(lua_State* L) { MatchInfo* m = (MatchInfo*)lua_touserdata(L, 1); if (m->handle != NULL) closedir(m->handle); free(m->path); free(m->mask); free(m); return 0; } int os_matchname(lua_State* L) { MatchInfo* m = (MatchInfo*)lua_touserdata(L, 1); lua_pushstring(L, m->entry->d_name); return 1; } int os_matchisfile(lua_State* L) { struct stat info; const char* fname; MatchInfo* m = (MatchInfo*)lua_touserdata(L, 1); lua_pushfstring(L, "%s/%s", m->path, m->entry->d_name); fname = lua_tostring(L, -1); lua_pop(L, 1); if (stat(fname, &info) == 0) { lua_pushboolean(L, S_ISREG(info.st_mode)); return 1; } return 0; } int os_matchnext(lua_State* L) { MatchInfo* m = (MatchInfo*)lua_touserdata(L, 1); if (m->handle == NULL) return 0; m->entry = readdir(m->handle); while (m->entry != NULL) { const char* name = m->entry->d_name; if (name[0] != '.' && fnmatch(m->mask, name, 0) == 0) { lua_pushboolean(L, 1); return 1; } m->entry = readdir(m->handle); } return 0; } #endif premake-4.3-src+repack1/src/host/premake.h0000644000000000000000000000326211470465410017157 0ustar rootroot/** * \file premake.h * \brief Program-wide constants and definitions. * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project */ #define lua_c #include "lua.h" #include "lauxlib.h" #include "lualib.h" /* Identify the current platform I'm not sure how to reliably detect * Windows but since it is the most common I use it as the default */ #if defined(__linux__) #define PLATFORM_LINUX (1) #define PLATFORM_STRING "linux" #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) #define PLATFORM_BSD (1) #define PLATFORM_STRING "bsd" #elif defined(__APPLE__) && defined(__MACH__) #define PLATFORM_MACOSX (1) #define PLATFORM_STRING "macosx" #elif defined(__sun__) && defined(__svr4__) #define PLATFORM_SOLARIS (1) #define PLATFORM_STRING "solaris" #else #define PLATFORM_WINDOWS (1) #define PLATFORM_STRING "windows" #endif /* Pull in platform-specific headers required by built-in functions */ #if PLATFORM_WINDOWS #define WIN32_LEAN_AND_MEAN #include #else #include #endif /* A success return code */ #define OKAY (0) /* Bootstrapping helper functions */ int do_isfile(const char* filename); /* Built-in functions */ int path_isabsolute(lua_State* L); int os_chdir(lua_State* L); int os_copyfile(lua_State* L); int os_getcwd(lua_State* L); int os_isdir(lua_State* L); int os_isfile(lua_State* L); int os_matchdone(lua_State* L); int os_matchisfile(lua_State* L); int os_matchname(lua_State* L); int os_matchnext(lua_State* L); int os_matchstart(lua_State* L); int os_mkdir(lua_State* L); int os_pathsearch(lua_State* L); int os_rmdir(lua_State* L); int os_uuid(lua_State* L); int string_endswith(lua_State* L); premake-4.3-src+repack1/src/actions/0000755000000000000000000000000011470465410016042 5ustar rootrootpremake-4.3-src+repack1/src/actions/codeblocks/0000755000000000000000000000000011470465410020152 5ustar rootrootpremake-4.3-src+repack1/src/actions/codeblocks/codeblocks_workspace.lua0000644000000000000000000000153611470465410025050 0ustar rootroot-- -- codeblocks_workspace.lua -- Generate a Code::Blocks workspace. -- Copyright (c) 2009 Jason Perkins and the Premake project -- function premake.codeblocks_workspace(sln) _p('') _p('') _p(1,'', sln.name) for prj in premake.solution.eachproject(sln) do local fname = path.join(path.getrelative(sln.location, prj.location), prj.name) local active = iif(prj.project == sln.projects[1], ' active="1"', '') _p(2,'', fname, active) for _,dep in ipairs(premake.getdependencies(prj)) do _p(3,'', path.join(path.getrelative(sln.location, dep.location), dep.name)) end _p(2,'') end _p(1,'') _p('') end premake-4.3-src+repack1/src/actions/codeblocks/_codeblocks.lua0000644000000000000000000000161211470465410023124 0ustar rootroot-- -- _codeblocks.lua -- Define the Code::Blocks action(s). -- Copyright (c) 2002-2009 Jason Perkins and the Premake project -- newaction { trigger = "codeblocks", shortname = "Code::Blocks", description = "Generate Code::Blocks project files", valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" }, valid_languages = { "C", "C++" }, valid_tools = { cc = { "gcc", "ow" }, }, onsolution = function(sln) premake.generate(sln, "%%.workspace", premake.codeblocks_workspace) end, onproject = function(prj) premake.generate(prj, "%%.cbp", premake.codeblocks_cbp) end, oncleansolution = function(sln) premake.clean.file(sln, "%%.workspace") end, oncleanproject = function(prj) premake.clean.file(prj, "%%.cbp") premake.clean.file(prj, "%%.depend") premake.clean.file(prj, "%%.layout") end } premake-4.3-src+repack1/src/actions/codeblocks/codeblocks_cbp.lua0000644000000000000000000001054111470465410023612 0ustar rootroot-- -- codeblocks_cbp.lua -- Generate a Code::Blocks C/C++ project. -- Copyright (c) 2009 Jason Perkins and the Premake project -- function premake.codeblocks_cbp(prj) -- alias the C/C++ compiler interface local cc = premake.gettool(prj) _p('') _p('') _p(1,'') -- write project block header _p(1,'') _p(2,'') _p('') _p('') end premake-4.3-src+repack1/src/actions/make/0000755000000000000000000000000011470465410016757 5ustar rootrootpremake-4.3-src+repack1/src/actions/make/_make.lua0000644000000000000000000000655111470465410020545 0ustar rootroot-- -- _make.lua -- Define the makefile action(s). -- Copyright (c) 2002-2010 Jason Perkins and the Premake project -- _MAKE = { } premake.make = { } -- -- Escape a string so it can be written to a makefile. -- function _MAKE.esc(value) local result if (type(value) == "table") then result = { } for _,v in ipairs(value) do table.insert(result, _MAKE.esc(v)) end return result else -- handle simple replacements result = value:gsub("\\", "\\\\") result = result:gsub(" ", "\\ ") result = result:gsub("%(", "\\%(") result = result:gsub("%)", "\\%)") -- leave $(...) shell replacement sequences alone result = result:gsub("$\\%((.-)\\%)", "$%(%1%)") return result end end -- -- Rules for file ops based on the shell type. Can't use defines and $@ because -- it screws up the escaping of spaces and parethesis (anyone know a solution?) -- function premake.make_copyrule(source, target) _p('%s: %s', target, source) _p('\t@echo Copying $(notdir %s)', target) _p('ifeq (posix,$(SHELLTYPE))') _p('\t$(SILENT) cp -fR %s %s', source, target) _p('else') _p('\t$(SILENT) copy /Y $(subst /,\\\\,%s) $(subst /,\\\\,%s)', source, target) _p('endif') end function premake.make_mkdirrule(var) _p('\t@echo Creating %s', var) _p('ifeq (posix,$(SHELLTYPE))') _p('\t$(SILENT) mkdir -p %s', var) _p('else') _p('\t$(SILENT) mkdir $(subst /,\\\\,%s)', var) _p('endif') _p('') end -- -- Get the makefile file name for a solution or a project. If this object is the -- only one writing to a location then I can use "Makefile". If more than one object -- writes to the same location I use name + ".make" to keep it unique. -- function _MAKE.getmakefilename(this, searchprjs) -- how many projects/solutions use this location? local count = 0 for sln in premake.solution.each() do if (sln.location == this.location) then count = count + 1 end if (searchprjs) then for _,prj in ipairs(sln.projects) do if (prj.location == this.location) then count = count + 1 end end end end if (count == 1) then return "Makefile" else return this.name .. ".make" end end -- -- Returns a list of object names, properly escaped to be included in the makefile. -- function _MAKE.getnames(tbl) local result = table.extract(tbl, "name") for k,v in pairs(result) do result[k] = _MAKE.esc(v) end return result end -- -- Register the "gmake" action -- newaction { trigger = "gmake", shortname = "GNU Make", description = "Generate GNU makefiles for POSIX, MinGW, and Cygwin", valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" }, valid_languages = { "C", "C++", "C#" }, valid_tools = { cc = { "gcc" }, dotnet = { "mono", "msnet", "pnet" }, }, onsolution = function(sln) premake.generate(sln, _MAKE.getmakefilename(sln, false), premake.make_solution) end, onproject = function(prj) local makefile = _MAKE.getmakefilename(prj, true) if premake.isdotnetproject(prj) then premake.generate(prj, makefile, premake.make_csharp) else premake.generate(prj, makefile, premake.make_cpp) end end, oncleansolution = function(sln) premake.clean.file(sln, _MAKE.getmakefilename(sln, false)) end, oncleanproject = function(prj) premake.clean.file(prj, _MAKE.getmakefilename(prj, true)) end } premake-4.3-src+repack1/src/actions/make/make_csharp.lua0000644000000000000000000002023011470465410021734 0ustar rootroot-- -- make_csharp.lua -- Generate a C# project makefile. -- Copyright (c) 2002-2009 Jason Perkins and the Premake project -- -- -- Given a .resx resource file, builds the path to corresponding .resource -- file, matching the behavior and naming of Visual Studio. -- local function getresourcefilename(cfg, fname) if path.getextension(fname) == ".resx" then local name = cfg.buildtarget.basename .. "." local dir = path.getdirectory(fname) if dir ~= "." then name = name .. path.translate(dir, ".") .. "." end return "$(OBJDIR)/" .. _MAKE.esc(name .. path.getbasename(fname)) .. ".resources" else return fname end end -- -- Main function -- function premake.make_csharp(prj) local csc = premake.dotnet -- Do some processing up front: build a list of configuration-dependent libraries. -- Libraries that are built to a location other than $(TARGETDIR) will need to -- be copied so they can be found at runtime. local cfglibs = { } local cfgpairs = { } local anycfg for cfg in premake.eachconfig(prj) do anycfg = cfg cfglibs[cfg] = premake.getlinks(cfg, "siblings", "fullpath") cfgpairs[cfg] = { } for _, fname in ipairs(cfglibs[cfg]) do if path.getdirectory(fname) ~= cfg.buildtarget.directory then cfgpairs[cfg]["$(TARGETDIR)/" .. _MAKE.esc(path.getname(fname))] = _MAKE.esc(fname) end end end -- sort the files into categories, based on their build action local sources = {} local embedded = { } local copypairs = { } for fcfg in premake.eachfile(prj) do local action = csc.getbuildaction(fcfg) if action == "Compile" then table.insert(sources, fcfg.name) elseif action == "EmbeddedResource" then table.insert(embedded, fcfg.name) elseif action == "Content" then copypairs["$(TARGETDIR)/" .. _MAKE.esc(path.getname(fcfg.name))] = _MAKE.esc(fcfg.name) elseif path.getname(fcfg.name):lower() == "app.config" then copypairs["$(TARGET).config"] = _MAKE.esc(fcfg.name) end end -- Any assemblies that are on the library search paths should be copied -- to $(TARGETDIR) so they can be found at runtime local paths = table.translate(prj.libdirs, function(v) return path.join(prj.basedir, v) end) paths = table.join({prj.basedir}, paths) for _, libname in ipairs(premake.getlinks(prj, "system", "fullpath")) do local libdir = os.pathsearch(libname..".dll", unpack(paths)) if (libdir) then local target = "$(TARGETDIR)/" .. _MAKE.esc(path.getname(libname)) local source = path.getrelative(prj.basedir, path.join(libdir, libname))..".dll" copypairs[target] = _MAKE.esc(source) end end -- end of preprocessing -- -- set up the environment _p('# %s project makefile autogenerated by Premake', premake.action.current().shortname) _p('') _p('ifndef config') _p(' config=%s', _MAKE.esc(prj.configurations[1]:lower())) _p('endif') _p('') _p('ifndef verbose') _p(' SILENT = @') _p('endif') _p('') _p('ifndef CSC') _p(' CSC=%s', csc.getcompilervar(prj)) _p('endif') _p('') _p('ifndef RESGEN') _p(' RESGEN=resgen') _p('endif') _p('') -- Platforms aren't support for .NET projects, but I need the ability to match -- the buildcfg:platform identifiers with a block of settings. So enumerate the -- pairs the same way I do for C/C++ projects, but always use the generic settings local platforms = premake.filterplatforms(prj.solution, premake[_OPTIONS.cc].platforms) table.insert(platforms, 1, "") -- write the configuration blocks for cfg in premake.eachconfig(prj) do premake.gmake_cs_config(cfg, csc, cfglibs) end -- set project level values _p('# To maintain compatibility with VS.NET, these values must be set at the project level') _p('TARGET := $(TARGETDIR)/%s', _MAKE.esc(prj.buildtarget.name)) _p('FLAGS += /t:%s %s', csc.getkind(prj):lower(), table.implode(_MAKE.esc(prj.libdirs), "/lib:", "", " ")) _p('REFERENCES += %s', table.implode(_MAKE.esc(premake.getlinks(prj, "system", "basename")), "/r:", ".dll", " ")) _p('') -- list source files _p('SOURCES := \\') for _, fname in ipairs(sources) do _p('\t%s \\', _MAKE.esc(path.translate(fname))) end _p('') _p('EMBEDFILES := \\') for _, fname in ipairs(embedded) do _p('\t%s \\', getresourcefilename(prj, fname)) end _p('') _p('COPYFILES += \\') for target, source in pairs(cfgpairs[anycfg]) do _p('\t%s \\', target) end for target, source in pairs(copypairs) do _p('\t%s \\', target) end _p('') -- identify the shell type _p('SHELLTYPE := msdos') _p('ifeq (,$(ComSpec)$(COMSPEC))') _p(' SHELLTYPE := posix') _p('endif') _p('ifeq (/bin,$(findstring /bin,$(SHELL)))') _p(' SHELLTYPE := posix') _p('endif') _p('') -- main build rule(s) _p('.PHONY: clean prebuild prelink') _p('') _p('all: $(TARGETDIR) $(OBJDIR) prebuild $(EMBEDFILES) $(COPYFILES) prelink $(TARGET)') _p('') _p('$(TARGET): $(SOURCES) $(EMBEDFILES) $(DEPENDS)') _p('\t$(SILENT) $(CSC) /nologo /out:$@ $(FLAGS) $(REFERENCES) $(SOURCES) $(patsubst %%,/resource:%%,$(EMBEDFILES))') _p('\t$(POSTBUILDCMDS)') _p('') -- Create destination directories. Can't use $@ for this because it loses the -- escaping, causing issues with spaces and parenthesis _p('$(TARGETDIR):') premake.make_mkdirrule("$(TARGETDIR)") _p('$(OBJDIR):') premake.make_mkdirrule("$(OBJDIR)") -- clean target _p('clean:') _p('\t@echo Cleaning %s', prj.name) _p('ifeq (posix,$(SHELLTYPE))') _p('\t$(SILENT) rm -f $(TARGETDIR)/%s.* $(COPYFILES)', prj.buildtarget.basename) _p('\t$(SILENT) rm -rf $(OBJDIR)') _p('else') _p('\t$(SILENT) if exist $(subst /,\\\\,$(TARGETDIR)/%s.*) del $(subst /,\\\\,$(TARGETDIR)/%s.*)', prj.buildtarget.basename, prj.buildtarget.basename) for target, source in pairs(cfgpairs[anycfg]) do _p('\t$(SILENT) if exist $(subst /,\\\\,%s) del $(subst /,\\\\,%s)', target, target) end for target, source in pairs(copypairs) do _p('\t$(SILENT) if exist $(subst /,\\\\,%s) del $(subst /,\\\\,%s)', target, target) end _p('\t$(SILENT) if exist $(subst /,\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\,$(OBJDIR))') _p('endif') _p('') -- custom build step targets _p('prebuild:') _p('\t$(PREBUILDCMDS)') _p('') _p('prelink:') _p('\t$(PRELINKCMDS)') _p('') -- per-file rules _p('# Per-configuration copied file rules') for cfg in premake.eachconfig(prj) do _p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower())) for target, source in pairs(cfgpairs[cfg]) do premake.make_copyrule(source, target) end _p('endif') _p('') end _p('# Copied file rules') for target, source in pairs(copypairs) do premake.make_copyrule(source, target) end _p('# Embedded file rules') for _, fname in ipairs(embedded) do if path.getextension(fname) == ".resx" then _p('%s: %s', getresourcefilename(prj, fname), _MAKE.esc(fname)) _p('\t$(SILENT) $(RESGEN) $^ $@') end _p('') end end -- -- Write a block of configuration settings. -- function premake.gmake_cs_config(cfg, csc, cfglibs) _p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower())) _p(' TARGETDIR := %s', _MAKE.esc(cfg.buildtarget.directory)) _p(' OBJDIR := %s', _MAKE.esc(cfg.objectsdir)) _p(' DEPENDS := %s', table.concat(_MAKE.esc(premake.getlinks(cfg, "dependencies", "fullpath")), " ")) _p(' REFERENCES := %s', table.implode(_MAKE.esc(cfglibs[cfg]), "/r:", "", " ")) _p(' FLAGS += %s %s', table.implode(cfg.defines, "/d:", "", " "), table.concat(table.join(csc.getflags(cfg), cfg.buildoptions), " ")) _p(' define PREBUILDCMDS') if #cfg.prebuildcommands > 0 then _p('\t@echo Running pre-build commands') _p('\t%s', table.implode(cfg.prebuildcommands, "", "", "\n\t")) end _p(' endef') _p(' define PRELINKCMDS') if #cfg.prelinkcommands > 0 then _p('\t@echo Running pre-link commands') _p('\t%s', table.implode(cfg.prelinkcommands, "", "", "\n\t")) end _p(' endef') _p(' define POSTBUILDCMDS') if #cfg.postbuildcommands > 0 then _p('\t@echo Running post-build commands') _p('\t%s', table.implode(cfg.postbuildcommands, "", "", "\n\t")) end _p(' endef') _p('endif') _p('') end premake-4.3-src+repack1/src/actions/make/make_cpp.lua0000644000000000000000000001704011470465410021243 0ustar rootroot-- -- make_cpp.lua -- Generate a C/C++ project makefile. -- Copyright (c) 2002-2009 Jason Perkins and the Premake project -- premake.make.cpp = { } local _ = premake.make.cpp function premake.make_cpp(prj) -- create a shortcut to the compiler interface local cc = premake.gettool(prj) -- build a list of supported target platforms that also includes a generic build local platforms = premake.filterplatforms(prj.solution, cc.platforms, "Native") premake.gmake_cpp_header(prj, cc, platforms) for _, platform in ipairs(platforms) do for cfg in premake.eachconfig(prj, platform) do premake.gmake_cpp_config(cfg, cc) end end -- list intermediate files _p('OBJECTS := \\') for _, file in ipairs(prj.files) do if path.iscppfile(file) then _p('\t$(OBJDIR)/%s.o \\', _MAKE.esc(path.getbasename(file))) end end _p('') _p('RESOURCES := \\') for _, file in ipairs(prj.files) do if path.isresourcefile(file) then _p('\t$(OBJDIR)/%s.res \\', _MAKE.esc(path.getbasename(file))) end end _p('') -- identify the shell type _p('SHELLTYPE := msdos') _p('ifeq (,$(ComSpec)$(COMSPEC))') _p(' SHELLTYPE := posix') _p('endif') _p('ifeq (/bin,$(findstring /bin,$(SHELL)))') _p(' SHELLTYPE := posix') _p('endif') _p('') -- main build rule(s) _p('.PHONY: clean prebuild prelink') _p('') if os.is("MacOSX") and prj.kind == "WindowedApp" then _p('all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist') else _p('all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET)') end _p('\t@:') _p('') -- target build rule _p('$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)') _p('\t@echo Linking %s', prj.name) _p('\t$(SILENT) $(LINKCMD)') _p('\t$(POSTBUILDCMDS)') _p('') -- Create destination directories. Can't use $@ for this because it loses the -- escaping, causing issues with spaces and parenthesis _p('$(TARGETDIR):') premake.make_mkdirrule("$(TARGETDIR)") _p('$(OBJDIR):') premake.make_mkdirrule("$(OBJDIR)") -- Mac OS X specific targets if os.is("MacOSX") and prj.kind == "WindowedApp" then _p('$(dir $(TARGETDIR))PkgInfo:') _p('$(dir $(TARGETDIR))Info.plist:') _p('') end -- clean target _p('clean:') _p('\t@echo Cleaning %s', prj.name) _p('ifeq (posix,$(SHELLTYPE))') _p('\t$(SILENT) rm -f $(TARGET)') _p('\t$(SILENT) rm -rf $(OBJDIR)') _p('else') _p('\t$(SILENT) if exist $(subst /,\\\\,$(TARGET)) del $(subst /,\\\\,$(TARGET))') _p('\t$(SILENT) if exist $(subst /,\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\,$(OBJDIR))') _p('endif') _p('') -- custom build step targets _p('prebuild:') _p('\t$(PREBUILDCMDS)') _p('') _p('prelink:') _p('\t$(PRELINKCMDS)') _p('') -- precompiler header rule _.pchrules(prj) -- per-file rules for _, file in ipairs(prj.files) do if path.iscppfile(file) then _p('$(OBJDIR)/%s.o: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file)) _p('\t@echo $(notdir $<)') if (path.iscfile(file)) then _p('\t$(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<"') else _p('\t$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"') end elseif (path.getextension(file) == ".rc") then _p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file)) _p('\t@echo $(notdir $<)') _p('\t$(SILENT) windres $< -O coff -o "$@" $(RESFLAGS)') end end _p('') -- include the dependencies, built by GCC (with the -MMD flag) _p('-include $(OBJECTS:%%.o=%%.d)') end -- -- Write the makefile header -- function premake.gmake_cpp_header(prj, cc, platforms) _p('# %s project makefile autogenerated by Premake', premake.action.current().shortname) -- set up the environment _p('ifndef config') _p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true))) _p('endif') _p('') _p('ifndef verbose') _p(' SILENT = @') _p('endif') _p('') _p('ifndef CC') _p(' CC = %s', cc.cc) _p('endif') _p('') _p('ifndef CXX') _p(' CXX = %s', cc.cxx) _p('endif') _p('') _p('ifndef AR') _p(' AR = %s', cc.ar) _p('endif') _p('') end -- -- Write a block of configuration settings. -- function premake.gmake_cpp_config(cfg, cc) _p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname)) -- if this platform requires a special compiler or linker, list it now local platform = cc.platforms[cfg.platform] if platform.cc then _p(' CC = %s', platform.cc) end if platform.cxx then _p(' CXX = %s', platform.cxx) end if platform.ar then _p(' AR = %s', platform.ar) end _p(' OBJDIR = %s', _MAKE.esc(cfg.objectsdir)) _p(' TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory)) _p(' TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name)) _p(' DEFINES += %s', table.concat(cc.getdefines(cfg.defines), " ")) _p(' INCLUDES += %s', table.concat(cc.getincludedirs(cfg.includedirs), " ")) _p(' CPPFLAGS += %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), " ")) -- set up precompiled headers _.pchconfig(cfg) _p(' CFLAGS += $(CPPFLAGS) $(ARCH) %s', table.concat(table.join(cc.getcflags(cfg), cfg.buildoptions), " ")) _p(' CXXFLAGS += $(CFLAGS) %s', table.concat(cc.getcxxflags(cfg), " ")) _p(' LDFLAGS += %s', table.concat(table.join(cc.getldflags(cfg), cfg.linkoptions, cc.getlibdirflags(cfg)), " ")) _p(' LIBS += %s', table.concat(cc.getlinkflags(cfg), " ")) _p(' RESFLAGS += $(DEFINES) $(INCLUDES) %s', table.concat(table.join(cc.getdefines(cfg.resdefines), cc.getincludedirs(cfg.resincludedirs), cfg.resoptions), " ")) _p(' LDDEPS += %s', table.concat(_MAKE.esc(premake.getlinks(cfg, "siblings", "fullpath")), " ")) if cfg.kind == "StaticLib" then if cfg.platform:startswith("Universal") then _p(' LINKCMD = libtool -o $(TARGET) $(OBJECTS)') else _p(' LINKCMD = $(AR) -rcs $(TARGET) $(OBJECTS)') end else -- this was $(TARGET) $(LDFLAGS) $(OBJECTS) ... but was having trouble linking to certain -- static libraries so $(OBJECTS) was moved up _p(' LINKCMD = $(%s) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS)', iif(cfg.language == "C", "CC", "CXX")) end _p(' define PREBUILDCMDS') if #cfg.prebuildcommands > 0 then _p('\t@echo Running pre-build commands') _p('\t%s', table.implode(cfg.prebuildcommands, "", "", "\n\t")) end _p(' endef') _p(' define PRELINKCMDS') if #cfg.prelinkcommands > 0 then _p('\t@echo Running pre-link commands') _p('\t%s', table.implode(cfg.prelinkcommands, "", "", "\n\t")) end _p(' endef') _p(' define POSTBUILDCMDS') if #cfg.postbuildcommands > 0 then _p('\t@echo Running post-build commands') _p('\t%s', table.implode(cfg.postbuildcommands, "", "", "\n\t")) end _p(' endef') _p('endif') _p('') end -- -- Precompiled header support -- function _.pchconfig(cfg) if not cfg.flags.NoPCH and cfg.pchheader then _p(' PCH = %s', _MAKE.esc(path.getrelative(cfg.location, cfg.pchheader))) _p(' GCH = $(OBJDIR)/%s.gch', _MAKE.esc(path.getname(cfg.pchheader))) _p(' CPPFLAGS += -I$(OBJDIR) -include $(OBJDIR)/%s', _MAKE.esc(path.getname(cfg.pchheader))) end end function _.pchrules(prj) _p('ifneq (,$(PCH))') _p('$(GCH): $(PCH)') _p('\t@echo $(notdir $<)') _p('\t-$(SILENT) cp $< $(OBJDIR)') if prj.language == "C" then _p('\t$(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<"') else _p('\t$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"') end _p('endif') _p('') end premake-4.3-src+repack1/src/actions/make/make_solution.lua0000644000000000000000000000447311470465410022343 0ustar rootroot-- -- make_solution.lua -- Generate a solution-level makefile. -- Copyright (c) 2002-2009 Jason Perkins and the Premake project -- function premake.make_solution(sln) -- create a shortcut to the compiler interface local cc = premake[_OPTIONS.cc] -- build a list of supported target platforms that also includes a generic build local platforms = premake.filterplatforms(sln, cc.platforms, "Native") -- write a header showing the build options _p('# %s solution makefile autogenerated by Premake', premake.action.current().shortname) _p('# Type "make help" for usage help') _p('') -- set a default configuration _p('ifndef config') _p(' config=%s', _MAKE.esc(premake.getconfigname(sln.configurations[1], platforms[1], true))) _p('endif') _p('export config') _p('') -- list the projects included in the solution _p('PROJECTS := %s', table.concat(_MAKE.esc(table.extract(sln.projects, "name")), " ")) _p('') _p('.PHONY: all clean help $(PROJECTS)') _p('') _p('all: $(PROJECTS)') _p('') -- write the project build rules for _, prj in ipairs(sln.projects) do _p('%s: %s', _MAKE.esc(prj.name), table.concat(_MAKE.esc(table.extract(premake.getdependencies(prj), "name")), " ")) _p('\t@echo "==== Building %s ($(config)) ===="', prj.name) _p('\t@${MAKE} --no-print-directory -C %s -f %s', _MAKE.esc(path.getrelative(sln.location, prj.location)), _MAKE.esc(_MAKE.getmakefilename(prj, true))) _p('') end -- clean rules _p('clean:') for _ ,prj in ipairs(sln.projects) do _p('\t@${MAKE} --no-print-directory -C %s -f %s clean', _MAKE.esc(path.getrelative(sln.location, prj.location)), _MAKE.esc(_MAKE.getmakefilename(prj, true))) end _p('') -- help rule _p('help:') _p(1,'@echo "Usage: make [config=name] [target]"') _p(1,'@echo ""') _p(1,'@echo "CONFIGURATIONS:"') local cfgpairs = { } for _, platform in ipairs(platforms) do for _, cfgname in ipairs(sln.configurations) do _p(1,'@echo " %s"', premake.getconfigname(cfgname, platform, true)) end end _p(1,'@echo ""') _p(1,'@echo "TARGETS:"') _p(1,'@echo " all (default)"') _p(1,'@echo " clean"') for _, prj in ipairs(sln.projects) do _p(1,'@echo " %s"', prj.name) end _p(1,'@echo ""') _p(1,'@echo "For more information, see http://industriousone.com/premake/quick-start"') end premake-4.3-src+repack1/src/actions/vstudio/0000755000000000000000000000000011470465410017537 5ustar rootrootpremake-4.3-src+repack1/src/actions/vstudio/vs2002_solution.lua0000644000000000000000000000276511470465410023144 0ustar rootroot-- -- vs2002_solution.lua -- Generate a Visual Studio 2002 solution. -- Copyright (c) 2009 Jason Perkins and the Premake project -- function premake.vs2002_solution(sln) io.eol = '\r\n' -- Precompute Visual Studio configurations sln.vstudio_configs = premake.vstudio_buildconfigs(sln) _p('Microsoft Visual Studio Solution File, Format Version 7.00') -- Write out the list of project entries for prj in premake.solution.eachproject(sln) do local projpath = path.translate(path.getrelative(sln.location, _VS.projectfile(prj))) _p('Project("{%s}") = "%s", "%s", "{%s}"', _VS.tool(prj), prj.name, projpath, prj.uuid) _p('EndProject') end _p('Global') _p(1,'GlobalSection(SolutionConfiguration) = preSolution') for i, cfgname in ipairs(sln.configurations) do _p(2,'ConfigName.%d = %s', i - 1, cfgname) end _p(1,'EndGlobalSection') _p(1,'GlobalSection(ProjectDependencies) = postSolution') _p(1,'EndGlobalSection') _p(1,'GlobalSection(ProjectConfiguration) = postSolution') for prj in premake.solution.eachproject(sln) do for _, cfgname in ipairs(sln.configurations) do _p(2,'{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfgname, cfgname, _VS.arch(prj)) _p(2,'{%s}.%s.Build.0 = %s|%s', prj.uuid, cfgname, cfgname, _VS.arch(prj)) end end _p(1,'EndGlobalSection') _p(1,'GlobalSection(ExtensibilityGlobals) = postSolution') _p(1,'EndGlobalSection') _p(1,'GlobalSection(ExtensibilityAddIns) = postSolution') _p(1,'EndGlobalSection') _p('EndGlobal') end premake-4.3-src+repack1/src/actions/vstudio/vs2005_solution.lua0000644000000000000000000000622611470465410023143 0ustar rootroot-- -- vs2005_solution.lua -- Generate a Visual Studio 2005 or 2008 solution. -- Copyright (c) 2009 Jason Perkins and the Premake project -- function premake.vs2005_solution(sln) io.eol = '\r\n' -- Precompute Visual Studio configurations sln.vstudio_configs = premake.vstudio_buildconfigs(sln) -- Mark the file as Unicode _p('\239\187\191') -- Write the solution file version header _p('Microsoft Visual Studio Solution File, Format Version %s', iif(_ACTION == 'vs2005', '9.00', '10.00')) _p('# Visual Studio %s', iif(_ACTION == 'vs2005', '2005', '2008')) -- Write out the list of project entries for prj in premake.solution.eachproject(sln) do -- Build a relative path from the solution file to the project file local projpath = path.translate(path.getrelative(sln.location, _VS.projectfile(prj)), "\\") _p('Project("{%s}") = "%s", "%s", "{%s}"', _VS.tool(prj), prj.name, projpath, prj.uuid) local deps = premake.getdependencies(prj) if #deps > 0 then _p('\tProjectSection(ProjectDependencies) = postProject') for _, dep in ipairs(deps) do _p('\t\t{%s} = {%s}', dep.uuid, dep.uuid) end _p('\tEndProjectSection') end _p('EndProject') end _p('Global') premake.vs2005_solution_platforms(sln) premake.vs2005_solution_project_platforms(sln) premake.vs2005_solution_properties(sln) _p('EndGlobal') end -- -- Write out the contents of the SolutionConfigurationPlatforms section, which -- lists all of the configuration/platform pairs that exist in the solution. -- function premake.vs2005_solution_platforms(sln) _p('\tGlobalSection(SolutionConfigurationPlatforms) = preSolution') for _, cfg in ipairs(sln.vstudio_configs) do _p('\t\t%s = %s', cfg.name, cfg.name) end _p('\tEndGlobalSection') end -- -- Write out the contents of the ProjectConfigurationPlatforms section, which maps -- the configuration/platform pairs into each project of the solution. -- function premake.vs2005_solution_project_platforms(sln) _p('\tGlobalSection(ProjectConfigurationPlatforms) = postSolution') for prj in premake.solution.eachproject(sln) do for _, cfg in ipairs(sln.vstudio_configs) do -- .NET projects always map to the "Any CPU" platform (for now, at -- least). For C++, "Any CPU" and "Mixed Platforms" map to the first -- C++ compatible target platform in the solution list. local mapped if premake.isdotnetproject(prj) then mapped = "Any CPU" else if cfg.platform == "Any CPU" or cfg.platform == "Mixed Platforms" then mapped = sln.vstudio_configs[3].platform else mapped = cfg.platform end end _p('\t\t{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped) if mapped == cfg.platform or cfg.platform == "Mixed Platforms" then _p('\t\t{%s}.%s.Build.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped) end end end _p('\tEndGlobalSection') end -- -- Write out contents of the SolutionProperties section; currently unused. -- function premake.vs2005_solution_properties(sln) _p('\tGlobalSection(SolutionProperties) = preSolution') _p('\t\tHideSolutionNode = FALSE') _p('\tEndGlobalSection') end premake-4.3-src+repack1/src/actions/vstudio/vs2005_csproj.lua0000644000000000000000000001640211470465410022564 0ustar rootroot-- -- vs2005_csproj.lua -- Generate a Visual Studio 2005/2008 C# project. -- Copyright (c) 2009-2010 Jason Perkins and the Premake project -- -- -- Set up namespaces -- premake.vstudio.cs2005 = { } local vstudio = premake.vstudio local cs2005 = premake.vstudio.cs2005 -- -- Figure out what elements a particular source code file need in its item -- block, based on its build action and any related files in the project. -- local function getelements(prj, action, fname) if action == "Compile" and fname:endswith(".cs") then if fname:endswith(".Designer.cs") then -- is there a matching *.cs file? local basename = fname:sub(1, -13) local testname = basename .. ".cs" if premake.findfile(prj, testname) then return "Dependency", testname end -- is there a matching *.resx file? testname = basename .. ".resx" if premake.findfile(prj, testname) then return "AutoGen", testname end else -- is there a *.Designer.cs file? local basename = fname:sub(1, -4) local testname = basename .. ".Designer.cs" if premake.findfile(prj, testname) then return "SubTypeForm" end end end if action == "EmbeddedResource" and fname:endswith(".resx") then -- is there a matching *.cs file? local basename = fname:sub(1, -6) local testname = path.getname(basename .. ".cs") if premake.findfile(prj, testname) then if premake.findfile(prj, basename .. ".Designer.cs") then return "DesignerType", testname else return "Dependency", testname end else -- is there a matching *.Designer.cs? testname = path.getname(basename .. ".Designer.cs") if premake.findfile(prj, testname) then return "AutoGenerated" end end end if action == "Content" then return "CopyNewest" end return "None" end -- -- Write the opening element and project level block. -- function cs2005.projectelement(prj) _p('', iif(_ACTION == 'vs2005', '', ' ToolsVersion="3.5"')) end function cs2005.projectsettings(prj) _p(' ') _p(' %s', premake.esc(prj.solution.configurations[1])) _p(' AnyCPU') _p(' %s', iif(_ACTION == "vs2005", "8.0.50727", "9.0.21022")) _p(' 2.0') _p(' {%s}', prj.uuid) _p(' %s', premake.dotnet.getkind(prj)) _p(' Properties') _p(' %s', prj.buildtarget.basename) _p(' %s', prj.buildtarget.basename) if prj.framework then _p(' v%s', prj.framework) end _p(' ') end -- -- The main function: write the project file. -- function premake.vs2005_csproj(prj) io.eol = "\r\n" local vsversion, toolversion if _ACTION == "vs2005" then vsversion = "8.0.50727" toolversion = nil elseif _ACTION == "vs2008" then vsversion = "9.0.21022" toolversion = "3.5" end if toolversion then _p('', toolversion) else _p('') end _p(' ') _p(' %s', premake.esc(prj.solution.configurations[1])) _p(' AnyCPU') _p(' %s', vsversion) _p(' 2.0') _p(' {%s}', prj.uuid) _p(' %s', premake.dotnet.getkind(prj)) _p(' Properties') _p(' %s', prj.buildtarget.basename) _p(' %s', prj.buildtarget.basename) _p(' ') for cfg in premake.eachconfig(prj) do _p(' ', premake.esc(cfg.name)) if cfg.flags.Symbols then _p(' true') _p(' full') else _p(' pdbonly') end _p(' %s', iif(cfg.flags.Optimize or cfg.flags.OptimizeSize or cfg.flags.OptimizeSpeed, "true", "false")) _p(' %s', cfg.buildtarget.directory) _p(' %s', table.concat(premake.esc(cfg.defines), ";")) _p(' prompt') _p(' 4') if cfg.flags.Unsafe then _p(' true') end if cfg.flags.FatalWarnings then _p(' true') end _p(' ') end _p(' ') for _, ref in ipairs(premake.getlinks(prj, "siblings", "object")) do _p(' ', path.translate(path.getrelative(prj.location, _VS.projectfile(ref)), "\\")) _p(' {%s}', ref.uuid) _p(' %s', premake.esc(ref.name)) _p(' ') end for _, linkname in ipairs(premake.getlinks(prj, "system", "basename")) do _p(' ', premake.esc(linkname)) end _p(' ') _p(' ') for fcfg in premake.eachfile(prj) do local action = premake.dotnet.getbuildaction(fcfg) local fname = path.translate(premake.esc(fcfg.name), "\\") local elements, dependency = getelements(prj, action, fcfg.name) if elements == "None" then _p(' <%s Include="%s" />', action, fname) else _p(' <%s Include="%s">', action, fname) if elements == "AutoGen" then _p(' True') elseif elements == "AutoGenerated" then _p(' Designer') _p(' ResXFileCodeGenerator') _p(' %s.Designer.cs', premake.esc(path.getbasename(fcfg.name))) elseif elements == "SubTypeDesigner" then _p(' Designer') elseif elements == "SubTypeForm" then _p(' Form') elseif elements == "PreserveNewest" then _p(' PreserveNewest') end if dependency then _p(' %s', path.translate(premake.esc(dependency), "\\")) end _p(' ', action) end end _p(' ') _p(' ') _p(' ') _p('') end premake-4.3-src+repack1/src/actions/vstudio/vs_generic_solution.lua0000644000000000000000000000305311470465410024323 0ustar rootroot local vs_format_version = function() local t = { vs2005 = '9.00', vs2008 = '10.00', vs2010 = '11.00' } return t[_ACTION] end local vs_version = function() local t = { vs2005 = '2005', vs2008 = '2008', vs2010 = '2010' } return t[_ACTION] end local vs_write_version_info = function() _p('Microsoft Visual Studio Solution File, Format Version %s', vs_format_version()) _p('# Visual Studio %s', vs_version() ) end local vs_write_projects = function(sln) -- Write out the list of project entries for prj in premake.solution.eachproject(sln) do -- Build a relative path from the solution file to the project file local projpath = path.translate(path.getrelative(sln.location, _VS.projectfile(prj)), "\\") _p('Project("{%s}") = "%s", "%s", "{%s}"', _VS.tool(prj), prj.name, projpath, prj.uuid) local deps = premake.getdependencies(prj) if #deps > 0 then _p('\tProjectSection(ProjectDependencies) = postProject') for _, dep in ipairs(deps) do _p('\t\t{%s} = {%s}', dep.uuid, dep.uuid) end _p('\tEndProjectSection') end _p('EndProject') end end local vs_write_pre_version = function(sln) io.eol = '\r\n' sln.vstudio_configs = premake.vstudio_buildconfigs(sln) -- Mark the file as Unicode _p('\239\187\191') end function premake.vs_generic_solution(sln) vs_write_pre_version(sln) vs_write_version_info() vs_write_projects(sln) _p('Global') premake.vs2005_solution_platforms(sln) premake.vs2005_solution_project_platforms(sln) premake.vs2005_solution_properties(sln) _p('EndGlobal') endpremake-4.3-src+repack1/src/actions/vstudio/vs2005_csproj_user.lua0000644000000000000000000000110611470465410023615 0ustar rootroot-- -- vs2005_csproj_user.lua -- Generate a Visual Studio 2005/2008 C# .user file. -- Copyright (c) 2009 Jason Perkins and the Premake project -- function premake.vs2005_csproj_user(prj) io.eol = "\r\n" _p('') _p(' ') local refpaths = table.translate(prj.libdirs, function(v) return path.getabsolute(prj.location .. "/" .. v) end) _p(' %s', path.translate(table.concat(refpaths, ";"), "\\")) _p(' ') _p('') end premake-4.3-src+repack1/src/actions/vstudio/_vstudio.lua0000644000000000000000000002655411470465410022112 0ustar rootroot-- -- _vstudio.lua -- Define the Visual Studio 200x actions. -- Copyright (c) 2008-2010 Jason Perkins and the Premake project -- _VS = { } -- deprecated, will remove eventually premake.vstudio = { } local vstudio = premake.vstudio -- -- Map Premake platform identifiers to the Visual Studio versions. Adds the Visual -- Studio specific "any" and "mixed" to make solution generation easier. -- premake.vstudio_platforms = { any = "Any CPU", mixed = "Mixed Platforms", Native = "Win32", x32 = "Win32", x64 = "x64", PS3 = "PS3", Xbox360 = "Xbox 360", } -- -- Returns the architecture identifier for a project. -- function _VS.arch(prj) if (prj.language == "C#") then if (_ACTION < "vs2005") then return ".NET" else return "Any CPU" end else return "Win32" end end -- -- Return the version-specific text for a boolean value. -- (this should probably go in vs200x_vcproj.lua) -- function _VS.bool(value) if (_ACTION < "vs2005") then return iif(value, "TRUE", "FALSE") else return iif(value, "true", "false") end end -- -- Process the solution's list of configurations and platforms, creates a list -- of build configuration/platform pairs in a Visual Studio compatible format. -- -- @param sln -- The solution containing the configuration and platform lists. -- @param with_pseudo -- If true, Visual Studio's "Any CPU" and "Mixed Platforms" platforms will -- be added for .NET and mixed mode solutions. -- -- -- Process the solution's list of configurations and platforms, creates a list -- of build configuration/platform pairs in a Visual Studio compatible format. -- -- @param sln -- The solution containing the configuration and platform lists. -- function premake.vstudio_buildconfigs(sln) local cfgs = { } local platforms = premake.filterplatforms(sln, premake.vstudio_platforms, "Native") -- .NET projects add "Any CPU", mixed mode solutions add "Mixed Platforms" local hascpp = premake.hascppproject(sln) local hasdotnet = premake.hasdotnetproject(sln) if hasdotnet then table.insert(platforms, 1, "any") end if hasdotnet and hascpp then table.insert(platforms, 2, "mixed") end for _, buildcfg in ipairs(sln.configurations) do for _, platform in ipairs(platforms) do local entry = { } entry.src_buildcfg = buildcfg entry.src_platform = platform -- PS3 is funky and needs special handling; it's more of a build -- configuration than a platform from Visual Studio's point of view if platform ~= "PS3" then entry.buildcfg = buildcfg entry.platform = premake.vstudio_platforms[platform] else entry.buildcfg = platform .. " " .. buildcfg entry.platform = "Win32" end -- create a name the way VS likes it entry.name = entry.buildcfg .. "|" .. entry.platform -- flag the "fake" platforms added for .NET entry.isreal = (platform ~= "any" and platform ~= "mixed") table.insert(cfgs, entry) end end return cfgs end -- -- Return a configuration type index. -- (this should probably go in vs200x_vcproj.lua) -- function _VS.cfgtype(cfg) if (cfg.kind == "SharedLib") then return 2 elseif (cfg.kind == "StaticLib") then return 4 else return 1 end end -- -- Clean Visual Studio files -- function premake.vstudio.cleansolution(sln) premake.clean.file(sln, "%%.sln") premake.clean.file(sln, "%%.suo") premake.clean.file(sln, "%%.ncb") -- MonoDevelop files premake.clean.file(sln, "%%.userprefs") premake.clean.file(sln, "%%.usertasks") end function premake.vstudio.cleanproject(prj) local fname = premake.project.getfilename(prj, "%%") os.remove(fname .. ".vcproj") os.remove(fname .. ".vcproj.user") os.remove(fname .. ".vcxproj") os.remove(fname .. ".vcxproj.user") os.remove(fname .. ".vcxproj.filters") os.remove(fname .. ".csproj") os.remove(fname .. ".csproj.user") os.remove(fname .. ".pidb") os.remove(fname .. ".sdf") end function premake.vstudio.cleantarget(name) os.remove(name .. ".pdb") os.remove(name .. ".idb") os.remove(name .. ".ilk") os.remove(name .. ".vshost.exe") os.remove(name .. ".exe.manifest") end -- -- Write out entries for the files element; called from premake.walksources(). -- (this should probably go in vs200x_vcproj.lua) -- local function output(indent, value) -- io.write(indent .. value .. "\r\n") _p(indent .. value) end local function attrib(indent, name, value) -- io.write(indent .. "\t" .. name .. '="' .. value .. '"\r\n') _p(indent .. "\t" .. name .. '="' .. value .. '"') end function _VS.files(prj, fname, state, nestlevel) local indent = string.rep("\t", nestlevel + 2) if (state == "GroupStart") then output(indent, "") elseif (state == "GroupEnd") then output(indent, "") else output(indent, "") if (not prj.flags.NoPCH and prj.pchsource == fname) then for _, cfginfo in ipairs(prj.solution.vstudio_configs) do if cfginfo.isreal then local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) output(indent, "\t") output(indent, "\t\t") output(indent, "\t") end end end output(indent, "") end end -- -- Return the optimization code. -- (this should probably go in vs200x_vcproj.lua) -- function _VS.optimization(cfg) local result = 0 for _, value in ipairs(cfg.flags) do if (value == "Optimize") then result = 3 elseif (value == "OptimizeSize") then result = 1 elseif (value == "OptimizeSpeed") then result = 2 end end return result end -- -- Assemble the project file name. -- function _VS.projectfile(prj) local extension if (prj.language == "C#") then extension = ".csproj" elseif (_ACTION == "vs2010" and prj.language == "C++" )then extension = ".vcxproj" elseif (_ACTION == "vs2010" and prj.language == "C" )then extension = ".vcxproj" else extension = ".vcproj" end local fname = path.join(prj.location, prj.name) return fname..extension end -- -- Returns the Visual Studio tool ID for a given project type. -- function _VS.tool(prj) if (prj.language == "C#") then return "FAE04EC0-301F-11D3-BF4B-00C04F79EFBC" else return "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942" end end -- -- Register the Visual Studio command line actions -- newaction { trigger = "vs2002", shortname = "Visual Studio 2002", description = "Generate Microsoft Visual Studio 2002 project files", os = "windows", valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" }, valid_languages = { "C", "C++", "C#" }, valid_tools = { cc = { "msc" }, dotnet = { "msnet" }, }, onsolution = function(sln) premake.generate(sln, "%%.sln", premake.vs2002_solution) end, onproject = function(prj) if premake.isdotnetproject(prj) then premake.generate(prj, "%%.csproj", premake.vs2002_csproj) premake.generate(prj, "%%.csproj.user", premake.vs2002_csproj_user) else premake.generate(prj, "%%.vcproj", premake.vs200x_vcproj) end end, oncleansolution = premake.vstudio.cleansolution, oncleanproject = premake.vstudio.cleanproject, oncleantarget = premake.vstudio.cleantarget } newaction { trigger = "vs2003", shortname = "Visual Studio 2003", description = "Generate Microsoft Visual Studio 2003 project files", os = "windows", valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" }, valid_languages = { "C", "C++", "C#" }, valid_tools = { cc = { "msc" }, dotnet = { "msnet" }, }, onsolution = function(sln) premake.generate(sln, "%%.sln", premake.vs2003_solution) end, onproject = function(prj) if premake.isdotnetproject(prj) then premake.generate(prj, "%%.csproj", premake.vs2002_csproj) premake.generate(prj, "%%.csproj.user", premake.vs2002_csproj_user) else premake.generate(prj, "%%.vcproj", premake.vs200x_vcproj) end end, oncleansolution = premake.vstudio.cleansolution, oncleanproject = premake.vstudio.cleanproject, oncleantarget = premake.vstudio.cleantarget } newaction { trigger = "vs2005", shortname = "Visual Studio 2005", description = "Generate Microsoft Visual Studio 2005 project files", os = "windows", valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" }, valid_languages = { "C", "C++", "C#" }, valid_tools = { cc = { "msc" }, dotnet = { "msnet" }, }, onsolution = function(sln) premake.generate(sln, "%%.sln", premake.vs2005_solution) end, onproject = function(prj) if premake.isdotnetproject(prj) then premake.generate(prj, "%%.csproj", premake.vs2005_csproj) premake.generate(prj, "%%.csproj.user", premake.vs2005_csproj_user) else premake.generate(prj, "%%.vcproj", premake.vs200x_vcproj) end end, oncleansolution = premake.vstudio.cleansolution, oncleanproject = premake.vstudio.cleanproject, oncleantarget = premake.vstudio.cleantarget } newaction { trigger = "vs2008", shortname = "Visual Studio 2008", description = "Generate Microsoft Visual Studio 2008 project files", os = "windows", valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" }, valid_languages = { "C", "C++", "C#" }, valid_tools = { cc = { "msc" }, dotnet = { "msnet" }, }, onsolution = function(sln) premake.generate(sln, "%%.sln", premake.vs2005_solution) end, onproject = function(prj) if premake.isdotnetproject(prj) then premake.generate(prj, "%%.csproj", premake.vs2005_csproj) premake.generate(prj, "%%.csproj.user", premake.vs2005_csproj_user) else premake.generate(prj, "%%.vcproj", premake.vs200x_vcproj) end end, oncleansolution = premake.vstudio.cleansolution, oncleanproject = premake.vstudio.cleanproject, oncleantarget = premake.vstudio.cleantarget } newaction { trigger = "vs2010", shortname = "Visual Studio 2010", description = "Generate Visual Studio 2010 project files (experimental)", os = "windows", valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" }, valid_languages = { "C++","C"}, valid_tools = { cc = { "msc" }, --dotnet = { "msnet" }, }, onsolution = function(sln) premake.generate(sln, "%%.sln", premake.vs_generic_solution) end, onproject = function(prj) premake.generate(prj, "%%.vcxproj", premake.vs2010_vcxproj) premake.generate(prj, "%%.vcxproj.user", premake.vs2010_vcxproj_user) premake.generate(prj, "%%.vcxproj.filters", premake.vs2010_vcxproj_filters) end, oncleansolution = premake.vstudio.cleansolution, oncleanproject = premake.vstudio.cleanproject, oncleantarget = premake.vstudio.cleantarget }premake-4.3-src+repack1/src/actions/vstudio/vs2010_vcxproxj.lua0000644000000000000000000004642211470465410023150 0ustar rootroot premake.vstudio.vs10_helpers = { } local vs10_helpers = premake.vstudio.vs10_helpers function vs10_helpers.remove_relative_path(file) file = file:gsub("%.%.\\",'') file = file:gsub("%.\\",'') return file end function vs10_helpers.file_path(file) file = vs10_helpers.remove_relative_path(file) local path = string.find(file,'\\[%w%.%_%-]+$') if path then return string.sub(file,1,path-1) else return nil end end function vs10_helpers.list_of_directories_in_path(path) local list={} path = vs10_helpers.remove_relative_path(path) if path then for dir in string.gmatch(path,"[%w%-%_%.]+\\")do if #list == 0 then list[1] = dir:sub(1,#dir-1) else list[#list +1] = list[#list] .."\\" ..dir:sub(1,#dir-1) end end end return list end function vs10_helpers.table_of_file_filters(files) local filters ={} for _, valueTable in pairs(files) do for _, entry in ipairs(valueTable) do local result = vs10_helpers.list_of_directories_in_path(entry) for __,dir in ipairs(result) do if table.contains(filters,dir) ~= true then filters[#filters +1] = dir end end end end return filters end function vs10_helpers.get_file_extension(file) local ext_start,ext_end = string.find(file,"%.[%w_%-]+$") if ext_start then return string.sub(file,ext_start+1,ext_end) end end --also translates file paths from '/' to '\\' function vs10_helpers.sort_input_files(files,sorted_container) local types = { h = "ClInclude", hpp = "ClInclude", hxx = "ClInclude", c = "ClCompile", cpp = "ClCompile", cxx = "ClCompile", cc = "ClCompile", rc = "ResourceCompile" } for _, current_file in ipairs(files) do local translated_path = path.translate(current_file, '\\') local ext = vs10_helpers.get_file_extension(translated_path) if ext then local type = types[ext] if type then table.insert(sorted_container[type],translated_path) else table.insert(sorted_container.None,translated_path) end end end end local function vs2010_config(prj) _p(1,'') for _, cfginfo in ipairs(prj.solution.vstudio_configs) do _p(2,'', premake.esc(cfginfo.name)) _p(3,'%s',cfginfo.buildcfg) _p(3,'%s',cfginfo.platform) _p(2,'') end _p(1,'') end local function vs2010_globals(prj) _p(1,'') _p(2,'{%s}',prj.uuid) _p(2,'%s',prj.name) _p(2,'Win32Proj') _p(1,'') end function vs10_helpers.config_type(config) local t = { SharedLib = "DynamicLibrary", StaticLib = "StaticLibrary", ConsoleApp = "Application", WindowedApp = "Application" } return t[config.kind] end local function if_config_and_platform() return 'Condition="\'$(Configuration)|$(Platform)\'==\'%s\'"' end local function optimisation(cfg) local result = "Disabled" for _, value in ipairs(cfg.flags) do if (value == "Optimize") then result = "Full" elseif (value == "OptimizeSize") then result = "MinSpace" elseif (value == "OptimizeSpeed") then result = "MaxSpeed" end end return result end local function config_type_block(prj) for _, cfginfo in ipairs(prj.solution.vstudio_configs) do local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) _p(1,'' , premake.esc(cfginfo.name)) _p(2,'%s',vs10_helpers.config_type(cfg)) _p(2,'%s',iif(cfg.flags.Unicode,"Unicode","MultiByte")) if cfg.flags.MFC then _p(2,'Dynamic') end local use_debug = "false" if optimisation(cfg) == "Disabled" then use_debug = "true" else _p(2,'true') end _p(2,'%s',use_debug) _p(1,'') end end local function import_props(prj) for _, cfginfo in ipairs(prj.solution.vstudio_configs) do local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) _p(1,'' ,premake.esc(cfginfo.name)) _p(2,'') _p(1,'') end end local function incremental_link(cfg,cfginfo) if cfg.kind ~= "StaticLib" then ShoudLinkIncrementally = 'false' if optimisation(cfg) == "Disabled" then ShoudLinkIncrementally = 'true' end _p(2,'%s' ,premake.esc(cfginfo.name),ShoudLinkIncrementally) end end local function ignore_import_lib(cfg,cfginfo) if cfg.kind == "SharedLib" then local shouldIgnore = "false" if cfg.flags.NoImportLib then shouldIgnore = "true" end _p(2,'%s' ,premake.esc(cfginfo.name),shouldIgnore) end end local function intermediate_and_out_dirs(prj) _p(1,'') _p(2,'<_ProjectFileVersion>10.0.30319.1') for _, cfginfo in ipairs(prj.solution.vstudio_configs) do local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) _p(2,'%s\\' , premake.esc(cfginfo.name),premake.esc(cfg.buildtarget.directory) ) _p(2,'%s\\' , premake.esc(cfginfo.name), premake.esc(cfg.objectsdir)) _p(2,'%s' ,premake.esc(cfginfo.name),path.getbasename(cfg.buildtarget.name)) ignore_import_lib(cfg,cfginfo) incremental_link(cfg,cfginfo) if cfg.flags.NoManifest then _p(2,'false' ,premake.esc(cfginfo.name)) end end _p(1,'') end local function runtime(cfg) local runtime if premake.config.isdebugbuild(cfg) then runtime = iif(cfg.flags.StaticRuntime,"MultiThreadedDebug", "MultiThreadedDebugDLL") else runtime = iif(cfg.flags.StaticRuntime, "MultiThreaded", "MultiThreadedDLL") end return runtime end local function precompiled_header(cfg) if not cfg.flags.NoPCH and cfg.pchheader then _p(3,'Use') _p(3,'%s', path.getname(cfg.pchheader)) else _p(3,'') end end local function preprocessor(indent,cfg) if #cfg.defines > 0 then _p(indent,'%s;%%(PreprocessorDefinitions)' ,premake.esc(table.concat(cfg.defines, ";"))) else _p(indent,'') end end local function include_dirs(indent,cfg) if #cfg.includedirs > 0 then _p(indent,'%s;%%(AdditionalIncludeDirectories)' ,premake.esc(path.translate(table.concat(cfg.includedirs, ";"), '\\'))) end end local function resource_compile(cfg) _p(2,'') preprocessor(3,cfg) include_dirs(3,cfg) _p(2,'') end local function exceptions(cfg) if cfg.flags.NoExceptions then _p(2,'false') elseif cfg.flags.SEH then _p(2,'Async') end end local function rtti(cfg) if cfg.flags.NoRTTI then _p(3,'false') end end local function wchar_t_buildin(cfg) if cfg.flags.NativeWChar then _p(3,'true') elseif cfg.flags.NoNativeWChar then _p(3,'false') end end local function sse(cfg) if cfg.flags.EnableSSE then _p(3,'StreamingSIMDExtensions') elseif cfg.flags.EnableSSE2 then _p(3,'StreamingSIMDExtensions2') end end local function floating_point(cfg) if cfg.flags.FloatFast then _p(3,'Fast') elseif cfg.flags.FloatStrict then _p(3,'Strict') end end local function debug_info(cfg) -- -- EditAndContinue /ZI -- ProgramDatabase /Zi -- OldStyle C7 Compatable /Z7 -- local debug_info = '' if cfg.flags.Symbols then if optimisation(cfg) ~= "Disabled" or cfg.flags.NoEditAndContinue then debug_info = "ProgramDatabase" elseif cfg.platform ~= "x64" then debug_info = "EditAndContinue" else debug_info = "OldStyle" end end _p(3,'%s',debug_info) end local function minimal_build(cfg) if premake.config.isdebugbuild(cfg) and not cfg.flags.NoMinimalRebuild then _p(3,'true') else _p(3,'false') end end local function compile_language(cfg) if cfg.language == "C" then _p(3,'CompileAsC') end end local function vs10_clcompile(cfg) _p(2,'') if #cfg.buildoptions > 0 then _p(3,'%s %%(AdditionalOptions)', table.concat(premake.esc(cfg.buildoptions), " ")) end _p(3,'%s',optimisation(cfg)) include_dirs(3,cfg) preprocessor(3,cfg) minimal_build(cfg) if optimisation(cfg) == "Disabled" then _p(3,'EnableFastChecks') if cfg.flags.ExtraWarnings then _p(3,'true') end else _p(3,'true') end _p(3,'%s', runtime(cfg)) _p(3,'true') precompiled_header(cfg) if cfg.flags.ExtraWarnings then _p(3,'Level4') else _p(3,'Level3') end if cfg.flags.FatalWarnings then _p(3,'true') end exceptions(cfg) rtti(cfg) wchar_t_buildin(cfg) sse(cfg) floating_point(cfg) debug_info(cfg) if cfg.flags.NoFramePointer then _p(3,'true') end compile_language(cfg) _p(2,'') end local function event_hooks(cfg) if #cfg.postbuildcommands> 0 then _p(2,'') _p(3,'%s',premake.esc(table.implode(cfg.postbuildcommands, "", "", "\r\n"))) _p(2,'') end if #cfg.prebuildcommands> 0 then _p(2,'') _p(3,'%s',premake.esc(table.implode(cfg.prebuildcommands, "", "", "\r\n"))) _p(2,'') end if #cfg.prelinkcommands> 0 then _p(2,'') _p(3,'%s',premake.esc(table.implode(cfg.prelinkcommands, "", "", "\r\n"))) _p(2,'') end end local function additional_options(indent,cfg) if #cfg.linkoptions > 0 then _p(indent,'%s %%(AdditionalOptions)', table.concat(premake.esc(cfg.linkoptions), " ")) end end local function item_def_lib(cfg) if cfg.kind == 'StaticLib' then _p(1,'') _p(2,'$(OutDir)%s',cfg.buildtarget.name) additional_options(2,cfg) _p(1,'') end end local function link_target_machine(cfg) local target if cfg.platform == nil or cfg.platform == "x32" then target ="MachineX86" elseif cfg.platform == "x64" then target ="MachineX64" end _p(3,'%s', target) end local function import_lib(cfg) --Prevent the generation of an import library for a Windows DLL. if cfg.kind == "SharedLib" then local implibname = cfg.linktarget.fullpath _p(3,'%s',iif(cfg.flags.NoImportLib, cfg.objectsdir .. "\\" .. path.getname(implibname), implibname)) end end local function common_link_section(cfg) _p(3,'%s',iif(cfg.kind == "ConsoleApp","Console", "Windows")) if cfg.flags.Symbols then _p(3,'true') else _p(3,'false') end if optimisation(cfg) ~= "Disabled" then _p(3,'true') _p(3,'true') end if cfg.flags.Symbols then _p(3,'$(OutDir)%s.pdb' , path.getbasename(cfg.buildtarget.name)) end end local function item_link(cfg) _p(2,'') if cfg.kind ~= 'StaticLib' then if #cfg.links > 0 then _p(3,'%s;%%(AdditionalDependencies)', table.concat(premake.getlinks(cfg, "all", "fullpath"), ";")) end _p(3,'$(OutDir)%s', cfg.buildtarget.name) _p(3,'%s%s%%(AdditionalLibraryDirectories)', table.concat(premake.esc(path.translate(cfg.libdirs, '\\')) , ";"), iif(cfg.libdirs and #cfg.libdirs >0,';','')) common_link_section(cfg) if vs10_helpers.config_type(cfg) == 'Application' and not cfg.flags.WinMain then _p(3,'mainCRTStartup') end import_lib(cfg) _p(3,'%s', iif(cfg.platform == "x64", "MachineX64", "MachineX86")) additional_options(3,cfg) else common_link_section(cfg) end _p(2,'') end local function item_definitions(prj) for _, cfginfo in ipairs(prj.solution.vstudio_configs) do local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) _p(1,'' ,premake.esc(cfginfo.name)) vs10_clcompile(cfg) resource_compile(cfg) item_def_lib(cfg) item_link(cfg) event_hooks(cfg) _p(1,'') end end -- -- -- -- {8fd826f8-3739-44e6-8cc8-997122e53b8d} -- -- -- local function write_file_type_block(files,group_type) if #files > 0 then _p(1,'') for _, current_file in ipairs(files) do _p(2,'<%s Include=\"%s\" />', group_type,current_file) end _p(1,'') end end local function write_file_compile_block(files,prj,configs) if #files > 0 then local config_mappings = {} for _, cfginfo in ipairs(configs) do local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) if cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then config_mappings[cfginfo] = path.translate(cfg.pchsource, "\\") end end _p(1,'') for _, current_file in ipairs(files) do _p(2,'', current_file) for _, cfginfo in ipairs(configs) do if config_mappings[cfginfo] and current_file == config_mappings[cfginfo] then _p(3,'Create' ,premake.esc(cfginfo.name)) --only one source file per pch config_mappings[cfginfo] = nil _p(2,'') end end _p(2,'') end _p(1,'') end end local function vcxproj_files(prj) local sorted = { ClCompile ={}, ClInclude ={}, None ={}, ResourceCompile ={} } cfg = premake.getconfig(prj) vs10_helpers.sort_input_files(cfg.files,sorted) write_file_type_block(sorted.ClInclude,"ClInclude") write_file_compile_block(sorted.ClCompile,prj,prj.solution.vstudio_configs) write_file_type_block(sorted.None,'None') write_file_type_block(sorted.ResourceCompile,'ResourceCompile') end local function write_filter_includes(sorted_table) local directories = vs10_helpers.table_of_file_filters(sorted_table) --I am going to take a punt here that the ItemGroup is missing if no files!!!! --there is a test for this see --vs10_filters.noInputFiles_bufferDoesNotContainTagItemGroup if #directories >0 then _p(1,'') for _, dir in pairs(directories) do _p(2,'',dir) _p(3,'{%s}',os.uuid()) _p(2,'') end _p(1,'') end end local function write_file_filter_block(files,group_type) if #files > 0 then _p(1,'') for _, current_file in ipairs(files) do local path_to_file = vs10_helpers.file_path(current_file) if path_to_file then _p(2,'<%s Include=\"%s\">', group_type,path.translate(current_file, "\\")) _p(3,'%s',path_to_file) _p(2,'',group_type) else _p(2,'<%s Include=\"%s\" />', group_type,path.translate(current_file, "\\")) end end _p(1,'') end end local tool_version_and_xmlns = 'ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"' local xml_version_and_encoding = '' local function vcxproj_filter_files(prj) local sorted = { ClCompile ={}, ClInclude ={}, None ={}, ResourceCompile ={} } cfg = premake.getconfig(prj) vs10_helpers.sort_input_files(cfg.files,sorted) io.eol = "\r\n" _p(xml_version_and_encoding) _p('') write_filter_includes(sorted) write_file_filter_block(sorted.ClInclude,"ClInclude") write_file_filter_block(sorted.ClCompile,"ClCompile") write_file_filter_block(sorted.None,"None") write_file_filter_block(sorted.ResourceCompile,"ResourceCompile") _p('') end function premake.vs2010_vcxproj(prj) io.eol = "\r\n" _p(xml_version_and_encoding) _p('') vs2010_config(prj) vs2010_globals(prj) _p(1,'') config_type_block(prj) _p(1,'') --check what this section is doing _p(1,'') _p(1,'') import_props(prj) --what type of macros are these? _p(1,'') intermediate_and_out_dirs(prj) item_definitions(prj) vcxproj_files(prj) _p(1,'') _p(1,'') _p(1,'') _p('') end function premake.vs2010_vcxproj_user(prj) _p(xml_version_and_encoding) _p('') _p('') end function premake.vs2010_vcxproj_filters(prj) vcxproj_filter_files(prj) end premake-4.3-src+repack1/src/actions/vstudio/vs200x_vcproj.lua0000644000000000000000000004265011470465410022676 0ustar rootroot-- -- vs200x_vcproj.lua -- Generate a Visual Studio 2002-2008 C/C++ project. -- Copyright (c) 2009, 2010 Jason Perkins and the Premake project -- premake.vstudio.vcproj = { } local vcproj = premake.vstudio.vcproj -- -- Write out the element. -- function vcproj.Configuration(name, cfg) _p(2,'') end -- -- Write out the element; ensures that each target platform -- is listed only once. Skips over .NET's pseudo-platforms (like "Any CPU"). -- function premake.vs200x_vcproj_platforms(prj) local used = { } _p(1,'') for _, cfg in ipairs(prj.solution.vstudio_configs) do if cfg.isreal and not table.contains(used, cfg.platform) then table.insert(used, cfg.platform) _p(2,'') end end _p(1,'') end -- -- Return the debugging symbols level for a configuration. -- function premake.vs200x_vcproj_symbols(cfg) if (not cfg.flags.Symbols) then return 0 else -- Edit-and-continue does't work for some configurations if cfg.flags.NoEditAndContinue or _VS.optimization(cfg) ~= 0 or cfg.flags.Managed or cfg.platform == "x64" then return 3 else return 4 end end end -- -- Compiler block for Windows and XBox360 platforms. -- function premake.vs200x_vcproj_VCCLCompilerTool(cfg) _p(3,' 0 then _p(4,'AdditionalOptions="%s"', table.concat(premake.esc(cfg.buildoptions), " ")) end _p(4,'Optimization="%s"', _VS.optimization(cfg)) if cfg.flags.NoFramePointer then _p(4,'OmitFramePointers="%s"', _VS.bool(true)) end if #cfg.includedirs > 0 then _p(4,'AdditionalIncludeDirectories="%s"', premake.esc(path.translate(table.concat(cfg.includedirs, ";"), '\\'))) end if #cfg.defines > 0 then _p(4,'PreprocessorDefinitions="%s"', premake.esc(table.concat(cfg.defines, ";"))) end if premake.config.isdebugbuild(cfg) and not cfg.flags.NoMinimalRebuild and not cfg.flags.Managed then _p(4,'MinimalRebuild="%s"', _VS.bool(true)) end if cfg.flags.NoExceptions then _p(4,'ExceptionHandling="%s"', iif(_ACTION < "vs2005", "FALSE", 0)) elseif cfg.flags.SEH and _ACTION > "vs2003" then _p(4,'ExceptionHandling="2"') end if _VS.optimization(cfg) == 0 and not cfg.flags.Managed then _p(4,'BasicRuntimeChecks="3"') end if _VS.optimization(cfg) ~= 0 then _p(4,'StringPooling="%s"', _VS.bool(true)) end local runtime if premake.config.isdebugbuild(cfg) then runtime = iif(cfg.flags.StaticRuntime, 1, 3) else runtime = iif(cfg.flags.StaticRuntime, 0, 2) end -- if cfg.flags.StaticRuntime then -- runtime = iif(cfg.flags.Symbols, 1, 0) -- else -- runtime = iif(cfg.flags.Symbols, 3, 2) -- end _p(4,'RuntimeLibrary="%s"', runtime) _p(4,'EnableFunctionLevelLinking="%s"', _VS.bool(true)) if _ACTION > "vs2003" and cfg.platform ~= "Xbox360" and cfg.platform ~= "x64" then if cfg.flags.EnableSSE then _p(4,'EnableEnhancedInstructionSet="1"') elseif cfg.flags.EnableSSE2 then _p(4,'EnableEnhancedInstructionSet="2"') end end if _ACTION < "vs2005" then if cfg.flags.FloatFast then _p(4,'ImproveFloatingPointConsistency="%s"', _VS.bool(false)) elseif cfg.flags.FloatStrict then _p(4,'ImproveFloatingPointConsistency="%s"', _VS.bool(true)) end else if cfg.flags.FloatFast then _p(4,'FloatingPointModel="2"') elseif cfg.flags.FloatStrict then _p(4,'FloatingPointModel="1"') end end if _ACTION < "vs2005" and not cfg.flags.NoRTTI then _p(4,'RuntimeTypeInfo="%s"', _VS.bool(true)) elseif _ACTION > "vs2003" and cfg.flags.NoRTTI then _p(4,'RuntimeTypeInfo="%s"', _VS.bool(false)) end if cfg.flags.NativeWChar then _p(4,'TreatWChar_tAsBuiltInType="%s"', _VS.bool(true)) elseif cfg.flags.NoNativeWChar then _p(4,'TreatWChar_tAsBuiltInType="%s"', _VS.bool(false)) end if not cfg.flags.NoPCH and cfg.pchheader then _p(4,'UsePrecompiledHeader="%s"', iif(_ACTION < "vs2005", 3, 2)) _p(4,'PrecompiledHeaderThrough="%s"', path.getname(cfg.pchheader)) else _p(4,'UsePrecompiledHeader="%s"', iif(_ACTION > "vs2003" or cfg.flags.NoPCH, 0, 2)) end _p(4,'WarningLevel="%s"', iif(cfg.flags.ExtraWarnings, 4, 3)) if cfg.flags.FatalWarnings then _p(4,'WarnAsError="%s"', _VS.bool(true)) end if _ACTION < "vs2008" and not cfg.flags.Managed then _p(4,'Detect64BitPortabilityProblems="%s"', _VS.bool(not cfg.flags.No64BitChecks)) end _p(4,'ProgramDataBaseFileName="$(OutDir)\\%s.pdb"', path.getbasename(cfg.buildtarget.name)) _p(4,'DebugInformationFormat="%s"', premake.vs200x_vcproj_symbols(cfg)) if cfg.language == "C" then _p(4, 'CompileAs="1"') end _p(3,'/>') end -- -- Linker block for Windows and Xbox 360 platforms. -- function premake.vs200x_vcproj_VCLinkerTool(cfg) _p(3,' 0 then _p(4,'AdditionalOptions="%s"', table.concat(premake.esc(cfg.linkoptions), " ")) end if #cfg.links > 0 then _p(4,'AdditionalDependencies="%s"', table.concat(premake.getlinks(cfg, "all", "fullpath"), " ")) end _p(4,'OutputFile="$(OutDir)\\%s"', cfg.buildtarget.name) _p(4,'LinkIncremental="%s"', iif(_VS.optimization(cfg) == 0, 2, 1)) _p(4,'AdditionalLibraryDirectories="%s"', table.concat(premake.esc(path.translate(cfg.libdirs, '\\')) , ";")) local deffile = premake.findfile(cfg, ".def") if deffile then _p(4,'ModuleDefinitionFile="%s"', deffile) end if cfg.flags.NoManifest then _p(4,'GenerateManifest="%s"', _VS.bool(false)) end _p(4,'GenerateDebugInformation="%s"', _VS.bool(premake.vs200x_vcproj_symbols(cfg) ~= 0)) if premake.vs200x_vcproj_symbols(cfg) ~= 0 then _p(4,'ProgramDataBaseFileName="$(OutDir)\\%s.pdb"', path.getbasename(cfg.buildtarget.name)) end _p(4,'SubSystem="%s"', iif(cfg.kind == "ConsoleApp", 1, 2)) if _VS.optimization(cfg) ~= 0 then _p(4,'OptimizeReferences="2"') _p(4,'EnableCOMDATFolding="2"') end if (cfg.kind == "ConsoleApp" or cfg.kind == "WindowedApp") and not cfg.flags.WinMain then _p(4,'EntryPointSymbol="mainCRTStartup"') end if cfg.kind == "SharedLib" then local implibname = cfg.linktarget.fullpath _p(4,'ImportLibrary="%s"', iif(cfg.flags.NoImportLib, cfg.objectsdir .. "\\" .. path.getname(implibname), implibname)) end _p(4,'TargetMachine="%d"', iif(cfg.platform == "x64", 17, 1)) else _p(4,'Name="VCLibrarianTool"') if #cfg.links > 0 then _p(4,'AdditionalDependencies="%s"', table.concat(premake.getlinks(cfg, "all", "fullpath"), " ")) end _p(4,'OutputFile="$(OutDir)\\%s"', cfg.buildtarget.name) if #cfg.libdirs > 0 then _p(4,'AdditionalLibraryDirectories="%s"', premake.esc(path.translate(table.concat(cfg.libdirs , ";")))) end if #cfg.linkoptions > 0 then _p(4,'AdditionalOptions="%s"', table.concat(premake.esc(cfg.linkoptions), " ")) end end _p(3,'/>') end -- -- Compiler and linker blocks for the PS3 platform, which uses GCC. -- function premake.vs200x_vcproj_VCCLCompilerTool_GCC(cfg) _p(3,' 0 then _p(4,'AdditionalOptions="%s"', premake.esc(table.concat(buildoptions, " "))) end if #cfg.includedirs > 0 then _p(4,'AdditionalIncludeDirectories="%s"', premake.esc(path.translate(table.concat(cfg.includedirs, ";"), '\\'))) end if #cfg.defines > 0 then _p(4,'PreprocessorDefinitions="%s"', table.concat(premake.esc(cfg.defines), ";")) end _p(4,'ProgramDataBaseFileName="$(OutDir)\\%s.pdb"', path.getbasename(cfg.buildtarget.name)) _p(4,'DebugInformationFormat="0"') _p(4,'CompileAs="0"') _p(3,'/>') end function premake.vs200x_vcproj_VCLinkerTool_GCC(cfg) _p(3,' 0 then _p(4,'AdditionalOptions="%s"', premake.esc(table.concat(buildoptions, " "))) end if #cfg.links > 0 then _p(4,'AdditionalDependencies="%s"', table.concat(premake.getlinks(cfg, "all", "fullpath"), " ")) end _p(4,'OutputFile="$(OutDir)\\%s"', cfg.buildtarget.name) _p(4,'LinkIncremental="0"') _p(4,'AdditionalLibraryDirectories="%s"', table.concat(premake.esc(path.translate(cfg.libdirs, '\\')) , ";")) _p(4,'GenerateManifest="%s"', _VS.bool(false)) _p(4,'ProgramDatabaseFile=""') _p(4,'RandomizedBaseAddress="1"') _p(4,'DataExecutionPrevention="0"') else _p(4,'Name="VCLibrarianTool"') local buildoptions = table.join(premake.gcc.getldflags(cfg), cfg.linkoptions) if #buildoptions > 0 then _p(4,'AdditionalOptions="%s"', premake.esc(table.concat(buildoptions, " "))) end if #cfg.links > 0 then _p(4,'AdditionalDependencies="%s"', table.concat(premake.getlinks(cfg, "all", "fullpath"), " ")) end _p(4,'OutputFile="$(OutDir)\\%s"', cfg.buildtarget.name) if #cfg.libdirs > 0 then _p(4,'AdditionalLibraryDirectories="%s"', premake.esc(path.translate(table.concat(cfg.libdirs , ";")))) end end _p(3,'/>') end -- -- Resource compiler block. -- function premake.vs200x_vcproj_VCResourceCompilerTool(cfg) _p(3,' 0 then _p(4,'AdditionalOptions="%s"', table.concat(premake.esc(cfg.resoptions), " ")) end if #cfg.defines > 0 or #cfg.resdefines > 0 then _p(4,'PreprocessorDefinitions="%s"', table.concat(premake.esc(table.join(cfg.defines, cfg.resdefines)), ";")) end if #cfg.includedirs > 0 or #cfg.resincludedirs > 0 then local dirs = table.join(cfg.includedirs, cfg.resincludedirs) _p(4,'AdditionalIncludeDirectories="%s"', premake.esc(path.translate(table.concat(dirs, ";"), '\\'))) end _p(3,'/>') end -- -- Manifest block. -- function premake.vs200x_vcproj_VCManifestTool(cfg) -- locate all manifest files local manifests = { } for _, fname in ipairs(cfg.files) do if path.getextension(fname) == ".manifest" then table.insert(manifests, fname) end end _p(3,' 0 then _p(4,'AdditionalManifestFiles="%s"', premake.esc(table.concat(manifests, ";"))) end _p(3,'/>') end -- -- VCMIDLTool block -- function premake.vs200x_vcproj_VCMIDLTool(cfg) _p(3,'') end -- -- Write out a custom build steps block. -- function premake.vs200x_vcproj_buildstepsblock(name, steps) _p(3,' 0 then _p(4,'CommandLine="%s"', premake.esc(table.implode(steps, "", "", "\r\n"))) end _p(3,'/>') end -- -- Map project tool blocks to handler functions. Unmapped blocks will output -- an empty element. -- local blockmap = { VCCLCompilerTool = premake.vs200x_vcproj_VCCLCompilerTool, VCCLCompilerTool_GCC = premake.vs200x_vcproj_VCCLCompilerTool_GCC, VCLinkerTool = premake.vs200x_vcproj_VCLinkerTool, VCLinkerTool_GCC = premake.vs200x_vcproj_VCLinkerTool_GCC, VCManifestTool = premake.vs200x_vcproj_VCManifestTool, VCMIDLTool = premake.vs200x_vcproj_VCMIDLTool, VCResourceCompilerTool = premake.vs200x_vcproj_VCResourceCompilerTool, } -- -- Return a list of sections for a particular Visual Studio version and target platform. -- local function getsections(version, platform) if version == "vs2002" then return { "VCCLCompilerTool", "VCCustomBuildTool", "VCLinkerTool", "VCMIDLTool", "VCPostBuildEventTool", "VCPreBuildEventTool", "VCPreLinkEventTool", "VCResourceCompilerTool", "VCWebServiceProxyGeneratorTool", "VCWebDeploymentTool" } end if version == "vs2003" then return { "VCCLCompilerTool", "VCCustomBuildTool", "VCLinkerTool", "VCMIDLTool", "VCPostBuildEventTool", "VCPreBuildEventTool", "VCPreLinkEventTool", "VCResourceCompilerTool", "VCWebServiceProxyGeneratorTool", "VCXMLDataGeneratorTool", "VCWebDeploymentTool", "VCManagedWrapperGeneratorTool", "VCAuxiliaryManagedWrapperGeneratorTool" } end if platform == "Xbox360" then return { "VCPreBuildEventTool", "VCCustomBuildTool", "VCXMLDataGeneratorTool", "VCWebServiceProxyGeneratorTool", "VCMIDLTool", "VCCLCompilerTool", "VCManagedResourceCompilerTool", "VCResourceCompilerTool", "VCPreLinkEventTool", "VCLinkerTool", "VCALinkTool", "VCX360ImageTool", "VCBscMakeTool", "VCX360DeploymentTool", "VCPostBuildEventTool", "DebuggerTool", } end if platform == "PS3" then return { "VCPreBuildEventTool", "VCCustomBuildTool", "VCXMLDataGeneratorTool", "VCWebServiceProxyGeneratorTool", "VCMIDLTool", "VCCLCompilerTool_GCC", "VCManagedResourceCompilerTool", "VCResourceCompilerTool", "VCPreLinkEventTool", "VCLinkerTool_GCC", "VCALinkTool", "VCManifestTool", "VCXDCMakeTool", "VCBscMakeTool", "VCFxCopTool", "VCAppVerifierTool", "VCWebDeploymentTool", "VCPostBuildEventTool" } else return { "VCPreBuildEventTool", "VCCustomBuildTool", "VCXMLDataGeneratorTool", "VCWebServiceProxyGeneratorTool", "VCMIDLTool", "VCCLCompilerTool", "VCManagedResourceCompilerTool", "VCResourceCompilerTool", "VCPreLinkEventTool", "VCLinkerTool", "VCALinkTool", "VCManifestTool", "VCXDCMakeTool", "VCBscMakeTool", "VCFxCopTool", "VCAppVerifierTool", "VCWebDeploymentTool", "VCPostBuildEventTool" } end end -- -- The main function: write the project file. -- function premake.vs200x_vcproj(prj) io.eol = "\r\n" _p('') -- Write opening project block _p(' "vs2003" then _p(1,'RootNamespace="%s"', prj.name) end _p(1,'Keyword="%s"', iif(prj.flags.Managed, "ManagedCProj", "Win32Proj")) _p(1,'>') -- list the target platforms premake.vs200x_vcproj_platforms(prj) if _ACTION > "vs2003" then _p(1,'') _p(1,'') end _p(1,'') for _, cfginfo in ipairs(prj.solution.vstudio_configs) do if cfginfo.isreal then local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) -- Start a configuration vcproj.Configuration(cfginfo.name, cfg) for _, block in ipairs(getsections(_ACTION, cfginfo.src_platform)) do if blockmap[block] then blockmap[block](cfg) -- Build event blocks -- elseif block == "VCPreBuildEventTool" then premake.vs200x_vcproj_buildstepsblock("VCPreBuildEventTool", cfg.prebuildcommands) elseif block == "VCPreLinkEventTool" then premake.vs200x_vcproj_buildstepsblock("VCPreLinkEventTool", cfg.prelinkcommands) elseif block == "VCPostBuildEventTool" then premake.vs200x_vcproj_buildstepsblock("VCPostBuildEventTool", cfg.postbuildcommands) -- End build event blocks -- -- Xbox 360 custom sections -- elseif block == "VCX360DeploymentTool" then _p(3,' 0 then _p(4,'AdditionalOptions="%s"', table.concat(premake.esc(cfg.deploymentoptions), " ")) end _p(3,'/>') elseif block == "VCX360ImageTool" then _p(3,' 0 then _p(4,'AdditionalOptions="%s"', table.concat(premake.esc(cfg.imageoptions), " ")) end if cfg.imagepath ~= nil then _p(4,'OutputFileName="%s"', premake.esc(path.translate(cfg.imagepath))) end _p(3,'/>') elseif block == "DebuggerTool" then _p(3,'') -- End Xbox 360 custom sections -- else _p(3,'') end end _p(2,'') end end _p(1,'') _p(1,'') _p(1,'') _p(1,'') premake.walksources(prj, _VS.files) _p(1,'') _p(1,'') _p(1,'') _p('') end premake-4.3-src+repack1/src/actions/vstudio/vs2003_solution.lua0000644000000000000000000000337011470465410023136 0ustar rootroot-- -- vs2003_solution.lua -- Generate a Visual Studio 2003 solution. -- Copyright (c) 2009 Jason Perkins and the Premake project -- function premake.vs2003_solution(sln) io.eol = '\r\n' -- Precompute Visual Studio configurations sln.vstudio_configs = premake.vstudio_buildconfigs(sln) _p('Microsoft Visual Studio Solution File, Format Version 8.00') -- Write out the list of project entries for prj in premake.solution.eachproject(sln) do local projpath = path.translate(path.getrelative(sln.location, _VS.projectfile(prj))) _p('Project("{%s}") = "%s", "%s", "{%s}"', _VS.tool(prj), prj.name, projpath, prj.uuid) local deps = premake.getdependencies(prj) if #deps > 0 then _p('\tProjectSection(ProjectDependencies) = postProject') for _, dep in ipairs(deps) do _p('\t\t{%s} = {%s}', dep.uuid, dep.uuid) end _p('\tEndProjectSection') end _p('EndProject') end _p('Global') _p('\tGlobalSection(SolutionConfiguration) = preSolution') for _, cfgname in ipairs(sln.configurations) do _p('\t\t%s = %s', cfgname, cfgname) end _p('\tEndGlobalSection') _p('\tGlobalSection(ProjectDependencies) = postSolution') _p('\tEndGlobalSection') _p('\tGlobalSection(ProjectConfiguration) = postSolution') for prj in premake.solution.eachproject(sln) do for _, cfgname in ipairs(sln.configurations) do _p('\t\t{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfgname, cfgname, _VS.arch(prj)) _p('\t\t{%s}.%s.Build.0 = %s|%s', prj.uuid, cfgname, cfgname, _VS.arch(prj)) end end _p('\tEndGlobalSection') _p('\tGlobalSection(ExtensibilityGlobals) = postSolution') _p('\tEndGlobalSection') _p('\tGlobalSection(ExtensibilityAddIns) = postSolution') _p('\tEndGlobalSection') _p('EndGlobal') end premake-4.3-src+repack1/src/actions/vstudio/vs2002_csproj.lua0000644000000000000000000001044711470465410022564 0ustar rootroot-- -- vs2002_csproj.lua -- Generate a Visual Studio 2002/2003 C# project. -- Copyright (c) 2009 Jason Perkins and the Premake project -- -- -- Figure out what elements a particular file need in its item block, -- based on its build action and any related files in the project. -- local function getelements(prj, action, fname) if action == "Compile" and fname:endswith(".cs") then return "SubTypeCode" end if action == "EmbeddedResource" and fname:endswith(".resx") then -- is there a matching *.cs file? local basename = fname:sub(1, -6) local testname = path.getname(basename .. ".cs") if premake.findfile(prj, testname) then return "Dependency", testname end end return "None" end function premake.vs2002_csproj(prj) io.eol = "\r\n" _p('') _p(1,'') _p(2,'') -- Write out project-wide settings _p(3,'') -- Write out configuration blocks for cfg in premake.eachconfig(prj) do _p(4,'') end _p(3,'') -- List assembly references _p(3,'') for _, ref in ipairs(premake.getlinks(prj, "siblings", "object")) do _p(4,'') end for _, linkname in ipairs(premake.getlinks(prj, "system", "fullpath")) do _p(4,'') end _p(3,'') _p(2,'') -- List source files _p(2,'') _p(3,'') for fcfg in premake.eachfile(prj) do local action = premake.dotnet.getbuildaction(fcfg) local fname = path.translate(premake.esc(fcfg.name), "\\") local elements, dependency = getelements(prj, action, fcfg.name) _p(4,'') end _p(3,'') _p(2,'') _p(1,'') _p('') end premake-4.3-src+repack1/src/actions/vstudio/vs2002_csproj_user.lua0000644000000000000000000000265111470465410023620 0ustar rootroot-- -- vs2002_csproj_user.lua -- Generate a Visual Studio 2002/2003 C# .user file. -- Copyright (c) 2009 Jason Perkins and the Premake project -- function premake.vs2002_csproj_user(prj) io.eol = "\r\n" _p('') _p(1,'') _p(2,'') -- Visual Studio wants absolute paths local refpaths = table.translate(prj.libdirs, function(v) return path.getabsolute(prj.location .. "/" .. v) end) _p(3,'', path.translate(table.concat(refpaths, ";"), "\\")) for cfg in premake.eachconfig(prj) do _p(4,'') end _p(3,'') _p(2,'') _p(2,'') _p(1,'') _p('') end premake-4.3-src+repack1/src/actions/clean/0000755000000000000000000000000011470465410017124 5ustar rootrootpremake-4.3-src+repack1/src/actions/clean/_clean.lua0000644000000000000000000000614311470465410021054 0ustar rootroot-- -- _clean.lua -- The "clean" action: removes all generated files. -- Copyright (c) 2002-2009 Jason Perkins and the Premake project -- premake.clean = { } -- -- Clean a solution or project specific directory. Uses information in the -- project object to build the target path. -- -- @param obj -- A solution or project object. -- @param pattern -- A filename pattern to clean; see premake.project.getfilename() for -- a description of the format. -- function premake.clean.directory(obj, pattern) local fname = premake.project.getfilename(obj, pattern) os.rmdir(fname) end -- -- Clean a solution or project specific file. Uses information in the project -- object to build the target filename. -- -- @param obj -- A solution or project object. -- @param pattern -- A filename pattern to clean; see premake.project.getfilename() for -- a description of the format. -- function premake.clean.file(obj, pattern) local fname = premake.project.getfilename(obj, pattern) os.remove(fname) end -- -- Register the "clean" action. -- newaction { trigger = "clean", description = "Remove all binaries and generated files", onsolution = function(sln) for action in premake.action.each() do if action.oncleansolution then action.oncleansolution(sln) end end end, onproject = function(prj) for action in premake.action.each() do if action.oncleanproject then action.oncleanproject(prj) end end if (prj.objectsdir) then premake.clean.directory(prj, prj.objectsdir) end -- build a list of supported target platforms that also includes a generic build local platforms = prj.solution.platforms or { } if not table.contains(platforms, "Native") then platforms = table.join(platforms, { "Native" }) end for _, platform in ipairs(platforms) do for cfg in premake.eachconfig(prj, platform) do premake.clean.directory(prj, cfg.objectsdir) -- remove all permutations of the target binary premake.clean.file(prj, premake.gettarget(cfg, "build", "posix", "windows", "windows").fullpath) premake.clean.file(prj, premake.gettarget(cfg, "build", "posix", "posix", "linux").fullpath) premake.clean.file(prj, premake.gettarget(cfg, "build", "posix", "posix", "macosx").fullpath) premake.clean.file(prj, premake.gettarget(cfg, "build", "posix", "PS3", "windows").fullpath) if cfg.kind == "WindowedApp" then premake.clean.directory(prj, premake.gettarget(cfg, "build", "posix", "posix", "linux").fullpath .. ".app") end -- if there is an import library, remove that too premake.clean.file(prj, premake.gettarget(cfg, "link", "windows", "windows", "windows").fullpath) premake.clean.file(prj, premake.gettarget(cfg, "link", "posix", "posix", "linux").fullpath) -- call action.oncleantarget() with the undecorated target name local target = path.join(premake.project.getfilename(prj, cfg.buildtarget.directory), cfg.buildtarget.basename) for action in premake.action.each() do if action.oncleantarget then action.oncleantarget(target) end end end end end } premake-4.3-src+repack1/src/actions/codelite/0000755000000000000000000000000011470465410017632 5ustar rootrootpremake-4.3-src+repack1/src/actions/codelite/codelite_workspace.lua0000644000000000000000000000260611470465410024207 0ustar rootroot-- -- codelite_workspace.lua -- Generate a CodeLite workspace file. -- Copyright (c) 2009 Jason Perkins and the Premake project -- function premake.codelite_workspace(sln) _p('') _p('', premake.esc(sln.name), premake.esc(sln.name)) for i,prj in ipairs(sln.projects) do local name = premake.esc(prj.name) local fname = path.join(path.getrelative(sln.location, prj.location), prj.name) local active = iif(i==1, "Yes", "No") _p(' ', name, fname, active) end -- build a list of supported target platforms; I don't support cross-compiling yet local platforms = premake.filterplatforms(sln, premake[_OPTIONS.cc].platforms, "Native") for i = #platforms, 1, -1 do if premake.platforms[platforms[i]].iscrosscompiler then table.remove(platforms, i) end end _p(' ') for _, platform in ipairs(platforms) do for _, cfgname in ipairs(sln.configurations) do local name = premake.getconfigname(cfgname, platform) _p(' ', name) for _,prj in ipairs(sln.projects) do _p(' ', prj.name, name) end _p(' ') end end _p(' ') _p('') end premake-4.3-src+repack1/src/actions/codelite/codelite_project.lua0000644000000000000000000001227711470465410023664 0ustar rootroot-- -- codelite_project.lua -- Generate a CodeLite C/C++ project file. -- Copyright (c) 2009 Jason Perkins and the Premake project -- function premake.codelite_project(prj) _p('') _p('', premake.esc(prj.name)) premake.walksources(prj, premake.codelite_files) local types = { ConsoleApp = "Executable", WindowedApp = "Executable", StaticLib = "Static Library", SharedLib = "Dynamic Library", } _p(' ', types[prj.kind]) -- build a list of supported target platforms; I don't support cross-compiling yet local platforms = premake.filterplatforms(prj.solution, premake[_OPTIONS.cc].platforms, "Native") for i = #platforms, 1, -1 do if premake.platforms[platforms[i]].iscrosscompiler then table.remove(platforms, i) end end for _, platform in ipairs(platforms) do for cfg in premake.eachconfig(prj, platform) do local name = premake.esc(cfg.longname) local compiler = iif(cfg.language == "C", "gcc", "g++") _p(' ', name, compiler, types[cfg.kind]) local fname = premake.esc(cfg.buildtarget.fullpath) local objdir = premake.esc(cfg.objectsdir) local runcmd = cfg.buildtarget.name local rundir = cfg.buildtarget.directory local pause = iif(cfg.kind == "WindowedApp", "no", "yes") _p(' ', fname, objdir, runcmd, rundir, pause) -- begin compiler block -- local flags = premake.esc(table.join(premake.gcc.getcflags(cfg), premake.gcc.getcxxflags(cfg), cfg.buildoptions)) _p(' ', table.concat(flags, ";")) for _,v in ipairs(cfg.includedirs) do _p(' ', premake.esc(v)) end for _,v in ipairs(cfg.defines) do _p(' ', premake.esc(v)) end _p(' ') -- end compiler block -- -- begin linker block -- flags = premake.esc(table.join(premake.gcc.getldflags(cfg), cfg.linkoptions)) _p(' ', table.concat(flags, ";")) for _,v in ipairs(premake.getlinks(cfg, "all", "directory")) do _p(' ', premake.esc(v)) end for _,v in ipairs(premake.getlinks(cfg, "all", "basename")) do _p(' ', premake.esc(v)) end _p(' ') -- end linker block -- -- begin resource compiler block -- if premake.findfile(cfg, ".rc") then local defines = table.implode(table.join(cfg.defines, cfg.resdefines), "-D", ";", "") local options = table.concat(cfg.resoptions, ";") _p(' ', defines, options) for _,v in ipairs(table.join(cfg.includedirs, cfg.resincludedirs)) do _p(' ', premake.esc(v)) end _p(' ') else _p(' ') end -- end resource compiler block -- -- begin build steps -- if #cfg.prebuildcommands > 0 then _p(' ') for _,v in ipairs(cfg.prebuildcommands) do _p(' %s', premake.esc(v)) end _p(' ') end if #cfg.postbuildcommands > 0 then _p(' ') for _,v in ipairs(cfg.postbuildcommands) do _p(' %s', premake.esc(v)) end _p(' ') end -- end build steps -- _p(' ') _p(' ') _p(' ') _p(' ') _p(' ') _p(' None') _p(' ') _p(' ') _p(' ') _p(' ') _p(' ') _p(' ') _p(' ') end end _p(' ') for _, platform in ipairs(platforms) do for cfg in premake.eachconfig(prj, platform) do _p(' ', cfg.longname) for _,dep in ipairs(premake.getdependencies(prj)) do _p(' ', dep.name) end _p(' ') end end _p('') end -- -- Write out entries for the files element; called from premake.walksources(). -- function premake.codelite_files(prj, fname, state, nestlevel) local indent = string.rep(" ", nestlevel + 1) if (state == "GroupStart") then io.write(indent .. '\n') elseif (state == "GroupEnd") then io.write(indent .. '\n') else io.write(indent .. '\n') end end premake-4.3-src+repack1/src/actions/codelite/_codelite.lua0000644000000000000000000000174711470465410022275 0ustar rootroot-- -- _codelite.lua -- Define the CodeLite action(s). -- Copyright (c) 2008-2009 Jason Perkins and the Premake project -- newaction { trigger = "codelite", shortname = "CodeLite", description = "Generate CodeLite project files", valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" }, valid_languages = { "C", "C++" }, valid_tools = { cc = { "gcc" }, }, onsolution = function(sln) premake.generate(sln, "%%.workspace", premake.codelite_workspace) end, onproject = function(prj) premake.generate(prj, "%%.project", premake.codelite_project) end, oncleansolution = function(sln) premake.clean.file(sln, "%%.workspace") premake.clean.file(sln, "%%_wsp.mk") premake.clean.file(sln, "%%.tags") end, oncleanproject = function(prj) premake.clean.file(prj, "%%.project") premake.clean.file(prj, "%%.mk") premake.clean.file(prj, "%%.list") premake.clean.file(prj, "%%.out") end } premake-4.3-src+repack1/src/actions/example/0000755000000000000000000000000011470465410017475 5ustar rootrootpremake-4.3-src+repack1/src/actions/example/example_project.lua0000644000000000000000000000511111470465410023357 0ustar rootroot-- An example project generator; see _example.lua for action description -- -- The project generation function, attached to the action in _example.lua. -- By now, premake.generate() has created the project file using the name -- provided in _example.lua, and redirected input to this new file. -- function premake.example.project(prj) -- If necessary, set an explicit line ending sequence -- io.eol = '\r\n' -- Let's start with a header _p('-- Example project file version 1.0') _p('Name: %s', prj.name) _p('Kind: %s', prj.kind) _p('Language: %s', prj.language) _p('ID: {%s}', prj.uuid) _p('') -- List the build configurations, and the settings for each for cfg in premake.eachconfig(prj) do _p('Configuration %s:', cfg.name) _p(1, 'Objects directory: %s', cfg.objectsdir) _p(1, 'Build target:') _p(2, 'Full path: %s', cfg.buildtarget.fullpath) _p(2, 'Directory: %s', cfg.buildtarget.directory) _p(2, 'Name: %s', cfg.buildtarget.name) _p(2, 'Base name: %s', cfg.buildtarget.basename) _p(2, 'Prefix: %s', cfg.buildtarget.prefix) _p(2, 'Suffix: %s', cfg.buildtarget.suffix) _p('') _p(1, 'Compiling:') _p(2, 'Defines: %s', table.concat(cfg.defines, ";")) _p(2, 'Include paths: %s', table.concat(cfg.includedirs, ";")) _p(2, 'Flags: %s', table.concat(cfg.flags, ", ")) if not cfg.flags.NoPCH and cfg.pchheader then _p(2, 'Precompiled header: %s (%s)', cfg.pchheader, cfg.pchsource) end _p(2, 'Options: %s', table.concat(cfg.buildoptions, " ")) _p('') _p(1, 'Linking:') _p(2, 'Library paths: %s', table.concat(cfg.libdirs, ";")) _p(2, 'Options: %s', table.concat(cfg.linkoptions, " ")) _p(2, 'Libraries: %s', table.concat(premake.getlinks(cfg, "all", "fullpath"))) _p('') if #cfg.prebuildcommands > 0 then _p(1, 'Prebuild commands:') for _, cmd in ipairs(cfg.prebuildcommands) do _p(2, cmd) end _p('') end if #cfg.prelinkcommands > 0 then _p(1, 'Prelink commands:') for _, cmd in ipairs(cfg.prelinkcommands) do _p(2, cmd) end _p('') end if #cfg.postbuildcommands > 0 then _p(1, 'Postbuild commands:') for _, cmd in ipairs(cfg.postbuildcommands) do _p(2, cmd) end _p('') end end -- List out the folders and files that make up the build local tr = premake.project.buildsourcetree(prj) premake.tree.sort(tr) premake.tree.traverse(tr, { onbranch = function(node, depth) _p(depth, path.getname(node.name) .. "/") end, onleaf = function(node, depth) _p(depth, path.getname(node.name)) end }) end premake-4.3-src+repack1/src/actions/example/example_solution.lua0000644000000000000000000000236211470465410023572 0ustar rootroot-- An example solution generator; see _example.lua for action description -- -- The solution generation function, attached to the action in _example.lua. -- By now, premake.generate() has created the solution file using the name -- provided in _example.lua, and redirected input to this new file. -- function premake.example.solution(sln) -- If necessary, set an explicit line ending sequence -- io.eol = '\r\n' -- Let's start with a header _p('-- Example solution file version 1.0') _p('Name: %s', sln.name) _p('') -- List the build configurations for _, cfgname in ipairs(sln.configurations) do _p('Config: %s', cfgname) end _p('') -- List the projects contained by the solution, with some info on each for prj in premake.solution.eachproject(sln) do _p('Project: %s', prj.name) _p(1, 'Kind: %s', prj.kind) _p(1, 'Language: %s', prj.language) _p(1, 'ID: {%s}', prj.uuid) _p(1, 'Relative path: %s', path.getrelative(sln.location, prj.location)) -- List dependencies, if there are any local deps = premake.getdependencies(prj) if #deps > 0 then _p(1, 'Dependencies:') for _, depprj in ipairs(deps) do _p(2, '%s {%s}', depprj.name, depprj.uuid) end end _p('') end end premake-4.3-src+repack1/src/actions/example/_example.lua0000644000000000000000000000706011470465410021775 0ustar rootroot-- Define a namespace for my new action. The second line defines an alias that I -- can use in this file, saving myself some typing. It will not be visible outside -- of this file (though I can always define it again). premake.example = { } local example = premake.example -- The description of the action. Note that only the first three fields are required; -- you can remove any of the additional fields that are not required by your action. newaction { -- The trigger is what needs to be typed on the command line to cause -- this action this run (premake4 example) trigger = "example", -- The short name is used when this toolset name needs to be shown to -- the user, such as in status or error messages shortname = "Super Studio 3000", -- The description is shown in the help text (premake4 /help) description = "An example action that prints simple text files", -- Some actions imply a particular operating system: Visual Studio only -- runs on Windows, and Xcode only on Mac OS X. If this is the case, -- uncomment this line and set it to one of "windows", "linux" or "macosx". -- Otherwise, this action will target the current operating system. -- os = "macosx", -- Which kinds of targets this action supports; remove those you don't. valid_kinds = { "ConsoleApp", "WindowedApp", "SharedLib", "StaticLib" }, -- Which programming languages this actions supports; remove those you don't. valid_languages = { "C", "C++", "C#" }, -- Which compiler sets this action supports; remove those you don't. The set -- is specified with the /cc and /dotnet command-line options. You can find -- the tool interfaces at src/tools. valid_tools = { cc = { "msc", "gcc", "ow" }, dotnet = { "mono", "msnet", "pnet" }, }, -- This function is called during state validation. If your action has some -- special requirements you can check them here and error if necessary. oncheckproject = function(prj) -- if this_project_is_no_good(prj) then -- error("Project " .. prj.name .. " is no good", 0) -- end end, -- These functions will get called for each solution and project. The function -- premake.generate() creates a file for you in the correct place, taking into -- account any location information specified in the script. The sequence "%%" -- will be replaced by the solution/project name. The last parameter is the -- function that will actually do the work of generating the file contents. onsolution = function(sln) premake.generate(sln, "%%.sln.txt", premake.example.solution) end, onproject = function(prj) if premake.isdotnetproject(prj) then premake.generate(prj, "%%.csprj.txt", premake.example.project) else premake.generate(prj, "%%.cprj.txt", premake.example.project) end end, -- These functions are called for each solution, project, and target as part -- of the "clean" action. They should remove any files generated by the tools. -- premake.clean.file() and premake.clean.directory() are convenience functions -- that use the same pattern matching as premake.generate() above. oncleansolution = function(sln) premake.clean.file(sln, "%%.sln.txt") end, oncleanproject = function(prj) if premake.isdotnetproject(prj) then premake.clean.file(prj, "%%.csprj.txt") else premake.clean.file(prj, "%%.cprj.txt") end end, oncleantarget = function(trg) -- 'trg' is the path and base name of the target being cleaned, -- like 'bin/debug/MyApplication'. So you might do something like: -- os.remove(trg .. ".exe") end, } premake-4.3-src+repack1/src/actions/xcode/0000755000000000000000000000000011470465410017144 5ustar rootrootpremake-4.3-src+repack1/src/actions/xcode/xcode_project.lua0000644000000000000000000001227311470465410022504 0ustar rootroot-- -- xcode_project.lua -- Generate an Xcode C/C++ project. -- Copyright (c) 2009 Jason Perkins and the Premake project -- local xcode = premake.xcode local tree = premake.tree -- -- Create a tree corresponding to what is shown in the Xcode project browser -- pane, with nodes for files and folders, resources, frameworks, and products. -- -- @param prj -- The project being generated. -- @returns -- A tree, loaded with metadata, which mirrors Xcode's view of the project. -- function xcode.buildprjtree(prj) local tr = premake.project.buildsourcetree(prj) -- create a list of build configurations and assign IDs tr.configs = {} for _, cfgname in ipairs(prj.solution.configurations) do for _, platform in ipairs(prj.solution.xcode.platforms) do local cfg = premake.getconfig(prj, cfgname, platform) cfg.xcode = {} cfg.xcode.targetid = xcode.newid(prj.xcode.projectnode, cfgname) cfg.xcode.projectid = xcode.newid(tr, cfgname) table.insert(tr.configs, cfg) end end -- convert localized resources from their filesystem layout (English.lproj/MainMenu.xib) -- to Xcode's display layout (MainMenu.xib/English). tree.traverse(tr, { onbranch = function(node) if path.getextension(node.name) == ".lproj" then local lang = path.getbasename(node.name) -- "English", "French", etc. -- create a new language group for each file it contains for _, filenode in ipairs(node.children) do local grpnode = node.parent.children[filenode.name] if not grpnode then grpnode = tree.insert(node.parent, tree.new(filenode.name)) grpnode.kind = "vgroup" end -- convert the file node to a language node and add to the group filenode.name = path.getbasename(lang) tree.insert(grpnode, filenode) end -- remove this directory from the tree tree.remove(node) end end }) -- the special folder "Frameworks" lists all linked frameworks tr.frameworks = tree.new("Frameworks") for cfg in premake.eachconfig(prj) do for _, link in ipairs(premake.getlinks(cfg, "system", "fullpath")) do local name = path.getname(link) if xcode.isframework(name) and not tr.frameworks.children[name] then node = tree.insert(tr.frameworks, tree.new(name)) node.path = link end end end -- only add it to the tree if there are frameworks to link if #tr.frameworks.children > 0 then tree.insert(tr, tr.frameworks) end -- the special folder "Products" holds the target produced by the project; this -- is populated below tr.products = tree.insert(tr, tree.new("Products")) -- the special folder "Projects" lists sibling project dependencies tr.projects = tree.new("Projects") for _, dep in ipairs(premake.getdependencies(prj, "sibling", "object")) do -- create a child node for the dependency's xcodeproj local xcpath = xcode.getxcodeprojname(dep) local xcnode = tree.insert(tr.projects, tree.new(path.getname(xcpath))) xcnode.path = xcpath xcnode.project = dep xcnode.productgroupid = xcode.newid(xcnode, "prodgrp") xcnode.productproxyid = xcode.newid(xcnode, "prodprox") xcnode.targetproxyid = xcode.newid(xcnode, "targprox") xcnode.targetdependid = xcode.newid(xcnode, "targdep") -- create a grandchild node for the dependency's link target local cfg = premake.getconfig(dep, prj.configurations[1]) node = tree.insert(xcnode, tree.new(cfg.linktarget.name)) node.path = cfg.linktarget.fullpath node.cfg = cfg end if #tr.projects.children > 0 then tree.insert(tr, tr.projects) end -- Final setup tree.traverse(tr, { onnode = function(node) -- assign IDs to every node in the tree node.id = xcode.newid(node) -- assign build IDs to buildable files if xcode.getbuildcategory(node) then node.buildid = xcode.newid(node, "build") end -- remember key files that are needed elsewhere if string.endswith(node.name, "Info.plist") then tr.infoplist = node end end }, true) -- Plug in the product node into the Products folder in the tree. The node -- was built in xcode.preparesolution() in xcode_common.lua; it contains IDs -- that are necessary for inter-project dependencies node = tree.insert(tr.products, prj.xcode.projectnode) node.kind = "product" node.path = node.cfg.buildtarget.fullpath node.cfgsection = xcode.newid(node, "cfg") node.resstageid = xcode.newid(node, "rez") node.sourcesid = xcode.newid(node, "src") node.fxstageid = xcode.newid(node, "fxs") return tr end -- -- Generate an Xcode .xcodeproj for a Premake project. -- -- @param prj -- The Premake project to generate. -- function premake.xcode.project(prj) local tr = xcode.buildprjtree(prj) xcode.Header(tr) xcode.PBXBuildFile(tr) xcode.PBXContainerItemProxy(tr) xcode.PBXFileReference(tr) xcode.PBXFrameworksBuildPhase(tr) xcode.PBXGroup(tr) xcode.PBXNativeTarget(tr) xcode.PBXProject(tr) xcode.PBXReferenceProxy(tr) xcode.PBXResourcesBuildPhase(tr) xcode.PBXShellScriptBuildPhase(tr) xcode.PBXSourcesBuildPhase(tr) xcode.PBXVariantGroup(tr) xcode.PBXTargetDependency(tr) xcode.XCBuildConfiguration(tr) xcode.XCBuildConfigurationList(tr) xcode.Footer(tr) end premake-4.3-src+repack1/src/actions/xcode/xcode_common.lua0000644000000000000000000005754011470465410022334 0ustar rootroot-- -- xcode_common.lua -- Functions to generate the different sections of an Xcode project. -- Copyright (c) 2009-2010 Jason Perkins and the Premake project -- local xcode = premake.xcode local tree = premake.tree -- -- Return the Xcode build category for a given file, based on the file extension. -- -- @param node -- The node to identify. -- @returns -- An Xcode build category, one of "Sources", "Resources", "Frameworks", or nil. -- function xcode.getbuildcategory(node) local categories = { [".a"] = "Frameworks", [".c"] = "Sources", [".cc"] = "Sources", [".cpp"] = "Sources", [".cxx"] = "Sources", [".dylib"] = "Frameworks", [".framework"] = "Frameworks", [".m"] = "Sources", [".mm"] = "Sources", [".strings"] = "Resources", [".nib"] = "Resources", [".xib"] = "Resources", [".icns"] = "Resources", } return categories[path.getextension(node.name)] end -- -- Return the displayed name for a build configuration, taking into account the -- configuration and platform, i.e. "Debug 32-bit Universal". -- -- @param cfg -- The configuration being identified. -- @returns -- A build configuration name. -- function xcode.getconfigname(cfg) local name = cfg.name if #cfg.project.solution.xcode.platforms > 1 then name = name .. " " .. premake.action.current().valid_platforms[cfg.platform] end return name end -- -- Return the Xcode type for a given file, based on the file extension. -- -- @param fname -- The file name to identify. -- @returns -- An Xcode file type, string. -- function xcode.getfiletype(node) local types = { [".c"] = "sourcecode.c.c", [".cc"] = "sourcecode.cpp.cpp", [".cpp"] = "sourcecode.cpp.cpp", [".css"] = "text.css", [".cxx"] = "sourcecode.cpp.cpp", [".framework"] = "wrapper.framework", [".gif"] = "image.gif", [".h"] = "sourcecode.c.h", [".html"] = "text.html", [".lua"] = "sourcecode.lua", [".m"] = "sourcecode.c.objc", [".mm"] = "sourcecode.cpp.objc", [".nib"] = "wrapper.nib", [".pch"] = "sourcecode.c.h", [".plist"] = "text.plist.xml", [".strings"] = "text.plist.strings", [".xib"] = "file.xib", [".icns"] = "image.icns", } return types[path.getextension(node.path)] or "text" end -- -- Return the Xcode product type, based target kind. -- -- @param node -- The product node to identify. -- @returns -- An Xcode product type, string. -- function xcode.getproducttype(node) local types = { ConsoleApp = "com.apple.product-type.tool", WindowedApp = "com.apple.product-type.application", StaticLib = "com.apple.product-type.library.static", SharedLib = "com.apple.product-type.library.dynamic", } return types[node.cfg.kind] end -- -- Return the Xcode target type, based on the target file extension. -- -- @param node -- The product node to identify. -- @returns -- An Xcode target type, string. -- function xcode.gettargettype(node) local types = { ConsoleApp = "\"compiled.mach-o.executable\"", WindowedApp = "wrapper.application", StaticLib = "archive.ar", SharedLib = "\"compiled.mach-o.dylib\"", } return types[node.cfg.kind] end -- -- Return a unique file name for a project. Since Xcode uses .xcodeproj's to -- represent both solutions and projects there is a likely change of a name -- collision. Tack on a number to differentiate them. -- -- @param prj -- The project being queried. -- @returns -- A uniqued file name -- function xcode.getxcodeprojname(prj) -- if there is a solution with matching name, then use "projectname1.xcodeproj" -- just get something working for now local fname = premake.project.getfilename(prj, "%%.xcodeproj") return fname end -- -- Returns true if the file name represents a framework. -- -- @param fname -- The name of the file to test. -- function xcode.isframework(fname) return (path.getextension(fname) == ".framework") end -- -- Retrieves a unique 12 byte ID for an object. This function accepts and ignores two -- parameters 'node' and 'usage', which are used by an alternative implementation of -- this function for testing. -- -- @returns -- A 24-character string representing the 12 byte ID. -- function xcode.newid() return string.format("%04X%04X%04X%04X%04X%04X", math.random(0, 32767), math.random(0, 32767), math.random(0, 32767), math.random(0, 32767), math.random(0, 32767), math.random(0, 32767)) end -- -- Create a product tree node and all projects in a solution; assigning IDs -- that are needed for inter-project dependencies. -- -- @param sln -- The solution to prepare. -- function xcode.preparesolution(sln) -- create and cache a list of supported platforms sln.xcode = { } sln.xcode.platforms = premake.filterplatforms(sln, premake.action.current().valid_platforms, "Universal") for prj in premake.solution.eachproject(sln) do -- need a configuration to get the target information local cfg = premake.getconfig(prj, prj.configurations[1], sln.xcode.platforms[1]) -- build the product tree node local node = premake.tree.new(path.getname(cfg.buildtarget.bundlepath)) node.cfg = cfg node.id = premake.xcode.newid(node, "product") node.targetid = premake.xcode.newid(node, "target") -- attach it to the project prj.xcode = {} prj.xcode.projectnode = node end end -- -- Print out a list value in the Xcode format. -- -- @param list -- The list of values to be printed. -- @param tag -- The Xcode specific list tag. -- function xcode.printlist(list, tag) if #list > 0 then _p(4,'%s = (', tag) for _, item in ipairs(list) do _p(5, '"%s",', item) end _p(4,');') end end --------------------------------------------------------------------------- -- Section generator functions, in the same order in which they appear -- in the .pbxproj file --------------------------------------------------------------------------- function xcode.Header() _p('// !$*UTF8*$!') _p('{') _p(1,'archiveVersion = 1;') _p(1,'classes = {') _p(1,'};') _p(1,'objectVersion = 45;') _p(1,'objects = {') _p('') end function xcode.PBXBuildFile(tr) _p('/* Begin PBXBuildFile section */') tree.traverse(tr, { onnode = function(node) if node.buildid then _p(2,'%s /* %s in %s */ = {isa = PBXBuildFile; fileRef = %s /* %s */; };', node.buildid, node.name, xcode.getbuildcategory(node), node.id, node.name) end end }) _p('/* End PBXBuildFile section */') _p('') end function xcode.PBXContainerItemProxy(tr) if #tr.projects.children > 0 then _p('/* Begin PBXContainerItemProxy section */') for _, node in ipairs(tr.projects.children) do _p(2,'%s /* PBXContainerItemProxy */ = {', node.productproxyid) _p(3,'isa = PBXContainerItemProxy;') _p(3,'containerPortal = %s /* %s */;', node.id, path.getname(node.path)) _p(3,'proxyType = 2;') _p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.id) _p(3,'remoteInfo = "%s";', node.project.xcode.projectnode.name) _p(2,'};') _p(2,'%s /* PBXContainerItemProxy */ = {', node.targetproxyid) _p(3,'isa = PBXContainerItemProxy;') _p(3,'containerPortal = %s /* %s */;', node.id, path.getname(node.path)) _p(3,'proxyType = 1;') _p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.targetid) _p(3,'remoteInfo = "%s";', node.project.xcode.projectnode.name) _p(2,'};') end _p('/* End PBXContainerItemProxy section */') _p('') end end function xcode.PBXFileReference(tr) _p('/* Begin PBXFileReference section */') tree.traverse(tr, { onleaf = function(node) -- I'm only listing files here, so ignore anything without a path if not node.path then return end -- is this the product node, describing the output target? if node.kind == "product" then _p(2,'%s /* %s */ = {isa = PBXFileReference; explicitFileType = %s; includeInIndex = 0; name = "%s"; path = "%s"; sourceTree = BUILT_PRODUCTS_DIR; };', node.id, node.name, xcode.gettargettype(node), node.name, path.getname(node.cfg.buildtarget.bundlepath)) -- is this a project dependency? elseif node.parent.parent == tr.projects then local relpath = path.getrelative(tr.project.location, node.parent.project.location) _p(2,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "%s"; path = "%s"; sourceTree = SOURCE_ROOT; };', node.parent.id, node.parent.name, node.parent.name, path.join(relpath, node.parent.name)) -- something else else local pth, src if xcode.isframework(node.path) then -- I need to figure out how to locate frameworks; this is just to get something working pth = "/System/Library/Frameworks/" .. node.path src = "absolute" else -- something else; probably a source code file pth = tree.getlocalpath(node) src = "group" end _p(2,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = %s; name = "%s"; path = "%s"; sourceTree = "<%s>"; };', node.id, node.name, xcode.getfiletype(node), node.name, pth, src) end end }) _p('/* End PBXFileReference section */') _p('') end function xcode.PBXFrameworksBuildPhase(tr) _p('/* Begin PBXFrameworksBuildPhase section */') _p(2,'%s /* Frameworks */ = {', tr.products.children[1].fxstageid) _p(3,'isa = PBXFrameworksBuildPhase;') _p(3,'buildActionMask = 2147483647;') _p(3,'files = (') -- write out library dependencies tree.traverse(tr.frameworks, { onleaf = function(node) _p(4,'%s /* %s in Frameworks */,', node.buildid, node.name) end }) -- write out project dependencies tree.traverse(tr.projects, { onleaf = function(node) _p(4,'%s /* %s in Frameworks */,', node.buildid, node.name) end }) _p(3,');') _p(3,'runOnlyForDeploymentPostprocessing = 0;') _p(2,'};') _p('/* End PBXFrameworksBuildPhase section */') _p('') end function xcode.PBXGroup(tr) _p('/* Begin PBXGroup section */') tree.traverse(tr, { onnode = function(node) -- Skip over anything that isn't a proper group if (node.path and #node.children == 0) or node.kind == "vgroup" then return end -- project references get special treatment if node.parent == tr.projects then _p(2,'%s /* Products */ = {', node.productgroupid) else _p(2,'%s /* %s */ = {', node.id, node.name) end _p(3,'isa = PBXGroup;') _p(3,'children = (') for _, childnode in ipairs(node.children) do _p(4,'%s /* %s */,', childnode.id, childnode.name) end _p(3,');') if node.parent == tr.projects then _p(3,'name = Products;') else _p(3,'name = "%s";', node.name) if node.path then local p = node.path if node.parent.path then p = path.getrelative(node.parent.path, node.path) end _p(3,'path = %s;', p) end end _p(3,'sourceTree = "";') _p(2,'};') end }, true) _p('/* End PBXGroup section */') _p('') end function xcode.PBXNativeTarget(tr) _p('/* Begin PBXNativeTarget section */') for _, node in ipairs(tr.products.children) do local name = tr.project.name _p(2,'%s /* %s */ = {', node.targetid, name) _p(3,'isa = PBXNativeTarget;') _p(3,'buildConfigurationList = %s /* Build configuration list for PBXNativeTarget "%s" */;', node.cfgsection, name) _p(3,'buildPhases = (') if #tr.project.prebuildcommands > 0 then _p(4,'9607AE1010C857E500CD1376 /* Prebuild */,') end _p(4,'%s /* Resources */,', node.resstageid) _p(4,'%s /* Sources */,', node.sourcesid) if #tr.project.prelinkcommands > 0 then _p(4,'9607AE3510C85E7E00CD1376 /* Prelink */,') end _p(4,'%s /* Frameworks */,', node.fxstageid) if #tr.project.postbuildcommands > 0 then _p(4,'9607AE3710C85E8F00CD1376 /* Postbuild */,') end _p(3,');') _p(3,'buildRules = (') _p(3,');') _p(3,'dependencies = (') for _, node in ipairs(tr.projects.children) do _p(4,'%s /* PBXTargetDependency */,', node.targetdependid) end _p(3,');') _p(3,'name = "%s";', name) local p if node.cfg.kind == "ConsoleApp" then p = "$(HOME)/bin" elseif node.cfg.kind == "WindowedApp" then p = "$(HOME)/Applications" end if p then _p(3,'productInstallPath = "%s";', p) end _p(3,'productName = "%s";', name) _p(3,'productReference = %s /* %s */;', node.id, node.name) _p(3,'productType = "%s";', xcode.getproducttype(node)) _p(2,'};') end _p('/* End PBXNativeTarget section */') _p('') end function xcode.PBXProject(tr) _p('/* Begin PBXProject section */') _p(2,'08FB7793FE84155DC02AAC07 /* Project object */ = {') _p(3,'isa = PBXProject;') _p(3,'buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "%s" */;', tr.name) _p(3,'compatibilityVersion = "Xcode 3.1";') _p(3,'hasScannedForEncodings = 1;') _p(3,'mainGroup = %s /* %s */;', tr.id, tr.name) _p(3,'projectDirPath = "";') if #tr.projects.children > 0 then _p(3,'projectReferences = (') for _, node in ipairs(tr.projects.children) do _p(4,'{') _p(5,'ProductGroup = %s /* Products */;', node.productgroupid) _p(5,'ProjectRef = %s /* %s */;', node.id, path.getname(node.path)) _p(4,'},') end _p(3,');') end _p(3,'projectRoot = "";') _p(3,'targets = (') for _, node in ipairs(tr.products.children) do _p(4,'%s /* %s */,', node.targetid, node.name) end _p(3,');') _p(2,'};') _p('/* End PBXProject section */') _p('') end function xcode.PBXReferenceProxy(tr) if #tr.projects.children > 0 then _p('/* Begin PBXReferenceProxy section */') tree.traverse(tr.projects, { onleaf = function(node) _p(2,'%s /* %s */ = {', node.id, node.name) _p(3,'isa = PBXReferenceProxy;') _p(3,'fileType = %s;', xcode.gettargettype(node)) _p(3,'path = "%s";', node.path) _p(3,'remoteRef = %s /* PBXContainerItemProxy */;', node.parent.productproxyid) _p(3,'sourceTree = BUILT_PRODUCTS_DIR;') _p(2,'};') end }) _p('/* End PBXReferenceProxy section */') _p('') end end function xcode.PBXResourcesBuildPhase(tr) _p('/* Begin PBXResourcesBuildPhase section */') for _, target in ipairs(tr.products.children) do _p(2,'%s /* Resources */ = {', target.resstageid) _p(3,'isa = PBXResourcesBuildPhase;') _p(3,'buildActionMask = 2147483647;') _p(3,'files = (') tree.traverse(tr, { onnode = function(node) if xcode.getbuildcategory(node) == "Resources" then _p(4,'%s /* %s in Resources */,', node.buildid, node.name) end end }) _p(3,');') _p(3,'runOnlyForDeploymentPostprocessing = 0;') _p(2,'};') end _p('/* End PBXResourcesBuildPhase section */') _p('') end function xcode.PBXShellScriptBuildPhase(tr) local wrapperWritten = false local function doblock(id, name, which) -- start with the project-level commands (most common) local prjcmds = tr.project[which] local commands = table.join(prjcmds, {}) -- see if there are any config-specific commands to add for _, cfg in ipairs(tr.configs) do local cfgcmds = cfg[which] if #cfgcmds > #prjcmds then table.insert(commands, 'if [ "${CONFIGURATION}" = "' .. xcode.getconfigname(cfg) .. '" ]; then') for i = #prjcmds + 1, #cfgcmds do table.insert(commands, cfgcmds[i]) end table.insert(commands, 'fi') end end if #commands > 0 then if not wrapperWritten then _p('/* Begin PBXShellScriptBuildPhase section */') wrapperWritten = true end _p(2,'%s /* %s */ = {', id, name) _p(3,'isa = PBXShellScriptBuildPhase;') _p(3,'buildActionMask = 2147483647;') _p(3,'files = (') _p(3,');') _p(3,'inputPaths = ('); _p(3,');'); _p(3,'name = %s;', name); _p(3,'outputPaths = ('); _p(3,');'); _p(3,'runOnlyForDeploymentPostprocessing = 0;'); _p(3,'shellPath = /bin/sh;'); _p(3,'shellScript = "%s";', table.concat(commands, "\\n"):gsub('"', '\\"')) _p(2,'};') end end doblock("9607AE1010C857E500CD1376", "Prebuild", "prebuildcommands") doblock("9607AE3510C85E7E00CD1376", "Prelink", "prelinkcommands") doblock("9607AE3710C85E8F00CD1376", "Postbuild", "postbuildcommands") if wrapperWritten then _p('/* End PBXShellScriptBuildPhase section */') end end function xcode.PBXSourcesBuildPhase(tr) _p('/* Begin PBXSourcesBuildPhase section */') for _, target in ipairs(tr.products.children) do _p(2,'%s /* Sources */ = {', target.sourcesid) _p(3,'isa = PBXSourcesBuildPhase;') _p(3,'buildActionMask = 2147483647;') _p(3,'files = (') tree.traverse(tr, { onleaf = function(node) if xcode.getbuildcategory(node) == "Sources" then _p(4,'%s /* %s in Sources */,', node.buildid, node.name) end end }) _p(3,');') _p(3,'runOnlyForDeploymentPostprocessing = 0;') _p(2,'};') end _p('/* End PBXSourcesBuildPhase section */') _p('') end function xcode.PBXVariantGroup(tr) _p('/* Begin PBXVariantGroup section */') tree.traverse(tr, { onbranch = function(node) if node.kind == "vgroup" then _p(2,'%s /* %s */ = {', node.id, node.name) _p(3,'isa = PBXVariantGroup;') _p(3,'children = (') for _, lang in ipairs(node.children) do _p(4,'%s /* %s */,', lang.id, lang.name) end _p(3,');') _p(3,'name = %s;', node.name) _p(3,'sourceTree = "";') _p(2,'};') end end }) _p('/* End PBXVariantGroup section */') _p('') end function xcode.PBXTargetDependency(tr) if #tr.projects.children > 0 then _p('/* Begin PBXTargetDependency section */') tree.traverse(tr.projects, { onleaf = function(node) _p(2,'%s /* PBXTargetDependency */ = {', node.parent.targetdependid) _p(3,'isa = PBXTargetDependency;') _p(3,'name = "%s";', node.name) _p(3,'targetProxy = %s /* PBXContainerItemProxy */;', node.parent.targetproxyid) _p(2,'};') end }) _p('/* End PBXTargetDependency section */') _p('') end end function xcode.XCBuildConfiguration_Target(tr, target, cfg) local cfgname = xcode.getconfigname(cfg) _p(2,'%s /* %s */ = {', cfg.xcode.targetid, cfgname) _p(3,'isa = XCBuildConfiguration;') _p(3,'buildSettings = {') _p(4,'ALWAYS_SEARCH_USER_PATHS = NO;') if not cfg.flags.Symbols then _p(4,'DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";') end if cfg.kind ~= "StaticLib" and cfg.buildtarget.prefix ~= "" then _p(4,'EXECUTABLE_PREFIX = %s;', cfg.buildtarget.prefix) end local outdir = path.getdirectory(cfg.buildtarget.bundlepath) if outdir ~= "." then _p(4,'CONFIGURATION_BUILD_DIR = %s;', outdir) end _p(4,'GCC_DYNAMIC_NO_PIC = NO;') _p(4,'GCC_MODEL_TUNING = G5;') if tr.infoplist then _p(4,'INFOPLIST_FILE = "%s";', tr.infoplist.path) end installpaths = { ConsoleApp = '/usr/local/bin', WindowedApp = '"$(HOME)/Applications"', SharedLib = '/usr/local/lib', StaticLib = '/usr/local/lib', } _p(4,'INSTALL_PATH = %s;', installpaths[cfg.kind]) _p(4,'PRODUCT_NAME = "%s";', cfg.buildtarget.basename) _p(3,'};') _p(3,'name = "%s";', cfgname) _p(2,'};') end function xcode.XCBuildConfiguration_Project(tr, cfg) local cfgname = xcode.getconfigname(cfg) _p(2,'%s /* %s */ = {', cfg.xcode.projectid, cfgname) _p(3,'isa = XCBuildConfiguration;') _p(3,'buildSettings = {') local archs = { Native = "$(NATIVE_ARCH_ACTUAL)", x32 = "i386", x64 = "x86_64", Universal32 = "$(ARCHS_STANDARD_32_BIT)", Universal64 = "$(ARCHS_STANDARD_64_BIT)", Universal = "$(ARCHS_STANDARD_32_64_BIT)", } _p(4,'ARCHS = "%s";', archs[cfg.platform]) local targetdir = path.getdirectory(cfg.buildtarget.bundlepath) if targetdir ~= "." then _p(4,'CONFIGURATION_BUILD_DIR = "$(SYMROOT)";'); end _p(4,'CONFIGURATION_TEMP_DIR = "$(OBJROOT)";') if cfg.flags.Symbols then _p(4,'COPY_PHASE_STRIP = NO;') end _p(4,'GCC_C_LANGUAGE_STANDARD = gnu99;') if cfg.flags.NoExceptions then _p(4,'GCC_ENABLE_CPP_EXCEPTIONS = NO;') end if cfg.flags.NoRTTI then _p(4,'GCC_ENABLE_CPP_RTTI = NO;') end if cfg.flags.Symbols and not cfg.flags.NoEditAndContinue then _p(4,'GCC_ENABLE_FIX_AND_CONTINUE = YES;') end if cfg.flags.NoExceptions then _p(4,'GCC_ENABLE_OBJC_EXCEPTIONS = NO;') end if cfg.flags.Optimize or cfg.flags.OptimizeSize then _p(4,'GCC_OPTIMIZATION_LEVEL = s;') elseif cfg.flags.OptimizeSpeed then _p(4,'GCC_OPTIMIZATION_LEVEL = 3;') else _p(4,'GCC_OPTIMIZATION_LEVEL = 0;') end if cfg.pchheader and not cfg.flags.NoPCH then _p(4,'GCC_PRECOMPILE_PREFIX_HEADER = YES;') _p(4,'GCC_PREFIX_HEADER = "%s";', cfg.pchheader) end xcode.printlist(cfg.defines, 'GCC_PREPROCESSOR_DEFINITIONS') if cfg.flags.FatalWarnings then _p(4,'GCC_TREAT_WARNINGS_AS_ERRORS = YES;') end _p(4,'GCC_WARN_ABOUT_RETURN_TYPE = YES;') _p(4,'GCC_WARN_UNUSED_VARIABLE = YES;') xcode.printlist(cfg.includedirs, 'HEADER_SEARCH_PATHS') xcode.printlist(cfg.libdirs, 'LIBRARY_SEARCH_PATHS') _p(4,'OBJROOT = "%s";', cfg.objectsdir) _p(4,'ONLY_ACTIVE_ARCH = NO;') -- build list of "other" C/C++ flags local checks = { ["-ffast-math"] = cfg.flags.FloatFast, ["-ffloat-store"] = cfg.flags.FloatStrict, ["-fomit-frame-pointer"] = cfg.flags.NoFramePointer, } local flags = { } for flag, check in pairs(checks) do if check then table.insert(flags, flag) end end xcode.printlist(table.join(flags, cfg.buildoptions), 'OTHER_CFLAGS') -- build list of "other" linked flags. All libraries that aren't frameworks -- are listed here, so I don't have to try and figure out if they are ".a" -- or ".dylib", which Xcode requires to list in the Frameworks section flags = { } for _, lib in ipairs(premake.getlinks(cfg, "system")) do if not xcode.isframework(lib) then table.insert(flags, "-l" .. lib) end end flags = table.join(flags, cfg.linkoptions) xcode.printlist(flags, 'OTHER_LDFLAGS') _p(4,'PREBINDING = NO;') if cfg.flags.StaticRuntime then _p(4,'STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static;') end if targetdir ~= "." then _p(4,'SYMROOT = "%s";', targetdir) end if cfg.flags.ExtraWarnings then _p(4,'WARNING_CFLAGS = "-Wall";') end _p(3,'};') _p(3,'name = "%s";', cfgname) _p(2,'};') end function xcode.XCBuildConfiguration(tr) _p('/* Begin XCBuildConfiguration section */') for _, target in ipairs(tr.products.children) do for _, cfg in ipairs(tr.configs) do xcode.XCBuildConfiguration_Target(tr, target, cfg) end end for _, cfg in ipairs(tr.configs) do xcode.XCBuildConfiguration_Project(tr, cfg) end _p('/* End XCBuildConfiguration section */') _p('') end function xcode.XCBuildConfigurationList(tr) local sln = tr.project.solution _p('/* Begin XCConfigurationList section */') for _, target in ipairs(tr.products.children) do _p(2,'%s /* Build configuration list for PBXNativeTarget "%s" */ = {', target.cfgsection, target.name) _p(3,'isa = XCConfigurationList;') _p(3,'buildConfigurations = (') for _, cfg in ipairs(tr.configs) do _p(4,'%s /* %s */,', cfg.xcode.targetid, xcode.getconfigname(cfg)) end _p(3,');') _p(3,'defaultConfigurationIsVisible = 0;') _p(3,'defaultConfigurationName = "%s";', xcode.getconfigname(tr.configs[1])) _p(2,'};') end _p(2,'1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "%s" */ = {', tr.name) _p(3,'isa = XCConfigurationList;') _p(3,'buildConfigurations = (') for _, cfg in ipairs(tr.configs) do _p(4,'%s /* %s */,', cfg.xcode.projectid, xcode.getconfigname(cfg)) end _p(3,');') _p(3,'defaultConfigurationIsVisible = 0;') _p(3,'defaultConfigurationName = "%s";', xcode.getconfigname(tr.configs[1])) _p(2,'};') _p('/* End XCConfigurationList section */') _p('') end function xcode.Footer() _p(1,'};') _p('\trootObject = 08FB7793FE84155DC02AAC07 /* Project object */;') _p('}') end premake-4.3-src+repack1/src/actions/xcode/_xcode.lua0000644000000000000000000000262411470465410021114 0ustar rootroot-- -- _xcode.lua -- Define the Apple XCode action and support functions. -- Copyright (c) 2009 Jason Perkins and the Premake project -- premake.xcode = { } newaction { trigger = "xcode3", shortname = "Xcode 3", description = "Generate Apple Xcode 3 project files (experimental)", os = "macosx", valid_kinds = { "ConsoleApp", "WindowedApp", "SharedLib", "StaticLib" }, valid_languages = { "C", "C++" }, valid_tools = { cc = { "gcc" }, }, valid_platforms = { Native = "Native", x32 = "Native 32-bit", x64 = "Native 64-bit", Universal32 = "32-bit Universal", Universal64 = "64-bit Universal", Universal = "Universal", }, default_platform = "Universal", onsolution = function(sln) -- Assign IDs needed for inter-project dependencies premake.xcode.preparesolution(sln) end, onproject = function(prj) premake.generate(prj, "%%.xcodeproj/project.pbxproj", premake.xcode.project) end, oncleanproject = function(prj) premake.clean.directory(prj, "%%.xcodeproj") end, oncheckproject = function(prj) -- Xcode can't mix target kinds within a project local last for cfg in premake.eachconfig(prj) do if last and last ~= cfg.kind then error("Project '" .. prj.name .. "' uses more than one target kind; not supported by Xcode", 0) end last = cfg.kind end end, } premake-4.3-src+repack1/src/base/0000755000000000000000000000000011470465410015314 5ustar rootrootpremake-4.3-src+repack1/src/base/table.lua0000644000000000000000000000450611470465410017113 0ustar rootroot-- -- table.lua -- Additions to Lua's built-in table functions. -- Copyright (c) 2002-2008 Jason Perkins and the Premake project -- -- -- Returns true if the table contains the specified value. -- function table.contains(t, value) for _,v in pairs(t) do if (v == value) then return true end end return false end -- -- Enumerates an array of objects and returns a new table containing -- only the value of one particular field. -- function table.extract(arr, fname) local result = { } for _,v in ipairs(arr) do table.insert(result, v[fname]) end return result end -- -- Flattens a hierarchy of tables into a single array containing all -- of the values. -- function table.flatten(arr) local result = { } local function flatten(arr) for _, v in ipairs(arr) do if type(v) == "table" then flatten(v) else table.insert(result, v) end end end flatten(arr) return result end -- -- Merges an array of items into a string. -- function table.implode(arr, before, after, between) local result = "" for _,v in ipairs(arr) do if (result ~= "" and between) then result = result .. between end result = result .. before .. v .. after end return result end -- -- Returns true if the table is empty, and contains no indexed or keyed values. -- function table.isempty(t) return not next(t) end -- -- Adds the values from one array to the end of another and -- returns the result. -- function table.join(...) local result = { } for _,t in ipairs(arg) do if type(t) == "table" then for _,v in ipairs(t) do table.insert(result, v) end else table.insert(result, t) end end return result end -- -- Return a list of all keys used in a table. -- function table.keys(tbl) local keys = {} for k, _ in pairs(tbl) do table.insert(keys, k) end return keys end -- -- Translates the values contained in array, using the specified -- translation table, and returns the results in a new array. -- function table.translate(arr, translation) local result = { } for _, value in ipairs(arr) do local tvalue if type(translation) == "function" then tvalue = translation(value) else tvalue = translation[value] end if (tvalue) then table.insert(result, tvalue) end end return result end premake-4.3-src+repack1/src/base/action.lua0000644000000000000000000000552411470465410017302 0ustar rootroot-- -- action.lua -- Work with the list of registered actions. -- Copyright (c) 2002-2009 Jason Perkins and the Premake project -- premake.action = { } -- -- The list of registered actions. -- premake.action.list = { } -- -- Register a new action. -- -- @param a -- The new action object. -- function premake.action.add(a) -- validate the action object, at least a little bit local missing for _, field in ipairs({"description", "trigger"}) do if (not a[field]) then missing = field end end if (missing) then error("action needs a " .. missing, 3) end -- add it to the master list premake.action.list[a.trigger] = a end -- -- Trigger an action. -- -- @param name -- The name of the action to be triggered. -- @returns -- None. -- function premake.action.call(name) local a = premake.action.list[name] for sln in premake.solution.each() do if a.onsolution then a.onsolution(sln) end for prj in premake.solution.eachproject(sln) do if a.onproject then a.onproject(prj) end end end if a.execute then a.execute() end end -- -- Retrieve the current action, as determined by _ACTION. -- -- @return -- The current action, or nil if _ACTION is nil or does not match any action. -- function premake.action.current() return premake.action.get(_ACTION) end -- -- Retrieve an action by name. -- -- @param name -- The name of the action to retrieve. -- @returns -- The requested action, or nil if the action does not exist. -- function premake.action.get(name) return premake.action.list[name] end -- -- Iterator for the list of actions. -- function premake.action.each() -- sort the list by trigger local keys = { } for _, action in pairs(premake.action.list) do table.insert(keys, action.trigger) end table.sort(keys) local i = 0 return function() i = i + 1 return premake.action.list[keys[i]] end end -- -- Activates a particular action. -- -- @param name -- The name of the action to activate. -- function premake.action.set(name) _ACTION = name -- Some actions imply a particular operating system local action = premake.action.get(name) if action then _OS = action.os or _OS end end -- -- Determines if an action supports a particular language or target type. -- -- @param action -- The action to test. -- @param feature -- The feature to check, either a programming language or a target type. -- @returns -- True if the feature is supported, false otherwise. -- function premake.action.supports(action, feature) if not action then return false end if action.valid_languages then if table.contains(action.valid_languages, feature) then return true end end if action.valid_kinds then if table.contains(action.valid_kinds, feature) then return true end end return false end premake-4.3-src+repack1/src/base/configs.lua0000644000000000000000000003336011470465410017454 0ustar rootroot-- -- configs.lua -- -- Functions for working with configuration objects (which can include -- projects and solutions). -- -- This script also contains the configuration "baking" logic (though I -- would like to eventually move this out to a different file): -- Once the project scripts have been run, flatten all of the configuration -- data down into simpler objects, keeping only the settings that apply to -- the current runtime environment. -- -- Copyright (c) 2008-2010 Jason Perkins and the Premake project -- premake.config = { } -- -- Determine if a configuration represents a "debug" or "release" build. -- This controls the runtime library selected for Visual Studio builds -- (and might also be useful elsewhere). -- -- @param cfg -- The configuration object to test. -- @returns -- True if the configuration represents a debug build; false otherwise. -- function premake.config.isdebugbuild(cfg) -- If any of the optimize flags are set, it's a release a build if cfg.flags.Optimize or cfg.flags.OptimizeSize or cfg.flags.OptimizeSpeed then return false end -- If symbols are not defined, it's a release build if not cfg.flags.Symbols then return false end return true end ------------------------------------------------------------------------- -- Configuration Baking Logic ------------------------------------------------------------------------- -- do not copy these fields into the configurations local nocopy = { blocks = true, keywords = true, projects = true, __configs = true, } -- leave these paths as absolute, rather than converting to project relative local nofixup = { basedir = true, location = true, } -- -- Returns a list of all of the active terms from the current environment. -- See the docs for configuration() for more information about the terms. -- function premake.getactiveterms() local terms = { _ACTION:lower(), os.get() } -- add option keys or values for key, value in pairs(_OPTIONS) do if value ~= "" then table.insert(terms, value:lower()) else table.insert(terms, key:lower()) end end return terms end -- -- Test a single configuration block keyword against a list of terms. -- The terms are a mix of key/value pairs. The keyword is tested against -- the values; on a match, the corresponding key is returned. This -- enables testing for required values in iskeywordsmatch(), below. -- function premake.iskeywordmatch(keyword, terms) -- is it negated? if keyword:startswith("not ") then return not premake.iskeywordmatch(keyword:sub(5), terms) end for _, pattern in ipairs(keyword:explode(" or ")) do -- local pattern = "^" .. word .. "$" for termkey, term in pairs(terms) do if term:match(pattern) == term then return termkey end end end end -- -- Checks a set of configuration block keywords against a list of terms. -- I've already forgotten the purpose of the required terms (d'oh!) but -- I'll see if I can figure it out on a future refactoring. -- function premake.iskeywordsmatch(keywords, terms) local hasrequired = false for _, keyword in ipairs(keywords) do local matched = premake.iskeywordmatch(keyword, terms) if not matched then return false end if matched == "required" then hasrequired = true end end if terms.required and not hasrequired then return false else return true end end -- -- Converts path fields from absolute to location-relative paths. -- -- @param location -- The base location, paths will be relative to this directory. -- @param obj -- The object containing the fields to be adjusted. -- local function adjustpaths(location, obj) for name, value in pairs(obj) do local field = premake.fields[name] if field and value and not nofixup[name] then if field.kind == "path" then obj[name] = path.getrelative(location, value) elseif field.kind == "dirlist" or field.kind == "filelist" then for i, p in ipairs(value) do value[i] = path.getrelative(location, p) end end end end end -- -- Merge all of the fields from one object into another. String values are overwritten, -- while list values are merged. Fields listed in premake.nocopy are skipped. -- -- @param dest -- The destination object, to contain the merged settings. -- @param src -- The source object, containing the settings to added to the destination. -- local function mergeobject(dest, src) if not src then return end for field, value in pairs(src) do if not nocopy[field] then if type(value) == "table" then -- merge two lists, removing any duplicates along the way local tbl = dest[field] or { } for _, item in ipairs(value) do if not tbl[item] then table.insert(tbl, item) tbl[item] = item end end dest[field] = tbl else dest[field] = value end end end end -- -- Merges the settings from a solution's or project's list of configuration blocks, -- for all blocks that match the provided set of environment terms. -- -- @param dest -- The destination object, to contain the merged settings. -- @param obj -- The solution or project object being collapsed. -- @param basis -- "Root" level settings, from the solution, which act as a starting point for -- all of the collapsed settings built during this call. -- @param terms -- A list of keywords to filter the configuration blocks; only those that -- match will be included in the destination. -- @param cfgname -- The name of the configuration being collapsed. May be nil. -- @param pltname -- The name of the platform being collapsed. May be nil. -- local function merge(dest, obj, basis, terms, cfgname, pltname) -- the configuration key is the merged configuration and platform names local key = cfgname or "" pltname = pltname or "Native" if pltname ~= "Native" then key = key .. pltname end -- add the configuration and platform to the block filter terms terms.config = (cfgname or ""):lower() terms.platform = pltname:lower() -- build the configuration base by merging the solution and project level settings local cfg = {} mergeobject(cfg, basis[key]) adjustpaths(obj.location, cfg) mergeobject(cfg, obj) -- now add in any blocks that match the filter terms for _, blk in ipairs(obj.blocks) do if (premake.iskeywordsmatch(blk.keywords, terms)) then mergeobject(cfg, blk) end end -- package it all up and add it to the result set cfg.name = cfgname cfg.platform = pltname cfg.terms = terms dest[key] = cfg end -- -- Collapse a solution or project object down to a canonical set of configuration settings, -- keyed by configuration block/platform pairs, and taking into account the current -- environment settings. -- -- @param obj -- The solution or project to be collapsed. -- @param basis -- "Root" level settings, from the solution, which act as a starting point for -- all of the collapsed settings built during this call. -- @returns -- The collapsed list of settings, keyed by configuration block/platform pair. -- local function collapse(obj, basis) local result = {} basis = basis or {} -- find the solution, which contains the configuration and platform lists local sln = obj.solution or obj -- build a set of configuration filter terms; only those configuration blocks -- with a matching set of keywords will be included in the merged results local terms = premake.getactiveterms() -- build a project-level configuration. If a target kind is set at this level -- then include it into the filter terms merge(result, obj, basis, terms) if result[""].kind then terms.kind = result[""].kind:lower() end -- now build configurations for each build config/platform pair for _, cfgname in ipairs(sln.configurations) do merge(result, obj, basis, terms, cfgname, "Native") for _, pltname in ipairs(sln.platforms or {}) do if pltname ~= "Native" then merge(result, obj, basis, terms, cfgname, pltname) end end end return result end -- -- Post-process a project configuration, applying path fix-ups and other adjustments -- to the "raw" setting data pulled from the project script. -- -- @param prj -- The project object which contains the configuration. -- @param cfg -- The configuration object to be fixed up. -- local function postprocess(prj, cfg) cfg.project = prj cfg.shortname = premake.getconfigname(cfg.name, cfg.platform, true) cfg.longname = premake.getconfigname(cfg.name, cfg.platform) -- set the project location, if not already set cfg.location = cfg.location or cfg.basedir -- figure out the target system local platform = premake.platforms[cfg.platform] if platform.iscrosscompiler then cfg.system = cfg.platform else cfg.system = os.get() end -- adjust the kind as required by the target system if cfg.kind == "SharedLib" and platform.nosharedlibs then cfg.kind = "StaticLib" end -- remove excluded files from the file list local files = { } for _, fname in ipairs(cfg.files) do local excluded = false for _, exclude in ipairs(cfg.excludes) do excluded = (fname == exclude) if (excluded) then break end end if (not excluded) then table.insert(files, fname) end end cfg.files = files -- fixup the data for name, field in pairs(premake.fields) do -- re-key flag fields for faster lookups if field.isflags then local values = cfg[name] for _, flag in ipairs(values) do values[flag] = true end end end -- build configuration objects for all files cfg.__fileconfigs = { } for _, fname in ipairs(cfg.files) do cfg.terms.required = fname:lower() local fcfg = {} for _, blk in ipairs(cfg.project.blocks) do if (premake.iskeywordsmatch(blk.keywords, cfg.terms)) then mergeobject(fcfg, blk) end end -- add indexed by name and integer fcfg.name = fname cfg.__fileconfigs[fname] = fcfg table.insert(cfg.__fileconfigs, fcfg) end end -- -- Computes a unique objects directory for every configuration, using the -- following choices: -- [1] -> the objects directory as set in the project of config -- [2] -> [1] + the platform name -- [3] -> [2] + the configuration name -- [4] -> [3] + the project name -- local function builduniquedirs() local num_variations = 4 -- Start by listing out each possible object directory for each configuration. -- Keep a count of how many times each path gets used across the session. local cfg_dirs = {} local hit_counts = {} for sln in premake.solution.each() do for _, prj in ipairs(sln.projects) do for _, cfg in pairs(prj.__configs) do local dirs = { } dirs[1] = path.getabsolute(path.join(cfg.location, cfg.objdir or cfg.project.objdir or "obj")) dirs[2] = path.join(dirs[1], iif(cfg.platform == "Native", "", cfg.platform)) dirs[3] = path.join(dirs[2], cfg.name) dirs[4] = path.join(dirs[3], cfg.project.name) cfg_dirs[cfg] = dirs -- configurations other than the root should bias toward a more -- description path, including the platform or config name local start = iif(cfg.name, 2, 1) for v = start, num_variations do local d = dirs[v] hit_counts[d] = (hit_counts[d] or 0) + 1 end end end end -- Now assign an object directory to each configuration, skipping those -- that are in use somewhere else in the session for sln in premake.solution.each() do for _, prj in ipairs(sln.projects) do for _, cfg in pairs(prj.__configs) do local dir local start = iif(cfg.name, 2, 1) for v = start, num_variations do dir = cfg_dirs[cfg][v] if hit_counts[dir] == 1 then break end end cfg.objectsdir = path.getrelative(cfg.location, dir) end end end end -- -- Pre-computes the build and link targets for a configuration. -- local function buildtargets() for sln in premake.solution.each() do for _, prj in ipairs(sln.projects) do for _, cfg in pairs(prj.__configs) do -- determine which conventions the target should follow for this config local pathstyle = premake.getpathstyle(cfg) local namestyle = premake.getnamestyle(cfg) -- build the targets cfg.buildtarget = premake.gettarget(cfg, "build", pathstyle, namestyle, cfg.system) cfg.linktarget = premake.gettarget(cfg, "link", pathstyle, namestyle, cfg.system) if pathstyle == "windows" then cfg.objectsdir = path.translate(cfg.objectsdir, "\\") end end end end end -- -- Takes the configuration information stored in solution->project->block -- hierarchy and flattens it all down into one object per configuration. -- These objects are cached with the project, and can be retrieved by -- calling the getconfig() or the eachconfig() iterator function. -- function premake.buildconfigs() -- convert project path fields to be relative to project location for sln in premake.solution.each() do for _, prj in ipairs(sln.projects) do prj.location = prj.location or sln.location or prj.basedir adjustpaths(prj.location, prj) for _, blk in ipairs(prj.blocks) do adjustpaths(prj.location, blk) end end sln.location = sln.location or sln.basedir end -- collapse configuration blocks, so that there is only one block per build -- configuration/platform pair, filtered to the current operating environment for sln in premake.solution.each() do local basis = collapse(sln) for _, prj in ipairs(sln.projects) do prj.__configs = collapse(prj, basis) for _, cfg in pairs(prj.__configs) do postprocess(prj, cfg) end end end -- assign unique object directories to each configuration builduniquedirs() -- walk it again and build the targets and unique directories buildtargets(cfg) end premake-4.3-src+repack1/src/base/project.lua0000644000000000000000000003777711470465410017512 0ustar rootroot-- -- project.lua -- Functions for working with the project data. -- Copyright (c) 2002-2009 Jason Perkins and the Premake project -- premake.project = { } -- -- Create a tree from a project's list of files, representing the filesystem hierarchy. -- -- @param prj -- The project containing the files to map. -- @returns -- A new tree object containing a corresponding filesystem hierarchy. The root node -- contains a reference back to the original project: prj = tr.project. -- function premake.project.buildsourcetree(prj) local tr = premake.tree.new(prj.name) for _, fname in ipairs(prj.files) do local node = premake.tree.add(tr, fname) end premake.tree.sort(tr) tr.project = prj return tr end -- -- Returns an iterator for a set of build configuration settings. If a platform is -- specified, settings specific to that platform and build configuration pair are -- returned. -- function premake.eachconfig(prj, platform) -- I probably have the project root config, rather than the actual project if prj.project then prj = prj.project end local cfgs = prj.solution.configurations local i = 0 return function () i = i + 1 if i <= #cfgs then return premake.getconfig(prj, cfgs[i], platform) end end end -- -- Iterator for a project's files; returns a file configuration object. -- function premake.eachfile(prj) -- project root config contains the file config list if not prj.project then prj = premake.getconfig(prj) end local i = 0 local t = prj.files return function () i = i + 1 if (i <= #t) then return prj.__fileconfigs[t[i]] end end end -- -- Apply XML escaping to a value. -- function premake.esc(value) if (type(value) == "table") then local result = { } for _,v in ipairs(value) do table.insert(result, premake.esc(v)) end return result else value = value:gsub('&', "&") value = value:gsub('"', """) value = value:gsub("'", "'") value = value:gsub('<', "<") value = value:gsub('>', ">") value = value:gsub('\r', " ") value = value:gsub('\n', " ") return value end end -- -- Given a map of supported platform identifiers, filters the solution's list -- of platforms to match. A map takes the form of a table like: -- -- { x32 = "Win32", x64 = "x64" } -- -- Only platforms that are listed in both the solution and the map will be -- included in the results. An optional default platform may also be specified; -- if the result set would otherwise be empty this platform will be used. -- function premake.filterplatforms(sln, map, default) local result = { } local keys = { } if sln.platforms then for _, p in ipairs(sln.platforms) do if map[p] and not table.contains(keys, map[p]) then table.insert(result, p) table.insert(keys, map[p]) end end end if #result == 0 and default then table.insert(result, default) end return result end -- -- Locate a project by name; case insensitive. -- function premake.findproject(name) for sln in premake.solution.each() do for prj in premake.solution.eachproject(sln) do if (prj.name == name) then return prj end end end end -- -- Locate a file in a project with a given extension; used to locate "special" -- items such as Windows .def files. -- function premake.findfile(prj, extension) for _, fname in ipairs(prj.files) do if fname:endswith(extension) then return fname end end end -- -- Retrieve a configuration for a given project/configuration pairing. -- @param prj -- The project to query. -- @param cfgname -- The target build configuration; only settings applicable to this configuration -- will be returned. May be nil to retrieve project-wide settings. -- @param pltname -- The target platform; only settings applicable to this platform will be returned. -- May be nil to retrieve platform-independent settings. -- @returns -- A configuration object containing all the settings for the given platform/build -- configuration pair. -- function premake.getconfig(prj, cfgname, pltname) -- might have the root configuration, rather than the actual project prj = prj.project or prj -- if platform is not included in the solution, use general settings instead if pltname == "Native" or not table.contains(prj.solution.platforms or {}, pltname) then pltname = nil end local key = (cfgname or "") if pltname then key = key .. pltname end return prj.__configs[key] end -- -- Build a name from a build configuration/platform pair. The short name -- is good for makefiles or anywhere a user will have to type it in. The -- long name is more readable. -- function premake.getconfigname(cfgname, platform, useshortname) if cfgname then local name = cfgname if platform and platform ~= "Native" then if useshortname then name = name .. premake.platforms[platform].cfgsuffix else name = name .. "|" .. platform end end return iif(useshortname, name:lower(), name) end end -- -- Returns a list of sibling projects on which the specified project depends. -- This is used to list dependencies within a solution or workspace. Must -- consider all configurations because Visual Studio does not support per-config -- project dependencies. -- -- @param prj -- The project to query. -- @returns -- A list of dependent projects, as an array of objects. -- function premake.getdependencies(prj) -- make sure I've got the project and not root config prj = prj.project or prj local results = { } for _, cfg in pairs(prj.__configs) do for _, link in ipairs(cfg.links) do local dep = premake.findproject(link) if dep and not table.contains(results, dep) then table.insert(results, dep) end end end return results end -- -- Uses information from a project (or solution) to format a filename. -- -- @param prj -- A project or solution object with the file naming information. -- @param pattern -- A naming pattern. The sequence "%%" will be replaced by the -- project name. -- @returns -- A filename matching the specified pattern, with a relative path -- from the current directory to the project location. -- function premake.project.getfilename(prj, pattern) local fname = pattern:gsub("%%%%", prj.name) fname = path.join(prj.location, fname) return path.getrelative(os.getcwd(), fname) end -- -- Returns a list of link targets. Kind may be one of: -- siblings - linkable sibling projects -- system - system (non-sibling) libraries -- dependencies - all sibling dependencies, including non-linkable -- all - return everything -- -- Part may be one of: -- name - the decorated library name with no directory -- basename - the undecorated library name -- directory - just the directory, no name -- fullpath - full path with decorated name -- object - return the project object of the dependency -- function premake.getlinks(cfg, kind, part) -- if I'm building a list of link directories, include libdirs local result = iif (part == "directory" and kind == "all", cfg.libdirs, {}) -- am I getting links for a configuration or a project? local cfgname = iif(cfg.name == cfg.project.name, "", cfg.name) -- how should files be named? local pathstyle = premake.getpathstyle(cfg) local namestyle = premake.getnamestyle(cfg) local function canlink(source, target) if (target.kind ~= "SharedLib" and target.kind ~= "StaticLib") then return false end if premake.iscppproject(source) then return premake.iscppproject(target) elseif premake.isdotnetproject(source) then return premake.isdotnetproject(target) end end for _, link in ipairs(cfg.links) do local item -- is this a sibling project? local prj = premake.findproject(link) if prj and kind ~= "system" then local prjcfg = premake.getconfig(prj, cfgname, cfg.platform) if kind == "dependencies" or canlink(cfg, prjcfg) then if (part == "directory") then item = path.rebase(prjcfg.linktarget.directory, prjcfg.location, cfg.location) elseif (part == "basename") then item = prjcfg.linktarget.basename elseif (part == "fullpath") then item = path.rebase(prjcfg.linktarget.fullpath, prjcfg.location, cfg.location) elseif (part == "object") then item = prjcfg end end elseif not prj and (kind == "system" or kind == "all") then if (part == "directory") then local dir = path.getdirectory(link) if (dir ~= ".") then item = dir end elseif (part == "fullpath") then item = link if namestyle == "windows" then if premake.iscppproject(cfg) then item = item .. ".lib" elseif premake.isdotnetproject(cfg) then item = item .. ".dll" end end if item:find("/", nil, true) then item = path.getrelative(cfg.basedir, item) end else item = link end end if item then if pathstyle == "windows" and part ~= "object" then item = path.translate(item, "\\") end if not table.contains(result, item) then table.insert(result, item) end end end return result end -- -- Gets the name style for a configuration, indicating what kind of prefix, -- extensions, etc. should be used in target file names. -- -- @param cfg -- The configuration to check. -- @returns -- The target naming style, one of "windows", "posix", or "PS3". -- function premake.getnamestyle(cfg) return premake.platforms[cfg.platform].namestyle or premake.gettool(cfg).namestyle or "posix" end -- -- Gets the path style for a configuration, indicating what kind of path separator -- should be used in target file names. -- -- @param cfg -- The configuration to check. -- @returns -- The target path style, one of "windows" or "posix". -- function premake.getpathstyle(cfg) if premake.action.current().os == "windows" then return "windows" else return "posix" end end -- -- Assembles a target for a particular tool/system/configuration. -- -- @param cfg -- The configuration to be targeted. -- @param direction -- One of 'build' for the build target, or 'link' for the linking target. -- @param pathstyle -- The path format, one of "windows" or "posix". This comes from the current -- action: Visual Studio uses "windows", GMake uses "posix", etc. -- @param namestyle -- The file naming style, one of "windows" or "posix". This comes from the -- current tool: GCC uses "posix", MSC uses "windows", etc. -- @param system -- The target operating system, which can modify the naming style. For example, -- shared libraries on Mac OS X use a ".dylib" extension. -- @returns -- An object with these fields: -- basename - the target with no directory or file extension -- name - the target name and extension, with no directory -- directory - relative path to the target, with no file name -- prefix - the file name prefix -- suffix - the file name suffix -- fullpath - directory, name, and extension -- bundlepath - the relative path and file name of the bundle -- function premake.gettarget(cfg, direction, pathstyle, namestyle, system) if system == "bsd" or system == "solaris" then system = "linux" end -- Fix things up based on the current system local kind = cfg.kind if premake.iscppproject(cfg) then -- On Windows, shared libraries link against a static import library if (namestyle == "windows" or system == "windows") and kind == "SharedLib" and direction == "link" then kind = "StaticLib" end -- Posix name conventions only apply to static libs on windows (by user request) if namestyle == "posix" and system == "windows" and kind ~= "StaticLib" then namestyle = "windows" end end -- Initialize the target components local field = iif(direction == "build", "target", "implib") local name = cfg[field.."name"] or cfg.targetname or cfg.project.name local dir = cfg[field.."dir"] or cfg.targetdir or path.getrelative(cfg.location, cfg.basedir) local prefix = "" local suffix = "" local ext = "" local bundlepath, bundlename if namestyle == "windows" then if kind == "ConsoleApp" or kind == "WindowedApp" then ext = ".exe" elseif kind == "SharedLib" then ext = ".dll" elseif kind == "StaticLib" then ext = ".lib" end elseif namestyle == "posix" then if kind == "WindowedApp" and system == "macosx" then bundlename = name .. ".app" bundlepath = path.join(dir, bundlename) dir = path.join(bundlepath, "Contents/MacOS") elseif kind == "SharedLib" then prefix = "lib" ext = iif(system == "macosx", ".dylib", ".so") elseif kind == "StaticLib" then prefix = "lib" ext = ".a" end elseif namestyle == "PS3" then if kind == "ConsoleApp" or kind == "WindowedApp" then ext = ".elf" elseif kind == "StaticLib" then prefix = "lib" ext = ".a" end end prefix = cfg[field.."prefix"] or cfg.targetprefix or prefix suffix = cfg[field.."suffix"] or cfg.targetsuffix or suffix ext = cfg[field.."extension"] or cfg.targetextension or ext -- build the results object local result = { } result.basename = name .. suffix result.name = prefix .. name .. suffix .. ext result.directory = dir result.prefix = prefix result.suffix = suffix result.fullpath = path.join(result.directory, result.name) result.bundlepath = bundlepath or result.fullpath if pathstyle == "windows" then result.directory = path.translate(result.directory, "\\") result.fullpath = path.translate(result.fullpath, "\\") end return result end -- -- Return the appropriate tool interface, based on the target language and -- any relevant command-line options. -- function premake.gettool(cfg) if premake.iscppproject(cfg) then if _OPTIONS.cc then return premake[_OPTIONS.cc] end local action = premake.action.current() if action.valid_tools then return premake[action.valid_tools.cc[1]] end return premake.gcc else return premake.dotnet end end -- -- Returns true if the solution contains at least one C/C++ project. -- function premake.hascppproject(sln) for prj in premake.solution.eachproject(sln) do if premake.iscppproject(prj) then return true end end end -- -- Returns true if the solution contains at least one .NET project. -- function premake.hasdotnetproject(sln) for prj in premake.solution.eachproject(sln) do if premake.isdotnetproject(prj) then return true end end end -- -- Returns true if the project uses a C/C++ language. -- function premake.iscppproject(prj) return (prj.language == "C" or prj.language == "C++") end -- -- Returns true if the project uses a .NET language. -- function premake.isdotnetproject(prj) return (prj.language == "C#") end -- -- Walk the list of source code files, breaking them into "groups" based -- on the directory hierarchy. -- local function walksources(cfg, fn, group, nestlevel, finished) local grouplen = group:len() local gname = iif(group:endswith("/"), group:sub(1, -2), group) -- open this new group if (nestlevel >= 0) then fn(cfg, gname, "GroupStart", nestlevel) end -- scan the list of files for items which belong in this group for _,fname in ipairs(cfg.files) do if (fname:startswith(group)) then -- is there a subgroup within this item? local _,split = fname:find("[^\.]/", grouplen + 1) if (split) then local subgroup = fname:sub(1, split) if (not finished[subgroup]) then finished[subgroup] = true walksources(cfg, fn, subgroup, nestlevel + 1, finished) end end end end -- process all files that belong in this group for _,fname in ipairs(cfg.files) do if (fname:startswith(group) and not fname:find("[^\.]/", grouplen + 1)) then fn(cfg, fname, "GroupItem", nestlevel + 1) end end -- close the group if (nestlevel >= 0) then fn(cfg, gname, "GroupEnd", nestlevel) end end function premake.walksources(cfg, fn) walksources(cfg, fn, "", -1, {}) end premake-4.3-src+repack1/src/base/api.lua0000644000000000000000000003053111470465410016572 0ustar rootroot-- -- api.lua -- Implementation of the solution, project, and configuration APIs. -- Copyright (c) 2002-2008 Jason Perkins and the Premake project -- -- -- Here I define all of the getter/setter functions as metadata. The actual -- functions are built programmatically below. -- premake.fields = { basedir = { kind = "path", scope = "container", }, buildaction = { kind = "string", scope = "config", allowed = { "Compile", "Copy", "Embed", "None" } }, buildoptions = { kind = "list", scope = "config", }, configurations = { kind = "list", scope = "solution", }, defines = { kind = "list", scope = "config", }, deploymentoptions = { kind = "list", scope = "config", }, excludes = { kind = "filelist", scope = "config", }, files = { kind = "filelist", scope = "config", }, flags = { kind = "list", scope = "config", isflags = true, allowed = { "EnableSSE", "EnableSSE2", "ExtraWarnings", "FatalWarnings", "FloatFast", "FloatStrict", "Managed", "MFC", "NativeWChar", "No64BitChecks", "NoEditAndContinue", "NoExceptions", "NoFramePointer", "NoImportLib", "NoManifest", "NoMinimalRebuild", "NoNativeWChar", "NoPCH", "NoRTTI", "Optimize", "OptimizeSize", "OptimizeSpeed", "SEH", "StaticRuntime", "Symbols", "Unicode", "Unsafe", "WinMain" } }, framework = { kind = "string", scope = "container", allowed = { "1.0", "1.1", "2.0", "3.0", "3.5", "4.0" } }, imagepath = { kind = "path", scope = "config", }, imageoptions = { kind = "list", scope = "config", }, implibdir = { kind = "path", scope = "config", }, implibextension = { kind = "string", scope = "config", }, implibname = { kind = "string", scope = "config", }, implibprefix = { kind = "string", scope = "config", }, implibsuffix = { kind = "string", scope = "config", }, includedirs = { kind = "dirlist", scope = "config", }, kind = { kind = "string", scope = "config", allowed = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" } }, language = { kind = "string", scope = "container", allowed = { "C", "C++", "C#" } }, libdirs = { kind = "dirlist", scope = "config", }, linkoptions = { kind = "list", scope = "config", }, links = { kind = "list", scope = "config", allowed = function(value) -- if library name contains a '/' then treat it as a path to a local file if value:find('/', nil, true) then value = path.getabsolute(value) end return value end }, location = { kind = "path", scope = "container", }, objdir = { kind = "path", scope = "config", }, pchheader = { kind = "string", scope = "config", }, pchsource = { kind = "path", scope = "config", }, platforms = { kind = "list", scope = "solution", allowed = table.keys(premake.platforms), }, postbuildcommands = { kind = "list", scope = "config", }, prebuildcommands = { kind = "list", scope = "config", }, prelinkcommands = { kind = "list", scope = "config", }, resdefines = { kind = "list", scope = "config", }, resincludedirs = { kind = "dirlist", scope = "config", }, resoptions = { kind = "list", scope = "config", }, targetdir = { kind = "path", scope = "config", }, targetextension = { kind = "string", scope = "config", }, targetname = { kind = "string", scope = "config", }, targetprefix = { kind = "string", scope = "config", }, targetsuffix = { kind = "string", scope = "config", }, trimpaths = { kind = "dirlist", scope = "config", }, uuid = { kind = "string", scope = "container", allowed = function(value) local ok = true if (#value ~= 36) then ok = false end for i=1,36 do local ch = value:sub(i,i) if (not ch:find("[ABCDEFabcdef0123456789-]")) then ok = false end end if (value:sub(9,9) ~= "-") then ok = false end if (value:sub(14,14) ~= "-") then ok = false end if (value:sub(19,19) ~= "-") then ok = false end if (value:sub(24,24) ~= "-") then ok = false end if (not ok) then return nil, "invalid UUID" end return value:upper() end }, } -- -- End of metadata -- -- -- Check to see if a value exists in a list of values, using a -- case-insensitive match. If the value does exist, the canonical -- version contained in the list is returned, so future tests can -- use case-sensitive comparisions. -- function premake.checkvalue(value, allowed) if (allowed) then if (type(allowed) == "function") then return allowed(value) else for _,v in ipairs(allowed) do if (value:lower() == v:lower()) then return v end end return nil, "invalid value '" .. value .. "'" end else return value end end -- -- Retrieve the current object of a particular type from the session. The -- type may be "solution", "container" (the last activated solution or -- project), or "config" (the last activated configuration). Returns the -- requested container, or nil and an error message. -- function premake.getobject(t) local container if (t == "container" or t == "solution") then container = premake.CurrentContainer else container = premake.CurrentConfiguration end if t == "solution" then if type(container) == "project" then container = container.solution end if type(container) ~= "solution" then container = nil end end local msg if (not container) then if (t == "container") then msg = "no active solution or project" elseif (t == "solution") then msg = "no active solution" else msg = "no active solution, project, or configuration" end end return container, msg end -- -- Adds values to an array field of a solution/project/configuration. `ctype` -- specifies the container type (see premake.getobject) for the field. -- function premake.setarray(ctype, fieldname, value, allowed) local container, err = premake.getobject(ctype) if (not container) then error(err, 4) end if (not container[fieldname]) then container[fieldname] = { } end local function doinsert(value, depth) if (type(value) == "table") then for _,v in ipairs(value) do doinsert(v, depth + 1) end else value, err = premake.checkvalue(value, allowed) if (not value) then error(err, depth) end table.insert(container[fieldname], value) end end if (value) then doinsert(value, 5) end return container[fieldname] end -- -- Adds values to an array-of-directories field of a solution/project/configuration. -- `ctype` specifies the container type (see premake.getobject) for the field. All -- values are converted to absolute paths before being stored. -- local function domatchedarray(ctype, fieldname, value, matchfunc) local result = { } function makeabsolute(value, depth) if (type(value) == "table") then for _, item in ipairs(value) do makeabsolute(item, depth + 1) end elseif type(value) == "string" then if value:find("*") then makeabsolute(matchfunc(value), depth + 1) else table.insert(result, path.getabsolute(value)) end else error("Invalid value in list: expected string, got " .. type(value), depth) end end makeabsolute(value, 3) return premake.setarray(ctype, fieldname, result) end function premake.setdirarray(ctype, fieldname, value) return domatchedarray(ctype, fieldname, value, os.matchdirs) end function premake.setfilearray(ctype, fieldname, value) return domatchedarray(ctype, fieldname, value, os.matchfiles) end -- -- Set a new value for a string field of a solution/project/configuration. `ctype` -- specifies the container type (see premake.getobject) for the field. -- function premake.setstring(ctype, fieldname, value, allowed) -- find the container for this value local container, err = premake.getobject(ctype) if (not container) then error(err, 4) end -- if a value was provided, set it if (value) then value, err = premake.checkvalue(value, allowed) if (not value) then error(err, 4) end container[fieldname] = value end return container[fieldname] end -- -- The getter/setter implemention. -- local function accessor(name, value) local kind = premake.fields[name].kind local scope = premake.fields[name].scope local allowed = premake.fields[name].allowed if ((kind == "string" or kind == "path") and value) then if type(value) ~= "string" then error("string value expected", 3) end end if (kind == "string") then return premake.setstring(scope, name, value, allowed) elseif (kind == "path") then if value then value = path.getabsolute(value) end return premake.setstring(scope, name, value) elseif (kind == "list") then return premake.setarray(scope, name, value, allowed) elseif (kind == "dirlist") then return premake.setdirarray(scope, name, value) elseif (kind == "filelist") then return premake.setfilearray(scope, name, value) end end -- -- Build all of the getter/setter functions from the metadata above. -- for name,_ in pairs(premake.fields) do _G[name] = function(value) return accessor(name, value) end end -- -- Project object constructors. -- function configuration(terms) if not terms then return premake.CurrentConfiguration end local container, err = premake.getobject("container") if (not container) then error(err, 2) end local cfg = { } cfg.terms = table.flatten({terms}) table.insert(container.blocks, cfg) premake.CurrentConfiguration = cfg -- create a keyword list using just the indexed keyword items. This is a little -- confusing: "terms" are what the user specifies in the script, "keywords" are -- the Lua patterns that result. I'll refactor to better names. cfg.keywords = { } for _, word in ipairs(cfg.terms) do table.insert(cfg.keywords, path.wildcards(word):lower()) end -- initialize list-type fields to empty tables for name, field in pairs(premake.fields) do if (field.kind ~= "string" and field.kind ~= "path") then cfg[name] = { } end end return cfg end function project(name) if not name then return iif(type(premake.CurrentContainer) == "project", premake.CurrentContainer, nil) end -- identify the parent solution local sln if (type(premake.CurrentContainer) == "project") then sln = premake.CurrentContainer.solution else sln = premake.CurrentContainer end if (type(sln) ~= "solution") then error("no active solution", 2) end -- if this is a new project, create it premake.CurrentContainer = sln.projects[name] if (not premake.CurrentContainer) then local prj = { } premake.CurrentContainer = prj -- add to master list keyed by both name and index table.insert(sln.projects, prj) sln.projects[name] = prj -- attach a type setmetatable(prj, { __type = "project", }) prj.solution = sln prj.name = name prj.basedir = os.getcwd() prj.uuid = os.uuid() prj.blocks = { } end -- add an empty, global configuration to the project configuration { } return premake.CurrentContainer end function solution(name) if not name then if type(premake.CurrentContainer) == "project" then return premake.CurrentContainer.solution else return premake.CurrentContainer end end premake.CurrentContainer = premake.solution.get(name) if (not premake.CurrentContainer) then premake.CurrentContainer = premake.solution.new(name) end -- add an empty, global configuration configuration { } return premake.CurrentContainer end -- -- Define a new action. -- -- @param a -- The new action object. -- function newaction(a) premake.action.add(a) end -- -- Define a new option. -- -- @param opt -- The new option object. -- function newoption(opt) premake.option.add(opt) end premake-4.3-src+repack1/src/base/tree.lua0000644000000000000000000001002711470465410016756 0ustar rootroot-- -- tree.lua -- Functions for working with the source code tree. -- Copyright (c) 2009 Jason Perkins and the Premake project -- premake.tree = { } local tree = premake.tree -- -- Create a new tree. -- -- @param n -- The name of the tree, applied to the root node (optional). -- function premake.tree.new(n) local t = { name = n, children = { } } return t end -- -- Add a new node to the tree, or returns the current node if it already exists. -- -- @param tr -- The tree to contain the new node. -- @param p -- The path of the new node. -- @returns -- The new tree node. -- function premake.tree.add(tr, p) -- Special case "." refers to the current node if p == "." then return tr end -- Look for the immediate parent for this new node, creating it if necessary. -- Recurses to create as much of the tree as necessary. local parentnode = tree.add(tr, path.getdirectory(p)) -- Another special case, ".." refers to the parent node and doesn't create anything local childname = path.getname(p) if childname == ".." then return parentnode end -- Create the child if necessary. If two children with the same name appear -- at the same level, make sure they have the same path to prevent conflicts -- i.e. ../Common and ../../Common can both appear at the top of the tree -- yet they have different paths (Bug #3016050) local childnode = parentnode.children[childname] if not childnode or childnode.path ~= p then childnode = tree.insert(parentnode, tree.new(childname)) childnode.path = p end return childnode end -- -- Insert one tree into another. -- -- @param parent -- The parent tree, to contain the child. -- @param child -- The child tree, to be inserted. -- function premake.tree.insert(parent, child) table.insert(parent.children, child) if child.name then parent.children[child.name] = child end child.parent = parent return child end -- -- Gets the node's relative path from it's parent. If the parent does not have -- a path set (it is the root or other container node) returns the full node path. -- -- @param node -- The node to query. -- function premake.tree.getlocalpath(node) if node.parent.path then return node.name else return node.path end end -- -- Remove a node from a tree. -- -- @param node -- The node to remove. -- function premake.tree.remove(node) local children = node.parent.children for i = 1, #children do if children[i] == node then table.remove(children, i) end end node.children = {} end -- -- Sort the nodes of a tree in-place. -- -- @param tr -- The tree to sort. -- function premake.tree.sort(tr) tree.traverse(tr, { onnode = function(node) table.sort(node.children, function(a,b) return a.name < b.name end) end }, true) end -- -- Traverse a tree. -- -- @param t -- The tree to traverse. -- @param fn -- A collection of callback functions, which may contain: -- -- onnode(node, depth) - called on each node encountered -- onleaf(node, depth) - called only on leaf nodes -- onbranch(node, depth) - called only on branch nodes -- -- @param includeroot -- True to include the root node in the traversal, otherwise it will be skipped. -- function premake.tree.traverse(t, fn, includeroot) local donode, dochildren donode = function(node, fn, depth) if node.isremoved then return end if fn.onnode then fn.onnode(node, depth) end if #node.children > 0 then if fn.onbranch then fn.onbranch(node, depth) end dochildren(node, fn, depth + 1) else if fn.onleaf then fn.onleaf(node, depth) end end end dochildren = function(parent, fn, depth) -- this goofy iterator allows nodes to be removed during the traversal local i = 1 while i <= #parent.children do local node = parent.children[i] donode(node, fn, depth) if node == parent.children[i] then i = i + 1 end end end if includeroot then donode(t, fn, 0) else dochildren(t, fn, 0) end end premake-4.3-src+repack1/src/base/path.lua0000644000000000000000000001413211470465410016754 0ustar rootroot-- -- path.lua -- Path manipulation functions. -- Copyright (c) 2002-2010 Jason Perkins and the Premake project -- -- -- Get the absolute file path from a relative path. The requested -- file path doesn't actually need to exist. -- function path.getabsolute(p) -- normalize the target path p = path.translate(p, "/") if (p == "") then p = "." end -- if the directory is already absolute I don't need to do anything local result = iif (path.isabsolute(p), nil, os.getcwd()) -- split up the supplied relative path and tackle it bit by bit for n, part in ipairs(p:explode("/", true)) do if (part == "" and n == 1) then result = "/" elseif (part == "..") then result = path.getdirectory(result) elseif (part ~= ".") then result = path.join(result, part) end end -- if I end up with a trailing slash remove it result = iif(result:endswith("/"), result:sub(1, -2), result) return result end -- -- Retrieve the filename portion of a path, without any extension. -- function path.getbasename(p) local name = path.getname(p) local i = name:findlast(".", true) if (i) then return name:sub(1, i - 1) else return name end end -- -- Retrieve the directory portion of a path, or an empty string if -- the path does not include a directory. -- function path.getdirectory(p) local i = p:findlast("/", true) if (i) then if i > 1 then i = i - 1 end return p:sub(1, i) else return "." end end -- -- Retrieve the drive letter, if a Windows path. -- function path.getdrive(p) local ch1 = p:sub(1,1) local ch2 = p:sub(2,2) if ch2 == ":" then return ch1 end end -- -- Retrieve the file extension. -- function path.getextension(p) local i = p:findlast(".", true) if (i) then return p:sub(i) else return "" end end -- -- Retrieve the filename portion of a path. -- function path.getname(p) local i = p:findlast("[/\\]") if (i) then return p:sub(i + 1) else return p end end -- -- Returns the relative path from src to dest. -- function path.getrelative(src, dst) -- normalize the two paths src = path.getabsolute(src) dst = path.getabsolute(dst) -- same directory? if (src == dst) then return "." end -- dollar macro? Can't tell what the real path is; use absolute -- This enables paths like $(SDK_ROOT)/include to work correctly. if dst:startswith("$") then return dst end src = src .. "/" dst = dst .. "/" -- find the common leading directories local idx = 0 while (true) do local tst = src:find("/", idx + 1, true) if tst then if src:sub(1,tst) == dst:sub(1,tst) then idx = tst else break end else break end end -- if they have nothing in common return absolute path local first = src:find("/", 0, true) if idx <= first then return dst:sub(1, -2) end -- trim off the common directories from the front src = src:sub(idx + 1) dst = dst:sub(idx + 1) -- back up from dst to get to this common parent local result = "" idx = src:find("/") while (idx) do result = result .. "../" idx = src:find("/", idx + 1) end -- tack on the path down to the dst from here result = result .. dst -- remove the trailing slash return result:sub(1, -2) end -- -- Returns true if the filename represents a C/C++ source code file. This check -- is used to prevent passing non-code files to the compiler in makefiles. It is -- not foolproof, but it has held up well. I'm open to better suggestions. -- function path.iscfile(fname) local extensions = { ".c", ".s", ".m" } local ext = path.getextension(fname):lower() return table.contains(extensions, ext) end function path.iscppfile(fname) local extensions = { ".cc", ".cpp", ".cxx", ".c", ".s", ".m", ".mm" } local ext = path.getextension(fname):lower() return table.contains(extensions, ext) end -- -- Returns true if the filename represents a Windows resource file. This check -- is used to prevent passing non-resources to the compiler in makefiles. -- function path.isresourcefile(fname) local extensions = { ".rc" } local ext = path.getextension(fname):lower() return table.contains(extensions, ext) end -- -- Join two pieces of a path together into a single path. -- function path.join(leading, trailing) leading = leading or "" if (not trailing) then return leading end if (path.isabsolute(trailing)) then return trailing end if (leading == ".") then leading = "" end if (leading:len() > 0 and not leading:endswith("/")) then leading = leading .. "/" end return leading .. trailing end -- -- Takes a path which is relative to one location and makes it relative -- to another location instead. -- function path.rebase(p, oldbase, newbase) p = path.getabsolute(path.join(oldbase, p)) p = path.getrelative(newbase, p) return p end -- -- Convert the separators in a path from one form to another. If `sep` -- is nil, then a platform-specific separator is used. -- function path.translate(p, sep) if (type(p) == "table") then local result = { } for _, value in ipairs(p) do table.insert(result, path.translate(value)) end return result else if (not sep) then if (os.is("windows")) then sep = "\\" else sep = "/" end end local result = p:gsub("[/\\]", sep) return result end end -- -- Converts from a simple wildcard syntax, where * is "match any" -- and ** is "match recursive", to the corresponding Lua pattern. -- -- @param pattern -- The wildcard pattern to convert. -- @returns -- The corresponding Lua pattern. -- function path.wildcards(pattern) -- Escape characters that have special meanings in Lua patterns pattern = pattern:gsub("([%+%.%-%^%$%(%)%%])", "%%%1") -- Replace wildcard patterns with special placeholders so I don't -- have competing star replacements to worry about pattern = pattern:gsub("%*%*", "\001") pattern = pattern:gsub("%*", "\002") -- Replace the placeholders with their Lua patterns pattern = pattern:gsub("\001", ".*") pattern = pattern:gsub("\002", "[^/]*") return pattern end premake-4.3-src+repack1/src/base/validate.lua0000644000000000000000000000474311470465410017620 0ustar rootroot-- -- validate.lua -- Tests to validate the run-time environment before starting the action. -- Copyright (c) 2002-2009 Jason Perkins and the Premake project -- -- -- Performs a sanity check of all of the solutions and projects -- in the session to be sure they meet some minimum requirements. -- function premake.checkprojects() local action = premake.action.current() for sln in premake.solution.each() do -- every solution must have at least one project if (#sln.projects == 0) then return nil, "solution '" .. sln.name .. "' needs at least one project" end -- every solution must provide a list of configurations if (#sln.configurations == 0) then return nil, "solution '" .. sln.name .. "' needs configurations" end for prj in premake.solution.eachproject(sln) do -- every project must have a language if (not prj.language) then return nil, "project '" ..prj.name .. "' needs a language" end -- and the action must support it if (action.valid_languages) then if (not table.contains(action.valid_languages, prj.language)) then return nil, "the " .. action.shortname .. " action does not support " .. prj.language .. " projects" end end for cfg in premake.eachconfig(prj) do -- every config must have a kind if (not cfg.kind) then return nil, "project '" ..prj.name .. "' needs a kind in configuration '" .. cfg.name .. "'" end -- and the action must support it if (action.valid_kinds) then if (not table.contains(action.valid_kinds, cfg.kind)) then return nil, "the " .. action.shortname .. " action does not support " .. cfg.kind .. " projects" end end end -- some actions have custom validation logic if action.oncheckproject then action.oncheckproject(prj) end end end return true end -- -- Check the specified tools (/cc, /dotnet, etc.) against the current action -- to make sure they are compatible and supported. -- function premake.checktools() local action = premake.action.current() if (not action.valid_tools) then return true end for tool, values in pairs(action.valid_tools) do if (_OPTIONS[tool]) then if (not table.contains(values, _OPTIONS[tool])) then return nil, "the " .. action.shortname .. " action does not support /" .. tool .. "=" .. _OPTIONS[tool] .. " (yet)" end else _OPTIONS[tool] = values[1] end end return true end premake-4.3-src+repack1/src/base/option.lua0000644000000000000000000000414111470465410017327 0ustar rootroot-- -- option.lua -- Work with the list of registered options. -- Copyright (c) 2002-2009 Jason Perkins and the Premake project -- premake.option = { } -- -- The list of registered options. -- premake.option.list = { } -- -- Register a new option. -- -- @param opt -- The new option object. -- function premake.option.add(opt) -- some sanity checking local missing for _, field in ipairs({ "description", "trigger" }) do if (not opt[field]) then missing = field end end if (missing) then error("option needs a " .. missing, 3) end -- add it to the master list premake.option.list[opt.trigger] = opt end -- -- Retrieve an option by name. -- -- @param name -- The name of the option to retrieve. -- @returns -- The requested option, or nil if the option does not exist. -- function premake.option.get(name) return premake.option.list[name] end -- -- Iterator for the list of options. -- function premake.option.each() -- sort the list by trigger local keys = { } for _, option in pairs(premake.option.list) do table.insert(keys, option.trigger) end table.sort(keys) local i = 0 return function() i = i + 1 return premake.option.list[keys[i]] end end -- -- Validate a list of user supplied key/value pairs against the list of registered options. -- -- @param values -- The list of user supplied key/value pairs. -- @returns --- True if the list of pairs are valid, false and an error message otherwise. -- function premake.option.validate(values) for key, value in pairs(values) do -- does this option exist local opt = premake.option.get(key) if (not opt) then return false, "invalid option '" .. key .. "'" end -- does it need a value? if (opt.value and value == "") then return false, "no value specified for option '" .. key .. "'" end -- is the value allowed? if (opt.allowed) then for _, match in ipairs(opt.allowed) do if (match[1] == value) then return true end end return false, "invalid value '" .. value .. "' for option '" .. key .. "'" end end return true end premake-4.3-src+repack1/src/base/globals.lua0000644000000000000000000000542411470465410017447 0ustar rootroot-- -- globals.lua -- Global tables and variables, replacements and extensions to Lua's global functions. -- Copyright (c) 2002-2009 Jason Perkins and the Premake project -- -- A top-level namespace for support functions premake = { } -- The list of supported platforms; also update list in cmdline.lua premake.platforms = { Native = { cfgsuffix = "", }, x32 = { cfgsuffix = "32", }, x64 = { cfgsuffix = "64", }, Universal = { cfgsuffix = "univ", }, Universal32 = { cfgsuffix = "univ32", }, Universal64 = { cfgsuffix = "univ64", }, PS3 = { cfgsuffix = "ps3", iscrosscompiler = true, nosharedlibs = true, namestyle = "PS3", }, Xbox360 = { cfgsuffix = "xbox360", iscrosscompiler = true, namestyle = "windows", }, } -- -- A replacement for Lua's built-in dofile() function, this one sets the -- current working directory to the script's location, enabling script-relative -- referencing of other files and resources. -- local builtin_dofile = dofile function dofile(fname) -- remember the current working directory and file; I'll restore it shortly local oldcwd = os.getcwd() local oldfile = _SCRIPT -- if the file doesn't exist, check the search path if (not os.isfile(fname)) then local path = os.pathsearch(fname, _OPTIONS["scripts"], os.getenv("PREMAKE_PATH")) if (path) then fname = path.."/"..fname end end -- use the absolute path to the script file, to avoid any file name -- ambiguity if an error should arise _SCRIPT = path.getabsolute(fname) -- switch the working directory to the new script location local newcwd = path.getdirectory(_SCRIPT) os.chdir(newcwd) -- run the chunk. How can I catch variable return values? local a, b, c, d, e, f = builtin_dofile(_SCRIPT) -- restore the previous working directory when done _SCRIPT = oldfile os.chdir(oldcwd) return a, b, c, d, e, f end -- -- "Immediate If" - returns one of the two values depending on the value of expr. -- function iif(expr, trueval, falseval) if (expr) then return trueval else return falseval end end -- -- A shortcut for including another "premake4.lua" file, often used for projects. -- function include(fname) return dofile(fname .. "/premake4.lua") end -- -- A shortcut for printing formatted output. -- function printf(msg, ...) print(string.format(msg, unpack(arg))) end -- -- An extension to type() to identify project object types by reading the -- "__type" field from the metatable. -- local builtin_type = type function type(t) local mt = getmetatable(t) if (mt) then if (mt.__type) then return mt.__type end end return builtin_type(t) end premake-4.3-src+repack1/src/base/solution.lua0000644000000000000000000000426111470465410017676 0ustar rootroot-- -- solution.lua -- Work with the list of solutions loaded from the script. -- Copyright (c) 2002-2009 Jason Perkins and the Premake project -- premake.solution = { } -- The list of defined solutions (which contain projects, etc.) premake.solution.list = { } -- -- Create a new solution and add it to the session. -- -- @param name -- The new solution's name. -- function premake.solution.new(name) local sln = { } -- add to master list keyed by both name and index table.insert(premake.solution.list, sln) premake.solution.list[name] = sln -- attach a type descriptor setmetatable(sln, { __type="solution" }) sln.name = name sln.basedir = os.getcwd() sln.projects = { } sln.blocks = { } sln.configurations = { } return sln end -- -- Iterate over the collection of solutions in a session. -- -- @returns -- An iterator function. -- function premake.solution.each() local i = 0 return function () i = i + 1 if i <= #premake.solution.list then return premake.solution.list[i] end end end -- -- Iterate over the projects of a solution. -- -- @param sln -- The solution. -- @returns -- An iterator function. -- function premake.solution.eachproject(sln) local i = 0 return function () i = i + 1 if (i <= #sln.projects) then return premake.solution.getproject(sln, i) end end end -- -- Retrieve a solution by name or index. -- -- @param key -- The solution key, either a string name or integer index. -- @returns -- The solution with the provided key. -- function premake.solution.get(key) return premake.solution.list[key] end -- -- Retrieve the project at a particular index. -- -- @param sln -- The solution. -- @param idx -- An index into the array of projects. -- @returns -- The project at the given index. -- function premake.solution.getproject(sln, idx) -- retrieve the root configuration of the project, with all of -- the global (not configuration specific) settings collapsed local prj = sln.projects[idx] local cfg = premake.getconfig(prj) -- root configuration doesn't have a name; use the project's cfg.name = prj.name return cfg end premake-4.3-src+repack1/src/base/cmdline.lua0000644000000000000000000000363211470465410017436 0ustar rootroot-- -- cmdline.lua -- Functions to define and handle command line actions and options. -- Copyright (c) 2002-2009 Jason Perkins and the Premake project -- -- -- Built-in command line options -- newoption { trigger = "cc", value = "VALUE", description = "Choose a C/C++ compiler set", allowed = { { "gcc", "GNU GCC (gcc/g++)" }, { "ow", "OpenWatcom" }, } } newoption { trigger = "dotnet", value = "VALUE", description = "Choose a .NET compiler set", allowed = { { "msnet", "Microsoft .NET (csc)" }, { "mono", "Novell Mono (mcs)" }, { "pnet", "Portable.NET (cscc)" }, } } newoption { trigger = "file", value = "FILE", description = "Read FILE as a Premake script; default is 'premake4.lua'" } newoption { trigger = "help", description = "Display this information" } newoption { trigger = "os", value = "VALUE", description = "Generate files for a different operating system", allowed = { { "bsd", "OpenBSD, NetBSD, or FreeBSD" }, { "linux", "Linux" }, { "macosx", "Apple Mac OS X" }, { "solaris", "Solaris" }, { "windows", "Microsoft Windows" }, } } newoption { trigger = "platform", value = "VALUE", description = "Add target architecture (if supported by action)", allowed = { { "x32", "32-bit" }, { "x64", "64-bit" }, { "universal", "Mac OS X Universal, 32- and 64-bit" }, { "universal32", "Mac OS X Universal, 32-bit only" }, { "universal64", "Mac OS X Universal, 64-bit only" }, { "ps3", "Playstation 3 (experimental)" }, { "xbox360", "Xbox 360 (experimental)" }, } } newoption { trigger = "scripts", value = "path", description = "Search for additional scripts on the given path" } newoption { trigger = "version", description = "Display version information" } premake-4.3-src+repack1/src/base/premake.lua0000644000000000000000000000157611470465410017454 0ustar rootroot-- -- premake.lua -- High-level processing functions. -- Copyright (c) 2002-2009 Jason Perkins and the Premake project -- -- -- Open a file for output, and call a function to actually do the writing. -- Used by the actions to generate solution and project files. -- -- @param obj -- A solution or project object; will be based to the callback function. -- @param filename -- The output filename; see the docs for premake.project.getfilename() -- for the expected format. -- @param callback -- The function responsible for writing the file, should take a solution -- or project as a parameters. -- function premake.generate(obj, filename, callback) filename = premake.project.getfilename(obj, filename) printf("Generating %s...", filename) local f, err = io.open(filename, "wb") if (not f) then error(err, 0) end io.output(f) callback(obj) f:close() end premake-4.3-src+repack1/src/base/os.lua0000644000000000000000000001042311470465410016440 0ustar rootroot-- -- os.lua -- Additions to the OS namespace. -- Copyright (c) 2002-2010 Jason Perkins and the Premake project -- -- -- Same as os.execute(), but accepts string formatting arguments. -- function os.executef(cmd, ...) cmd = string.format(cmd, unpack(arg)) return os.execute(cmd) end -- -- Scan the well-known system locations for a particular library. -- function os.findlib(libname) local path, formats -- assemble a search path, depending on the platform if os.is("windows") then formats = { "%s.dll", "%s" } path = os.getenv("PATH") else if os.is("macosx") then formats = { "lib%s.dylib", "%s.dylib" } path = os.getenv("DYLD_LIBRARY_PATH") else formats = { "lib%s.so", "%s.so" } path = os.getenv("LD_LIBRARY_PATH") or "" io.input("/etc/ld.so.conf") if io.input() then for line in io.lines() do path = path .. ":" .. line end io.input():close() end end table.insert(formats, "%s") path = (path or "") .. ":/lib:/usr/lib:/usr/local/lib" end for _, fmt in ipairs(formats) do local name = string.format(fmt, libname) local result = os.pathsearch(name, path) if result then return result end end end -- -- Retrieve the current operating system ID string. -- function os.get() return _OPTIONS.os or _OS end -- -- Check the current operating system; may be set with the /os command line flag. -- function os.is(id) return (os.get():lower() == id:lower()) end -- -- The os.matchdirs() and os.matchfiles() functions -- local function domatch(result, mask, wantfiles) -- need to remove extraneous path info from the mask to ensure a match -- against the paths returned by the OS. Haven't come up with a good -- way to do it yet, so will handle cases as they come up if mask:startswith("./") then mask = mask:sub(3) end -- strip off any leading directory information to find out -- where the search should take place local basedir = mask local starpos = mask:find("%*") if starpos then basedir = basedir:sub(1, starpos - 1) end basedir = path.getdirectory(basedir) if (basedir == ".") then basedir = "" end -- recurse into subdirectories? local recurse = mask:find("**", nil, true) -- convert mask to a Lua pattern mask = path.wildcards(mask) local function matchwalker(basedir) local wildcard = path.join(basedir, "*") -- retrieve files from OS and test against mask local m = os.matchstart(wildcard) while (os.matchnext(m)) do local isfile = os.matchisfile(m) if ((wantfiles and isfile) or (not wantfiles and not isfile)) then local fname = path.join(basedir, os.matchname(m)) if fname:match(mask) == fname then table.insert(result, fname) end end end os.matchdone(m) -- check subdirectories if recurse then m = os.matchstart(wildcard) while (os.matchnext(m)) do if not os.matchisfile(m) then local dirname = os.matchname(m) matchwalker(path.join(basedir, dirname)) end end os.matchdone(m) end end matchwalker(basedir) end function os.matchdirs(...) local result = { } for _, mask in ipairs(arg) do domatch(result, mask, false) end return result end function os.matchfiles(...) local result = { } for _, mask in ipairs(arg) do domatch(result, mask, true) end return result end -- -- An overload of the os.mkdir() function, which will create any missing -- subdirectories along the path. -- local builtin_mkdir = os.mkdir function os.mkdir(p) local dir = iif(p:startswith("/"), "/", "") for part in p:gmatch("[^/]+") do dir = dir .. part if (part ~= "" and not path.isabsolute(part) and not os.isdir(dir)) then local ok, err = builtin_mkdir(dir) if (not ok) then return nil, err end end dir = dir .. "/" end return true end -- -- Remove a directory, along with any contained files or subdirectories. -- local builtin_rmdir = os.rmdir function os.rmdir(p) -- recursively remove subdirectories local dirs = os.matchdirs(p .. "/*") for _, dname in ipairs(dirs) do os.rmdir(dname) end -- remove any files local files = os.matchfiles(p .. "/*") for _, fname in ipairs(files) do os.remove(fname) end -- remove this directory builtin_rmdir(p) end premake-4.3-src+repack1/src/base/help.lua0000644000000000000000000000230411470465410016746 0ustar rootroot-- -- help.lua -- User help, displayed on /help option. -- Copyright (c) 2002-2008 Jason Perkins and the Premake project -- function premake.showhelp() -- display the basic usage printf("Premake %s, a build script generator", _PREMAKE_VERSION) printf(_PREMAKE_COPYRIGHT) printf("%s %s", _VERSION, _COPYRIGHT) printf("") printf("Usage: premake4 [options] action [arguments]") printf("") -- display all options printf("OPTIONS") printf("") for option in premake.option.each() do local trigger = option.trigger local description = option.description if (option.value) then trigger = trigger .. "=" .. option.value end if (option.allowed) then description = description .. "; one of:" end printf(" --%-15s %s", trigger, description) if (option.allowed) then for _, value in ipairs(option.allowed) do printf(" %-14s %s", value[1], value[2]) end end printf("") end -- display all actions printf("ACTIONS") printf("") for action in premake.action.each() do printf(" %-17s %s", action.trigger, action.description) end printf("") -- see more printf("For additional information, see http://industriousone.com/premake") end premake-4.3-src+repack1/src/base/string.lua0000644000000000000000000000200111470465410017316 0ustar rootroot-- -- string.lua -- Additions to Lua's built-in string functions. -- Copyright (c) 2002-2008 Jason Perkins and the Premake project -- -- -- Returns an array of strings, each of which is a substring of s -- formed by splitting on boundaries formed by `pattern`. -- function string.explode(s, pattern, plain) if (pattern == '') then return false end local pos = 0 local arr = { } for st,sp in function() return s:find(pattern, pos, plain) end do table.insert(arr, s:sub(pos, st-1)) pos = sp + 1 end table.insert(arr, s:sub(pos)) return arr end -- -- Find the last instance of a pattern in a string. -- function string.findlast(s, pattern, plain) local curr = 0 repeat local next = s:find(pattern, curr + 1, plain) if (next) then curr = next end until (not next) if (curr > 0) then return curr end end -- -- Returns true if `haystack` starts with the sequence `needle`. -- function string.startswith(haystack, needle) return (haystack:find(needle, 1, true) == 1) end premake-4.3-src+repack1/src/base/io.lua0000644000000000000000000000273711470465410016437 0ustar rootroot-- -- io.lua -- Additions to the I/O namespace. -- Copyright (c) 2008-2009 Jason Perkins and the Premake project -- -- -- Prepare to capture the output from all subsequent calls to io.printf(), -- used for automated testing of the generators. -- function io.capture() io.captured = '' end -- -- Returns the captured text and stops capturing. -- function io.endcapture() local captured = io.captured io.captured = nil return captured end -- -- Open an overload of the io.open() function, which will create any missing -- subdirectories in the filename if "mode" is set to writeable. -- local builtin_open = io.open function io.open(fname, mode) if (mode) then if (mode:find("w")) then local dir = path.getdirectory(fname) ok, err = os.mkdir(dir) if (not ok) then error(err, 0) end end end return builtin_open(fname, mode) end -- -- A shortcut for printing formatted output to an output stream. -- function io.printf(msg, ...) if (not io.eol) then io.eol = "\n" end local s if type(msg) == "number" then s = string.rep("\t", msg) .. string.format(unpack(arg)) else s = string.format(msg, unpack(arg)) end if io.captured then io.captured = io.captured .. s .. io.eol else io.write(s) io.write(io.eol) end end -- -- Because I use io.printf() so often in the generators, create a terse shortcut -- for it. This saves me typing, and also reduces the size of the executable. -- _p = io.printf premake-4.3-src+repack1/tests/0000755000000000000000000000000011470465410014755 5ustar rootrootpremake-4.3-src+repack1/tests/pepperfish_profiler.lua0000644000000000000000000004601011470465410021530 0ustar rootroot--[[ == Introduction == Note that this requires os.clock(), debug.sethook(), and debug.getinfo() or your equivalent replacements to be available if this is an embedded application. Example usage: profiler = newProfiler() profiler:start() < call some functions that take time > profiler:stop() local outfile = io.open( "profile.txt", "w+" ) profiler:report( outfile ) outfile:close() == Optionally choosing profiling method == The rest of this comment can be ignored if you merely want a good profiler. newProfiler(method, sampledelay): If method is omitted or "time", will profile based on real performance. optionally, frequency can be provided to control the number of opcodes per profiling tick. By default this is 100000, which (on my system) provides one tick approximately every 2ms and reduces system performance by about 10%. This can be reduced to increase accuracy at the cost of performance, or increased for the opposite effect. If method is "call", will profile based on function calls. Frequency is ignored. "time" may bias profiling somewhat towards large areas with "simple opcodes", as the profiling function (which introduces a certain amount of unavoidable overhead) will be called more often. This can be minimized by using a larger sample delay - the default should leave any error largely overshadowed by statistical noise. With a delay of 1000 I was able to achieve inaccuray of approximately 25%. Increasing the delay to 100000 left inaccuracy below my testing error. "call" may bias profiling heavily towards areas with many function calls. Testing found a degenerate case giving a figure inaccurate by approximately 20,000%. (Yes, a multiple of 200.) This is, however, more directly comparable to common profilers (such as gprof) and also gives accurate function call counts, which cannot be retrieved from "time". I strongly recommend "time" mode, and it is now the default. == History == 2008-09-16 - Time-based profiling and conversion to Lua 5.1 by Ben Wilhelm ( zorba-pepperfish@pavlovian.net ). Added the ability to optionally choose profiling methods, along with a new profiling method. Converted to Lua 5, a few improvements, and additional documentation by Tom Spilman ( tom@sickheadgames.com ) Additional corrections and tidying by original author Daniel Silverstone ( dsilvers@pepperfish.net ) == Status == Daniel Silverstone is no longer using this code, and judging by how long it's been waiting for Lua 5.1 support, I don't think Tom Spilman is either. I'm perfectly willing to take on maintenance, so if you have problems or questions, go ahead and email me :) -- Ben Wilhelm ( zorba-pepperfish@pavlovian.net ) ' == Copyright == Lua profiler - Copyright Pepperfish 2002,2003,2004 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --]] -- -- All profiler related stuff is stored in the top level table '_profiler' -- _profiler = {} -- -- newProfiler() creates a new profiler object for managing -- the profiler and storing state. Note that only one profiler -- object can be executing at one time. -- function newProfiler(variant, sampledelay) if _profiler.running then print("Profiler already running.") return end variant = variant or "time" if variant ~= "time" and variant ~= "call" then print("Profiler method must be 'time' or 'call'.") return end local newprof = {} for k,v in pairs(_profiler) do newprof[k] = v end newprof.variant = variant newprof.sampledelay = sampledelay or 100000 return newprof end -- -- This function starts the profiler. It will do nothing -- if this (or any other) profiler is already running. -- function _profiler.start(self) if _profiler.running then return end -- Start the profiler. This begins by setting up internal profiler state _profiler.running = self self.rawstats = {} self.callstack = {} if self.variant == "time" then self.lastclock = os.clock() debug.sethook( _profiler_hook_wrapper_by_time, "", self.sampledelay ) elseif self.variant == "call" then debug.sethook( _profiler_hook_wrapper_by_call, "cr" ) else print("Profiler method must be 'time' or 'call'.") sys.exit(1) end end -- -- This function stops the profiler. It will do nothing -- if a profiler is not running, and nothing if it isn't -- the currently running profiler. -- function _profiler.stop(self) if _profiler.running ~= self then return end -- Stop the profiler. debug.sethook( nil ) _profiler.running = nil end -- -- Simple wrapper to handle the hook. You should not -- be calling this directly. Duplicated to reduce overhead. -- function _profiler_hook_wrapper_by_call(action) if _profiler.running == nil then debug.sethook( nil ) end _profiler.running:_internal_profile_by_call(action) end function _profiler_hook_wrapper_by_time(action) if _profiler.running == nil then debug.sethook( nil ) end _profiler.running:_internal_profile_by_time(action) end -- -- This is the main by-function-call function of the profiler and should not -- be called except by the hook wrapper -- function _profiler._internal_profile_by_call(self,action) -- Since we can obtain the 'function' for the item we've had call us, we -- can use that... local caller_info = debug.getinfo( 3 ) if caller_info == nil then print "No caller_info" return end --SHG_LOG("[_profiler._internal_profile] "..(caller_info.name or "")) -- Retrieve the most recent activation record... local latest_ar = nil if table.getn(self.callstack) > 0 then latest_ar = self.callstack[table.getn(self.callstack)] end -- Are we allowed to profile this function? local should_not_profile = 0 for k,v in pairs(self.prevented_functions) do if k == caller_info.func then should_not_profile = v end end -- Also check the top activation record... if latest_ar then if latest_ar.should_not_profile == 2 then should_not_profile = 2 end end -- Now then, are we in 'call' or 'return' ? -- print("Profile:", caller_info.name, "SNP:", should_not_profile, -- "Action:", action ) if action == "call" then -- Making a call... local this_ar = {} this_ar.should_not_profile = should_not_profile this_ar.parent_ar = latest_ar this_ar.anon_child = 0 this_ar.name_child = 0 this_ar.children = {} this_ar.children_time = {} this_ar.clock_start = os.clock() -- Last thing to do on a call is to insert this onto the ar stack... table.insert( self.callstack, this_ar ) else local this_ar = latest_ar if this_ar == nil then return -- No point in doing anything if no upper activation record end -- Right, calculate the time in this function... this_ar.clock_end = os.clock() this_ar.this_time = this_ar.clock_end - this_ar.clock_start -- Now, if we have a parent, update its call info... if this_ar.parent_ar then this_ar.parent_ar.children[caller_info.func] = (this_ar.parent_ar.children[caller_info.func] or 0) + 1 this_ar.parent_ar.children_time[caller_info.func] = (this_ar.parent_ar.children_time[caller_info.func] or 0 ) + this_ar.this_time if caller_info.name == nil then this_ar.parent_ar.anon_child = this_ar.parent_ar.anon_child + this_ar.this_time else this_ar.parent_ar.name_child = this_ar.parent_ar.name_child + this_ar.this_time end end -- Now if we're meant to record information about ourselves, do so... if this_ar.should_not_profile == 0 then local inforec = self:_get_func_rec(caller_info.func,1) inforec.count = inforec.count + 1 inforec.time = inforec.time + this_ar.this_time inforec.anon_child_time = inforec.anon_child_time + this_ar.anon_child inforec.name_child_time = inforec.name_child_time + this_ar.name_child inforec.func_info = caller_info for k,v in pairs(this_ar.children) do inforec.children[k] = (inforec.children[k] or 0) + v inforec.children_time[k] = (inforec.children_time[k] or 0) + this_ar.children_time[k] end end -- Last thing to do on return is to drop the last activation record... table.remove( self.callstack, table.getn( self.callstack ) ) end end -- -- This is the main by-time internal function of the profiler and should not -- be called except by the hook wrapper -- function _profiler._internal_profile_by_time(self,action) -- we do this first so we add the minimum amount of extra time to this call local timetaken = os.clock() - self.lastclock local depth = 3 local at_top = true local last_caller local caller = debug.getinfo(depth) while caller do if not caller.func then caller.func = "(tail call)" end if self.prevented_functions[caller.func] == nil then local info = self:_get_func_rec(caller.func, 1, caller) info.count = info.count + 1 info.time = info.time + timetaken if last_caller then -- we're not the head, so update the "children" times also if last_caller.name then info.name_child_time = info.name_child_time + timetaken else info.anon_child_time = info.anon_child_time + timetaken end info.children[last_caller.func] = (info.children[last_caller.func] or 0) + 1 info.children_time[last_caller.func] = (info.children_time[last_caller.func] or 0) + timetaken end end depth = depth + 1 last_caller = caller caller = debug.getinfo(depth) end self.lastclock = os.clock() end -- -- This returns a (possibly empty) function record for -- the specified function. It is for internal profiler use. -- function _profiler._get_func_rec(self,func,force,info) -- Find the function ref for 'func' (if force and not present, create one) local ret = self.rawstats[func] if ret == nil and force ~= 1 then return nil end if ret == nil then -- Build a new function statistics table ret = {} ret.func = func ret.count = 0 ret.time = 0 ret.anon_child_time = 0 ret.name_child_time = 0 ret.children = {} ret.children_time = {} ret.func_info = info self.rawstats[func] = ret end return ret end -- -- This writes a profile report to the output file object. If -- sort_by_total_time is nil or false the output is sorted by -- the function time minus the time in it's children. -- function _profiler.report( self, outfile, sort_by_total_time ) outfile:write [[Lua Profile output created by profiler.lua. Copyright Pepperfish 2002+ ]] -- This is pretty awful. local terms = {} if self.variant == "time" then terms.capitalized = "Sample" terms.single = "sample" terms.pastverb = "sampled" elseif self.variant == "call" then terms.capitalized = "Call" terms.single = "call" terms.pastverb = "called" else assert(false) end local total_time = 0 local ordering = {} for func,record in pairs(self.rawstats) do table.insert(ordering, func) end if sort_by_total_time then table.sort( ordering, function(a,b) return self.rawstats[a].time > self.rawstats[b].time end ) else table.sort( ordering, function(a,b) local arec = self.rawstats[a] local brec = self.rawstats[b] local atime = arec.time - (arec.anon_child_time + arec.name_child_time) local btime = brec.time - (brec.anon_child_time + brec.name_child_time) return atime > btime end ) end for i=1,table.getn(ordering) do local func = ordering[i] local record = self.rawstats[func] local thisfuncname = " " .. self:_pretty_name(func) .. " " if string.len( thisfuncname ) < 42 then thisfuncname = string.rep( "-", (42 - string.len(thisfuncname))/2 ) .. thisfuncname thisfuncname = thisfuncname .. string.rep( "-", 42 - string.len(thisfuncname) ) end total_time = total_time + ( record.time - ( record.anon_child_time + record.name_child_time ) ) outfile:write( string.rep( "-", 19 ) .. thisfuncname .. string.rep( "-", 19 ) .. "\n" ) outfile:write( terms.capitalized.." count: " .. string.format( "%4d", record.count ) .. "\n" ) outfile:write( "Time spend total: " .. string.format( "%4.3f", record.time ) .. "s\n" ) outfile:write( "Time spent in children: " .. string.format("%4.3f",record.anon_child_time+record.name_child_time) .. "s\n" ) local timeinself = record.time - (record.anon_child_time + record.name_child_time) outfile:write( "Time spent in self: " .. string.format("%4.3f", timeinself) .. "s\n" ) outfile:write( "Time spent per " .. terms.single .. ": " .. string.format("%4.5f", record.time/record.count) .. "s/" .. terms.single .. "\n" ) outfile:write( "Time spent in self per "..terms.single..": " .. string.format( "%4.5f", timeinself/record.count ) .. "s/" .. terms.single.."\n" ) -- Report on each child in the form -- Child called n times and took a.bs local added_blank = 0 for k,v in pairs(record.children) do if self.prevented_functions[k] == nil or self.prevented_functions[k] == 0 then if added_blank == 0 then outfile:write( "\n" ) -- extra separation line added_blank = 1 end outfile:write( "Child " .. self:_pretty_name(k) .. string.rep( " ", 41-string.len(self:_pretty_name(k)) ) .. " " .. terms.pastverb.." " .. string.format("%6d", v) ) outfile:write( " times. Took " .. string.format("%4.2f", record.children_time[k] ) .. "s\n" ) end end outfile:write( "\n" ) -- extra separation line outfile:flush() end outfile:write( "\n\n" ) outfile:write( "Total time spent in profiled functions: " .. string.format("%5.3g",total_time) .. "s\n" ) outfile:write( [[ END ]] ) outfile:flush() end -- -- This writes the profile to the output file object as -- loadable Lua source. -- function _profiler.lua_report(self,outfile) -- Purpose: Write out the entire raw state in a cross-referenceable form. local ordering = {} local functonum = {} for func,record in pairs(self.rawstats) do table.insert(ordering, func) functonum[func] = table.getn(ordering) end outfile:write( "-- Profile generated by profiler.lua Copyright Pepperfish 2002+\n\n" ) outfile:write( "-- Function names\nfuncnames = {}\n" ) for i=1,table.getn(ordering) do local thisfunc = ordering[i] outfile:write( "funcnames[" .. i .. "] = " .. string.format("%q", self:_pretty_name(thisfunc)) .. "\n" ) end outfile:write( "\n" ) outfile:write( "-- Function times\nfunctimes = {}\n" ) for i=1,table.getn(ordering) do local thisfunc = ordering[i] local record = self.rawstats[thisfunc] outfile:write( "functimes[" .. i .. "] = { " ) outfile:write( "tot=" .. record.time .. ", " ) outfile:write( "achild=" .. record.anon_child_time .. ", " ) outfile:write( "nchild=" .. record.name_child_time .. ", " ) outfile:write( "count=" .. record.count .. " }\n" ) end outfile:write( "\n" ) outfile:write( "-- Child links\nchildren = {}\n" ) for i=1,table.getn(ordering) do local thisfunc = ordering[i] local record = self.rawstats[thisfunc] outfile:write( "children[" .. i .. "] = { " ) for k,v in pairs(record.children) do if functonum[k] then -- non-recorded functions will be ignored now outfile:write( functonum[k] .. ", " ) end end outfile:write( "}\n" ) end outfile:write( "\n" ) outfile:write( "-- Child call counts\nchildcounts = {}\n" ) for i=1,table.getn(ordering) do local thisfunc = ordering[i] local record = self.rawstats[thisfunc] outfile:write( "children[" .. i .. "] = { " ) for k,v in record.children do if functonum[k] then -- non-recorded functions will be ignored now outfile:write( v .. ", " ) end end outfile:write( "}\n" ) end outfile:write( "\n" ) outfile:write( "-- Child call time\nchildtimes = {}\n" ) for i=1,table.getn(ordering) do local thisfunc = ordering[i] local record = self.rawstats[thisfunc]; outfile:write( "children[" .. i .. "] = { " ) for k,v in pairs(record.children) do if functonum[k] then -- non-recorded functions will be ignored now outfile:write( record.children_time[k] .. ", " ) end end outfile:write( "}\n" ) end outfile:write( "\n\n-- That is all.\n\n" ) outfile:flush() end -- Internal function to calculate a pretty name for the profile output function _profiler._pretty_name(self,func) -- Only the data collected during the actual -- run seems to be correct.... why? local info = self.rawstats[ func ].func_info -- local info = debug.getinfo( func ) local name = "" if info.what == "Lua" then name = "L:" end if info.what == "C" then name = "C:" end if info.what == "main" then name = " :" end if info.name == nil then name = name .. "<"..tostring(func) .. ">" else name = name .. info.name end if info.source then name = name .. "@" .. info.source else if info.what == "C" then name = name .. "@?" else name = name .. "@" end end name = name .. ":" if info.what == "C" then name = name .. "?" else name = name .. info.linedefined end return name end -- -- This allows you to specify functions which you do -- not want profiled. Setting level to 1 keeps the -- function from being profiled. Setting level to 2 -- keeps both the function and its children from -- being profiled. -- -- BUG: 2 will probably act exactly like 1 in "time" mode. -- If anyone cares, let me (zorba) know and it can be fixed. -- function _profiler.prevent(self, func, level) self.prevented_functions[func] = (level or 1) end _profiler.prevented_functions = { [_profiler.start] = 2, [_profiler.stop] = 2, [_profiler._internal_profile_by_time] = 2, [_profiler._internal_profile_by_call] = 2, [_profiler_hook_wrapper_by_time] = 2, [_profiler_hook_wrapper_by_call] = 2, [_profiler.prevent] = 2, [_profiler._get_func_rec] = 2, [_profiler.report] = 2, [_profiler.lua_report] = 2, [_profiler._pretty_name] = 2 } premake-4.3-src+repack1/tests/premake4.lua0000644000000000000000000000453511470465410017177 0ustar rootroot-- -- tests/premake4.lua -- Automated test suite for Premake 4.x -- Copyright (c) 2008-2010 Jason Perkins and the Premake project -- dofile("testfx.lua") -- -- Some helper functions -- test.createsolution = function() local sln = solution "MySolution" configurations { "Debug", "Release" } local prj = project "MyProject" language "C++" kind "ConsoleApp" return sln, prj end test.createproject = function(sln) local n = #sln.projects + 1 if n == 1 then n = "" end local prj = project ("MyProject" .. n) language "C++" kind "ConsoleApp" return prj end -- -- The test suites -- dofile("test_dofile.lua") dofile("test_string.lua") dofile("test_premake.lua") dofile("test_project.lua") dofile("test_platforms.lua") dofile("test_targets.lua") dofile("test_keywords.lua") dofile("test_gcc.lua") dofile("test_gmake_cpp.lua") dofile("test_gmake_cs.lua") dofile("base/test_api.lua") dofile("base/test_action.lua") dofile("base/test_baking.lua") dofile("base/test_config.lua") dofile("base/test_os.lua") dofile("base/test_path.lua") dofile("base/test_table.lua") dofile("base/test_tree.lua") -- Clean tests dofile("actions/test_clean.lua") -- Visual Studio tests dofile("test_vs2002_sln.lua") dofile("test_vs2003_sln.lua") dofile("test_vs2005_sln.lua") dofile("test_vs2008_sln.lua") dofile("test_vs2010_sln.lua") dofile("actions/vstudio/test_vs2005_csproj.lua") dofile("actions/vstudio/test_vs200x_vcproj.lua") dofile("actions/vstudio/test_vs200x_vcproj_linker.lua") dofile("actions/vstudio/test_vs2010_vcxproj.lua") dofile("actions/vstudio/test_vs2010_flags.lua") dofile("actions/vstudio/test_vs2010_links.lua") dofile("actions/vstudio/test_vs2010_filters.lua") dofile("actions/vstudio/test_vs2010_project_kinds.lua") -- Makefile tests dofile("actions/make/test_make_escaping.lua") dofile("actions/make/test_make_pch.lua") -- Xcode tests dofile("actions/xcode/test_xcode_common.lua") dofile("actions/xcode/test_xcode_project.lua") dofile("actions/xcode/test_xcode_dependencies.lua") -- -- Register a test action -- newaction { trigger = "test", description = "Run the automated test suite", execute = function () passed, failed = test.runall() msg = string.format("%d tests passed, %d failed", passed, failed) if (failed > 0) then error(msg, 0) else print(msg) end end } premake-4.3-src+repack1/tests/test_project.lua0000644000000000000000000000561411470465410020173 0ustar rootroot-- -- tests/test_project.lua -- Automated test suite for the project support functions. -- Copyright (c) 2008-2010 Jason Perkins and the Premake project -- local _project = premake.project T.project = { } local cfg, result function T.project.setup() _ACTION = "gmake" cfg = {} cfg.project = {} cfg.language = "C++" cfg.files = {} cfg.trimpaths = {} cfg.platform = "Native" result = "\n" end -- -- findproject() tests -- function T.project.findproject_IsCaseSensitive() local sln = test.createsolution() local prj = test.createproject(sln) premake.buildconfigs() test.isnil(premake.findproject("myproject")) end -- -- getfilename() tests -- function T.project.getfilename_ReturnsRelativePath() local prj = { name = "project", location = "location" } local r = _project.getfilename(prj, path.join(os.getcwd(), "../filename")) test.isequal("../filename", r) end function T.project.getfilename_PerformsSubstitutions() local prj = { name = "project", location = "location" } local r = _project.getfilename(prj, "%%.prj") test.isequal("location/project.prj", r) end -- -- premake.getlinks() tests -- function T.project.getlinks_OnMscSystemLibs() _OPTIONS.cc = "msc" cfg.links = { "user32", "gdi32" } result = premake.getlinks(cfg, "all", "fullpath") test.isequal("user32.lib gdi32.lib", table.concat(result, " ")) end -- -- premake.walksources() tests -- local function walktest(prj, fname, state, nestlevel) local item if (state == "GroupStart") then item = "<" .. fname .. ">" elseif (state == "GroupEnd") then item = "" else item = fname end result = result .. string.rep("-", nestlevel) .. item .. "\n" end function T.project.walksources_OnNoFiles() premake.walksources(cfg, walktest) test.isequal("\n" .. "" ,result) end function T.project.walksources_OnSingleFile() cfg.files = { "hello.cpp" } premake.walksources(cfg, walktest) test.isequal("\n" .. "hello.cpp\n" ,result) end function T.project.walksources_OnNestedGroups() cfg.files = { "rootfile.c", "level1/level1.c", "level1/level2/level2.c" } premake.walksources(cfg, walktest) test.isequal("\n" .. "\n" .. "-\n" .. "--level1/level2/level2.c\n" .. "-\n" .. "-level1/level1.c\n" .. "\n" .. "rootfile.c\n" ,result) end function T.project.walksources_OnDottedFolders() cfg.files = { "src/lua-5.1.2/lapi.c" } premake.walksources(cfg, walktest) test.isequal("\n" .. "\n" .. "-\n" .. "--src/lua-5.1.2/lapi.c\n" .. "-\n" .. "\n" ,result) end function T.project.walksources_OnDotDotLeaders() cfg.files = { "../src/hello.c", } premake.walksources(cfg, walktest) test.isequal("\n" .. "<../src>\n" .. "-../src/hello.c\n" .. "\n" ,result) end premake-4.3-src+repack1/tests/test_premake.lua0000644000000000000000000000201611470465410020142 0ustar rootroot-- -- tests/test_premake.lua -- Automated test suite for the Premake support functions. -- Copyright (c) 2008-2009 Jason Perkins and the Premake project -- T.premake = { } -- -- premake.checktools() tests -- function T.premake.checktools_SetsDefaultTools() _ACTION = "gmake" premake.checktools() test.isequal("gcc", _OPTIONS.cc) test.isequal("mono", _OPTIONS.dotnet) end function T.premake.checktools_Fails_OnToolMismatch() _ACTION = "gmake" _OPTIONS["cc"] = "xyz" ok, err = premake.checktools() test.isfalse( ok ) test.isequal("the GNU Make action does not support /cc=xyz (yet)", err) end -- -- generate() tests -- function T.premake.generate_OpensCorrectFile() prj = { name = "MyProject", location = "MyLocation" } premake.generate(prj, "%%.prj", function () end) test.openedfile("MyLocation/MyProject.prj") end function T.premake.generate_ClosesFile() prj = { name = "MyProject", location = "MyLocation" } premake.generate(prj, "%%.prj", function () end) test.closedfile(true) end premake-4.3-src+repack1/tests/test_gmake_cs.lua0000644000000000000000000000267511470465410020302 0ustar rootroot-- -- tests/test_gmake_cs.lua -- Automated test suite for GNU Make C/C++ project generation. -- Copyright (c) 2009 Jason Perkins and the Premake project -- T.gmake_cs = { } -- -- Configure a solution for testing -- local sln, prj function T.gmake_cs.setup() _ACTION = "gmake" _OPTIONS.os = "linux" sln = solution "MySolution" configurations { "Debug", "Release" } platforms { "native" } prj = project "MyProject" language "C#" kind "ConsoleApp" end local function prepare() io.capture() premake.buildconfigs() end -- -- Test configuration blocks -- function T.gmake_cs.BasicCfgBlock() prepare() local cfg = premake.getconfig(prj, "Debug") premake.gmake_cs_config(cfg, premake.dotnet, {[cfg]={}}) test.capture [[ ifneq (,$(findstring debug,$(config))) TARGETDIR := . OBJDIR := obj/Debug DEPENDS := REFERENCES := FLAGS += define PREBUILDCMDS endef define PRELINKCMDS endef define POSTBUILDCMDS endef endif ]] end function T.gmake_cs.OnBuildOptions() buildoptions { "/define:SYMBOL" } prepare() local cfg = premake.getconfig(prj, "Debug") premake.gmake_cs_config(cfg, premake.dotnet, {[cfg]={}}) test.capture [[ ifneq (,$(findstring debug,$(config))) TARGETDIR := . OBJDIR := obj/Debug DEPENDS := REFERENCES := FLAGS += /define:SYMBOL define PREBUILDCMDS endef define PRELINKCMDS endef define POSTBUILDCMDS endef endif ]] end premake-4.3-src+repack1/tests/test_stress.lua0000644000000000000000000000154211470465410020044 0ustar rootroot-- -- tests/tests_stress.lua -- Stress test for Premake. -- Copyright (c) 2009 Jason Perkins and the Premake project -- local numprojects = 100 local numfiles = 100 dofile("pepperfish_profiler.lua") profiler = newProfiler() function dumpresults(sorttotal) local outfile = io.open("build/profile.txt", "w+" ) profiler:report(outfile, sorttotal) outfile:close() end solution "MySolution" configurations { "Debug", "Release", "DebugDLL", "ReleaseDLL" } platforms { "Native", "x32", "x64" } location "build" configuration "Debug" defines { "_DEBUG" } flags { "Symbols" } configuration "Release" defines { "NDEBUG" } flags { "Optimize" } for pi = 1, numprojects do project ("Project" .. pi) location "build" kind "ConsoleApp" language "C++" for fi = 1, numfiles do files { "file" .. fi .. ".cpp" } end end premake-4.3-src+repack1/tests/test_dofile.lua0000644000000000000000000000120611470465410017760 0ustar rootroot-- -- tests/test_dofile.lua -- Automated test suite for the extended dofile() functions. -- Copyright (c) 2008 Jason Perkins and the Premake project -- T.dofile = { } local os_getenv function T.dofile.setup() os_getenv = os.getenv end function T.dofile.teardown() os.getenv = os_getenv end -- -- dofile() tests -- function T.dofile.SearchesPath() os.getenv = function() return os.getcwd().."/folder" end result = dofile("ok.lua") test.isequal("ok", result) end function T.dofile.SearchesScriptsOption() _OPTIONS["scripts"] = os.getcwd().."/folder" result = dofile("ok.lua") test.isequal("ok", result) end premake-4.3-src+repack1/tests/test_vs2005_sln.lua0000644000000000000000000002127411470465410020340 0ustar rootroot-- -- tests/test_vs2005_sln.lua -- Automated test suite for Visual Studio 2005 solution generation. -- Copyright (c) 2009 Jason Perkins and the Premake project -- T.vs2005_sln = { } -- -- Configure a solution for testing -- local sln function T.vs2005_sln.setup() sln = solution "MySolution" configurations { "Debug", "Release" } platforms {} project "MyProject" language "C++" kind "ConsoleApp" uuid "AE61726D-187C-E440-BD07-2556188A6565" _ACTION = 'vs2005' end local function prepare() io.capture() premake.buildconfigs() sln.vstudio_configs = premake.vstudio_buildconfigs(sln) end local function addnetproject() project "MyNetProject" language "C#" kind "ConsoleApp" uuid "C9135098-6047-8142-B10E-D27E7F73FCB3" end -- -- Make sure I've got the basic layout correct -- function T.vs2005_sln.BasicLayout() prepare() premake.vs2005_solution(sln) test.capture ('\239\187\191' .. [[ Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyProject", "MyProject.vcproj", "{AE61726D-187C-E440-BD07-2556188A6565}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.ActiveCfg = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.Build.0 = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.ActiveCfg = Release|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal ]]) end -- -- Test a mixed runtime (C++/.NET) solution. -- function T.vs2005_sln.SolutionPlatforms_OnMixedModes() addnetproject() prepare() premake.vs2005_solution_platforms(sln) test.capture [[ GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|Mixed Platforms = Debug|Mixed Platforms Debug|Win32 = Debug|Win32 Release|Any CPU = Release|Any CPU Release|Mixed Platforms = Release|Mixed Platforms Release|Win32 = Release|Win32 EndGlobalSection ]] end function T.vs2005_sln.ProjectPlatforms_OnMixedModes() addnetproject() prepare() premake.vs2005_solution_project_platforms(sln) test.capture [[ GlobalSection(ProjectConfigurationPlatforms) = postSolution {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Any CPU.ActiveCfg = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.ActiveCfg = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.Build.0 = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release|Any CPU.ActiveCfg = Release|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release|Mixed Platforms.ActiveCfg = Release|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release|Mixed Platforms.Build.0 = Release|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.ActiveCfg = Release|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.Build.0 = Release|Win32 {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Any CPU.Build.0 = Debug|Any CPU {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Win32.ActiveCfg = Debug|Any CPU {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Any CPU.ActiveCfg = Release|Any CPU {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Any CPU.Build.0 = Release|Any CPU {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Mixed Platforms.Build.0 = Release|Any CPU {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Win32.ActiveCfg = Release|Any CPU EndGlobalSection ]] end -- -- Test multiple platforms -- function T.vs2005_sln.SolutionPlatforms_OnMultiplePlatforms() platforms { "x32", "x64" } prepare() premake.vs2005_solution_platforms(sln) test.capture [[ GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection ]] end function T.vs2005_sln.ProjectPlatforms_OnMultiplePlatforms() platforms { "x32", "x64" } prepare() premake.vs2005_solution_project_platforms(sln) test.capture [[ GlobalSection(ProjectConfigurationPlatforms) = postSolution {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.ActiveCfg = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.Build.0 = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Debug|x64.ActiveCfg = Debug|x64 {AE61726D-187C-E440-BD07-2556188A6565}.Debug|x64.Build.0 = Debug|x64 {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.ActiveCfg = Release|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.Build.0 = Release|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release|x64.ActiveCfg = Release|x64 {AE61726D-187C-E440-BD07-2556188A6565}.Release|x64.Build.0 = Release|x64 EndGlobalSection ]] end function T.vs2005_sln.ProjectPlatforms_OnMultiplePlatformsAndMixedModes() platforms { "x32", "x64" } addnetproject() prepare() premake.vs2005_solution_project_platforms(sln) test.capture [[ GlobalSection(ProjectConfigurationPlatforms) = postSolution {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Any CPU.ActiveCfg = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.ActiveCfg = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.Build.0 = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Debug|x64.ActiveCfg = Debug|x64 {AE61726D-187C-E440-BD07-2556188A6565}.Debug|x64.Build.0 = Debug|x64 {AE61726D-187C-E440-BD07-2556188A6565}.Release|Any CPU.ActiveCfg = Release|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release|Mixed Platforms.ActiveCfg = Release|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release|Mixed Platforms.Build.0 = Release|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.ActiveCfg = Release|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.Build.0 = Release|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release|x64.ActiveCfg = Release|x64 {AE61726D-187C-E440-BD07-2556188A6565}.Release|x64.Build.0 = Release|x64 {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Any CPU.Build.0 = Debug|Any CPU {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Win32.ActiveCfg = Debug|Any CPU {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|x64.ActiveCfg = Debug|Any CPU {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Any CPU.ActiveCfg = Release|Any CPU {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Any CPU.Build.0 = Release|Any CPU {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Mixed Platforms.Build.0 = Release|Any CPU {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Win32.ActiveCfg = Release|Any CPU {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|x64.ActiveCfg = Release|Any CPU EndGlobalSection ]] end -- -- Test PS3 support -- function T.vs2005_sln.SolutionPlatforms_OnPS3() platforms { "PS3" } prepare() premake.vs2005_solution_platforms(sln) test.capture [[ GlobalSection(SolutionConfigurationPlatforms) = preSolution PS3 Debug|Win32 = PS3 Debug|Win32 PS3 Release|Win32 = PS3 Release|Win32 EndGlobalSection ]] end function T.vs2005_sln.ProjectPlatforms_OnPS3() platforms { "PS3" } prepare() premake.vs2005_solution_project_platforms(sln) test.capture [[ GlobalSection(ProjectConfigurationPlatforms) = postSolution {AE61726D-187C-E440-BD07-2556188A6565}.PS3 Debug|Win32.ActiveCfg = PS3 Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.PS3 Debug|Win32.Build.0 = PS3 Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.PS3 Release|Win32.ActiveCfg = PS3 Release|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.PS3 Release|Win32.Build.0 = PS3 Release|Win32 EndGlobalSection ]] end premake-4.3-src+repack1/tests/test_vs2003_sln.lua0000644000000000000000000000305311470465410020331 0ustar rootroot-- -- tests/test_vs2003_sln.lua -- Automated test suite for Visual Studio 2003 solution generation. -- Copyright (c) 2009 Jason Perkins and the Premake project -- T.vs2003_sln = { } -- -- Configure a solution for testing -- local sln function T.vs2003_sln.setup() _ACTION = "vs2003" sln = solution "MySolution" configurations { "Debug", "Release" } platforms {} prj = project "MyProject" language "C++" kind "ConsoleApp" uuid "AE61726D-187C-E440-BD07-2556188A6565" premake.buildconfigs() end -- -- Make sure I've got the basic layout correct -- function T.vs2003_sln.BasicLayout() io.capture() premake.vs2003_solution(sln) test.capture [[ Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyProject", "MyProject.vcproj", "{AE61726D-187C-E440-BD07-2556188A6565}" EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection GlobalSection(ProjectDependencies) = postSolution EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {AE61726D-187C-E440-BD07-2556188A6565}.Debug.ActiveCfg = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Debug.Build.0 = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release.ActiveCfg = Release|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal ]] end premake-4.3-src+repack1/tests/test_vs2002_sln.lua0000644000000000000000000000306711470465410020335 0ustar rootroot-- -- tests/test_vs2002_sln.lua -- Automated test suite for Visual Studio 2002 solution generation. -- Copyright (c) 2009 Jason Perkins and the Premake project -- T.vs2002_sln = { } -- -- Configure a solution for testing -- local sln function T.vs2002_sln.setup() _ACTION = 'vs2002' sln = solution "MySolution" configurations { "Debug", "Release" } platforms {} prj = project "MyProject" language "C++" kind "ConsoleApp" uuid "AE61726D-187C-E440-BD07-2556188A6565" premake.buildconfigs() end -- -- Make sure I've got the basic layout correct -- function T.vs2002_sln.BasicLayout() io.capture() premake.vs2002_solution(sln) test.capture [[ Microsoft Visual Studio Solution File, Format Version 7.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyProject", "MyProject.vcproj", "{AE61726D-187C-E440-BD07-2556188A6565}" EndProject Global GlobalSection(SolutionConfiguration) = preSolution ConfigName.0 = Debug ConfigName.1 = Release EndGlobalSection GlobalSection(ProjectDependencies) = postSolution EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {AE61726D-187C-E440-BD07-2556188A6565}.Debug.ActiveCfg = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Debug.Build.0 = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release.ActiveCfg = Release|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal ]] end premake-4.3-src+repack1/tests/test_targets.lua0000644000000000000000000001606011470465410020173 0ustar rootroot-- -- tests/test_targets.lua -- Automated test suite for premake.gettarget() -- Copyright (c) 2008, 2009 Jason Perkins and the Premake project -- T.targets = { } local cfg function T.targets.setup() cfg = { } cfg.basedir = "." cfg.location = "." cfg.targetdir = "../bin" cfg.language = "C++" cfg.project = { name = "MyProject" } cfg.flags = { } cfg.objectsdir = "obj" cfg.platform = "Native" end -- -- Path Style Name Style Example Environment -- ---------- ---------- ------------------- -- windows windows VStudio with MSC -- posix posix GMake with GCC -- windows posix VStudio for PS3 -- posix windows GMake for .NET -- -- -- ConsoleApp tests -- function T.targets.ConsoleApp_Build_WindowsNames() cfg.kind = "ConsoleApp" result = premake.gettarget(cfg, "build", "posix", "windows", "macosx") test.isequal([[../bin/MyProject.exe]], result.fullpath) end function T.targets.ConsoleApp_Build_PosixNames_OnWindows() cfg.kind = "ConsoleApp" result = premake.gettarget(cfg, "build", "posix", "posix", "windows") test.isequal([[../bin/MyProject.exe]], result.fullpath) end function T.targets.ConsoleApp_Build_PosixNames_OnLinux() cfg.kind = "ConsoleApp" result = premake.gettarget(cfg, "build", "posix", "posix", "linux") test.isequal([[../bin/MyProject]], result.fullpath) end function T.targets.ConsoleApp_Build_PosixNames_OnMacOSX() cfg.kind = "ConsoleApp" result = premake.gettarget(cfg, "build", "posix", "posix", "macosx") test.isequal([[../bin/MyProject]], result.fullpath) end function T.targets.ConsoleApp_Build_PS3Names() cfg.kind = "ConsoleApp" result = premake.gettarget(cfg, "build", "posix", "PS3", "macosx") test.isequal([[../bin/MyProject.elf]], result.fullpath) end -- -- WindowedApp tests -- function T.targets.WindowedApp_Build_WindowsNames() cfg.kind = "WindowedApp" result = premake.gettarget(cfg, "build", "posix", "windows", "macosx") test.isequal([[../bin/MyProject.exe]], result.fullpath) end function T.targets.WindowedApp_Build_PosixNames_OnWindows() cfg.kind = "WindowedApp" result = premake.gettarget(cfg, "build", "posix", "posix", "windows") test.isequal([[../bin/MyProject.exe]], result.fullpath) end function T.targets.WindowedApp_Build_PosixNames_OnLinux() cfg.kind = "WindowedApp" result = premake.gettarget(cfg, "build", "posix", "posix", "linux") test.isequal([[../bin/MyProject]], result.fullpath) end function T.targets.WindowedApp_Build_PosixNames_OnMacOSX() cfg.kind = "WindowedApp" result = premake.gettarget(cfg, "build", "posix", "posix", "macosx") test.isequal([[../bin/MyProject.app/Contents/MacOS/MyProject]], result.fullpath) end function T.targets.WindowedApp_Build_PS3Names() cfg.kind = "WindowedApp" result = premake.gettarget(cfg, "build", "posix", "PS3", "macosx") test.isequal([[../bin/MyProject.elf]], result.fullpath) end -- -- SharedLib tests -- function T.targets.SharedLib_Build_WindowsNames() cfg.kind = "SharedLib" result = premake.gettarget(cfg, "build", "posix", "windows", "macosx") test.isequal([[../bin/MyProject.dll]], result.fullpath) end function T.targets.SharedLib_Link_WindowsNames() cfg.kind = "SharedLib" result = premake.gettarget(cfg, "link", "posix", "windows", "macosx") test.isequal([[../bin/MyProject.lib]], result.fullpath) end function T.targets.SharedLib_Build_PosixNames_OnWindows() cfg.kind = "SharedLib" result = premake.gettarget(cfg, "build", "posix", "posix", "windows") test.isequal([[../bin/MyProject.dll]], result.fullpath) end function T.targets.SharedLib_Link_PosixNames_OnWindows() cfg.kind = "SharedLib" result = premake.gettarget(cfg, "link", "posix", "posix", "windows") test.isequal([[../bin/libMyProject.a]], result.fullpath) end function T.targets.SharedLib_Build_PosixNames_OnLinux() cfg.kind = "SharedLib" result = premake.gettarget(cfg, "build", "posix", "posix", "linux") test.isequal([[../bin/libMyProject.so]], result.fullpath) end function T.targets.SharedLib_Link_PosixNames_OnLinux() cfg.kind = "SharedLib" result = premake.gettarget(cfg, "link", "posix", "posix", "linux") test.isequal([[../bin/libMyProject.so]], result.fullpath) end function T.targets.SharedLib_Build_PosixNames_OnMacOSX() cfg.kind = "SharedLib" result = premake.gettarget(cfg, "build", "posix", "posix", "macosx") test.isequal([[../bin/libMyProject.dylib]], result.fullpath) end function T.targets.SharedLib_Link_PosixNames_OnMacOSX() cfg.kind = "SharedLib" result = premake.gettarget(cfg, "link", "posix", "posix", "macosx") test.isequal([[../bin/libMyProject.dylib]], result.fullpath) end -- -- StaticLib tests -- function T.targets.StaticLib_Build_WindowsNames() cfg.kind = "StaticLib" result = premake.gettarget(cfg, "build", "posix", "windows", "macosx") test.isequal([[../bin/MyProject.lib]], result.fullpath) end function T.targets.StaticLib_Link_WindowsNames() cfg.kind = "StaticLib" result = premake.gettarget(cfg, "link", "posix", "windows", "macosx") test.isequal([[../bin/MyProject.lib]], result.fullpath) end function T.targets.StaticLib_Build_PosixNames_OnWindows() cfg.kind = "StaticLib" result = premake.gettarget(cfg, "build", "posix", "posix", "windows") test.isequal([[../bin/libMyProject.a]], result.fullpath) end function T.targets.StaticLib_Link_PosixNames_OnWindows() cfg.kind = "StaticLib" result = premake.gettarget(cfg, "link", "posix", "posix", "windows") test.isequal([[../bin/libMyProject.a]], result.fullpath) end function T.targets.StaticLib_Build_PosixNames_OnLinux() cfg.kind = "StaticLib" result = premake.gettarget(cfg, "build", "posix", "posix", "linux") test.isequal([[../bin/libMyProject.a]], result.fullpath) end function T.targets.StaticLib_Link_PosixNames_OnLinux() cfg.kind = "StaticLib" result = premake.gettarget(cfg, "link", "posix", "posix", "linux") test.isequal([[../bin/libMyProject.a]], result.fullpath) end function T.targets.StaticLib_Build_PosixNames_OnMacOSX() cfg.kind = "StaticLib" result = premake.gettarget(cfg, "build", "posix", "posix", "macosx") test.isequal([[../bin/libMyProject.a]], result.fullpath) end function T.targets.StaticLib_Link_PosixNames_OnMacOSX() cfg.kind = "StaticLib" result = premake.gettarget(cfg, "link", "posix", "posix", "macosx") test.isequal([[../bin/libMyProject.a]], result.fullpath) end function T.targets.StaticLib_Build_PosixNames_OnPS3() cfg.kind = "StaticLib" result = premake.gettarget(cfg, "build", "posix", "PS3", "macosx") test.isequal([[../bin/libMyProject.a]], result.fullpath) end function T.targets.StaticLib_Link_PosixNames_OnPS3() cfg.kind = "StaticLib" result = premake.gettarget(cfg, "link", "posix", "PS3", "macosx") test.isequal([[../bin/libMyProject.a]], result.fullpath) end -- -- Windows path tests -- function T.targets.WindowsPaths() cfg.kind = "ConsoleApp" result = premake.gettarget(cfg, "build", "windows", "windows", "linux") test.isequal([[..\bin]], result.directory) test.isequal([[..\bin\MyProject.exe]], result.fullpath) endpremake-4.3-src+repack1/tests/test_gmake_cpp.lua0000644000000000000000000000764311470465410020457 0ustar rootroot-- -- tests/test_gmake_cpp.lua -- Automated test suite for GNU Make C/C++ project generation. -- Copyright (c) 2009 Jason Perkins and the Premake project -- T.gmake_cpp = { } -- -- Configure a solution for testing -- local sln, prj function T.gmake_cpp.setup() _ACTION = "gmake" _OPTIONS.os = "linux" sln = solution "MySolution" configurations { "Debug", "Release" } platforms { "native" } prj = project "MyProject" language "C++" kind "ConsoleApp" end local function prepare() io.capture() premake.buildconfigs() end -- -- Test the header -- function T.gmake_cpp.BasicHeader() prepare() premake.gmake_cpp_header(prj, premake.gcc, sln.platforms) test.capture [[ # GNU Make project makefile autogenerated by Premake ifndef config config=debug endif ifndef verbose SILENT = @ endif ifndef CC CC = gcc endif ifndef CXX CXX = g++ endif ifndef AR AR = ar endif ]] end -- -- Test configuration blocks -- function T.gmake_cpp.BasicCfgBlock() prepare() local cfg = premake.getconfig(prj, "Debug") premake.gmake_cpp_config(cfg, premake.gcc) test.capture [[ ifeq ($(config),debug) OBJDIR = obj/Debug TARGETDIR = . TARGET = $(TARGETDIR)/MyProject DEFINES += INCLUDES += CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES) CFLAGS += $(CPPFLAGS) $(ARCH) CXXFLAGS += $(CFLAGS) LDFLAGS += -s LIBS += RESFLAGS += $(DEFINES) $(INCLUDES) LDDEPS += LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS) define PREBUILDCMDS endef define PRELINKCMDS endef define POSTBUILDCMDS endef endif ]] end function T.gmake_cpp.BasicCfgBlockWithPlatformCc() platforms { "ps3" } prepare() local cfg = premake.getconfig(prj, "Debug", "PS3") premake.gmake_cpp_config(cfg, premake.gcc) test.capture [[ ifeq ($(config),debugps3) CC = ppu-lv2-g++ CXX = ppu-lv2-g++ AR = ppu-lv2-ar OBJDIR = obj/PS3/Debug TARGETDIR = . TARGET = $(TARGETDIR)/MyProject.elf DEFINES += INCLUDES += CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES) CFLAGS += $(CPPFLAGS) $(ARCH) CXXFLAGS += $(CFLAGS) LDFLAGS += -s LIBS += RESFLAGS += $(DEFINES) $(INCLUDES) LDDEPS += LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS) define PREBUILDCMDS endef define PRELINKCMDS endef define POSTBUILDCMDS endef endif ]] end function T.gmake_cpp.PlatformSpecificBlock() platforms { "x64" } prepare() local cfg = premake.getconfig(prj, "Debug", "x64") premake.gmake_cpp_config(cfg, premake.gcc) test.capture [[ ifeq ($(config),debug64) OBJDIR = obj/x64/Debug TARGETDIR = . TARGET = $(TARGETDIR)/MyProject DEFINES += INCLUDES += CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES) CFLAGS += $(CPPFLAGS) $(ARCH) -m64 CXXFLAGS += $(CFLAGS) LDFLAGS += -s -m64 -L/usr/lib64 LIBS += RESFLAGS += $(DEFINES) $(INCLUDES) LDDEPS += LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS) define PREBUILDCMDS endef define PRELINKCMDS endef define POSTBUILDCMDS endef endif ]] end function T.gmake_cpp.UniversalStaticLibBlock() kind "StaticLib" platforms { "universal32" } prepare() local cfg = premake.getconfig(prj, "Debug", "Universal32") premake.gmake_cpp_config(cfg, premake.gcc) test.capture [[ ifeq ($(config),debuguniv32) OBJDIR = obj/Universal32/Debug TARGETDIR = . TARGET = $(TARGETDIR)/libMyProject.a DEFINES += INCLUDES += CPPFLAGS += $(DEFINES) $(INCLUDES) CFLAGS += $(CPPFLAGS) $(ARCH) -arch i386 -arch ppc CXXFLAGS += $(CFLAGS) LDFLAGS += -s -arch i386 -arch ppc LIBS += RESFLAGS += $(DEFINES) $(INCLUDES) LDDEPS += LINKCMD = libtool -o $(TARGET) $(OBJECTS) define PREBUILDCMDS endef define PRELINKCMDS endef define POSTBUILDCMDS endef endif ]] end premake-4.3-src+repack1/tests/test_vs2008_sln.lua0000644000000000000000000000304611470465410020340 0ustar rootroot-- -- tests/test_vs2008_sln.lua -- Automated test suite for Visual Studio 2008 solution generation. -- Copyright (c) 2009 Jason Perkins and the Premake project -- T.vs2008_sln = { } -- -- Configure a solution for testing -- local sln function T.vs2008_sln.setup() _ACTION = "vs2008" sln = solution "MySolution" configurations { "Debug", "Release" } platforms {} prj = project "MyProject" language "C++" kind "ConsoleApp" uuid "AE61726D-187C-E440-BD07-2556188A6565" premake.buildconfigs() end -- -- Make sure I've got the basic layout correct -- function T.vs2008_sln.BasicLayout() io.capture() premake.vs2005_solution(sln) test.capture ('\239\187\191' .. [[ Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyProject", "MyProject.vcproj", "{AE61726D-187C-E440-BD07-2556188A6565}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.ActiveCfg = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.Build.0 = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.ActiveCfg = Release|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal ]]) end premake-4.3-src+repack1/tests/test0000755000000000000000000000006511470465410015663 0ustar rootroot#!/bin/sh ../bin/debug/premake4 /scripts=../src test premake-4.3-src+repack1/tests/test.bat0000644000000000000000000000006511470465410016425 0ustar rootroot CALL ..\\bin\\debug\\premake4 /scripts=..\\src testpremake-4.3-src+repack1/tests/stress0000644000000000000000000000011511470465410016220 0ustar rootroot#!/bin/sh ../bin/debug/premake4 /scripts=../src /file=test_stress.lua vs2008 premake-4.3-src+repack1/tests/test_platforms.lua0000644000000000000000000000304311470465410020526 0ustar rootroot-- -- tests/test_platforms.lua -- Automated test suite for platform handling functions. -- Copyright (c) 2009 Jason Perkins and the Premake project -- T.platforms = { } local testmap = { Native="Win32", x32="Win32", x64="x64" } local sln, r function T.platforms.setup() sln = solution "MySolution" configurations { "Debug", "Release" } end function T.platforms.filter_OnNoSolutionPlatforms() premake.buildconfigs() r = premake.filterplatforms(sln, testmap) test.isequal("", table.concat(r, ":")) end function T.platforms.filter_OnNoSolutionPlatformsAndDefault() premake.buildconfigs() r = premake.filterplatforms(sln, testmap, "x32") test.isequal("x32", table.concat(r, ":")) end function T.platforms.filter_OnIntersection() platforms { "x32", "x64", "Xbox360" } premake.buildconfigs() r = premake.filterplatforms(sln, testmap, "x32") test.isequal("x32:x64", table.concat(r, ":")) end function T.platforms.filter_OnNoIntersection() platforms { "Universal", "Xbox360" } premake.buildconfigs() r = premake.filterplatforms(sln, testmap) test.isequal("", table.concat(r, ":")) end function T.platforms.filter_OnNoIntersectionAndDefault() platforms { "Universal", "Xbox360" } premake.buildconfigs() r = premake.filterplatforms(sln, testmap, "x32") test.isequal("x32", table.concat(r, ":")) end function T.platforms.filter_OnDuplicateKeys() platforms { "Native", "x32" } premake.buildconfigs() r = premake.filterplatforms(sln, testmap, "x32") test.isequal("Native", table.concat(r, ":")) end premake-4.3-src+repack1/tests/test_gcc.lua0000644000000000000000000000262511470465410017260 0ustar rootroot-- -- tests/test_gcc.lua -- Automated test suite for the GCC toolset interface. -- Copyright (c) 2009 Jason Perkins and the Premake project -- T.gcc = { } local suite = T.gcc local cfg function suite.setup() cfg = { } cfg.basedir = "." cfg.location = "." cfg.language = "C++" cfg.project = { name = "MyProject" } cfg.flags = { } cfg.objectsdir = "obj" cfg.platform = "Native" cfg.links = { } cfg.libdirs = { } cfg.linktarget = { fullpath="libMyProject.a" } end function suite.cflags_SharedLib_Windows() cfg.kind = "SharedLib" cfg.system = "windows" local r = premake.gcc.getcflags(cfg) test.isequal('', table.concat(r,"|")) end function suite.ldflags_SharedLib_Windows() cfg.kind = "SharedLib" cfg.system = "windows" local r = premake.gcc.getldflags(cfg) test.isequal('-s|-shared|-Wl,--out-implib="libMyProject.a"', table.concat(r,"|")) end function suite.cflags_OnFpFast() cfg.flags = { "FloatFast" } local r = premake.gcc.getcflags(cfg) test.isequal('-ffast-math', table.concat(r,"|")) end function suite.cflags_OnFpStrict() cfg.flags = { "FloatStrict" } local r = premake.gcc.getcflags(cfg) test.isequal('-ffloat-store', table.concat(r,"|")) end function suite.linkflags_OnFrameworks() cfg.links = { "Cocoa.framework" } local r = premake.gcc.getlinkflags(cfg) test.isequal('-framework Cocoa', table.concat(r,"|")) end premake-4.3-src+repack1/tests/test_keywords.lua0000644000000000000000000000422511470465410020371 0ustar rootroot-- -- tests/test_keywords.lua -- Automated test suite for configuration block keyword filtering. -- Copyright (c) 2008, 2009 Jason Perkins and the Premake project -- T.keywords = { } local suite = T.keywords -- -- Keyword escaping tests -- function suite.escapes_special_chars() test.isequal("%.%-", path.wildcards(".-")) end function suite.escapes_star() test.isequal("vs[^/]*", path.wildcards("vs*")) end function suite.escapes_star_star() test.isequal("Images/.*%.bmp", path.wildcards("Images/**.bmp")) end -- -- Keyword matching tests -- function T.keywords.matches_simple_strings() test.istrue(premake.iskeywordmatch("debug", { "debug", "windows", "vs2005" })) end function T.keywords.match_files_with_simple_strings() test.isfalse(premake.iskeywordmatch("release", { "debug", "windows", "vs2005" })) end function T.keywords.matches_with_patterns() test.istrue(premake.iskeywordmatch("vs20.*", { "debug", "windows", "vs2005" })) end function T.keywords.match_fails_with_not_term() test.isfalse(premake.iskeywordmatch("not windows", { "debug", "windows", "vs2005" })) end function T.keywords.match_ok_with_not_term() test.istrue(premake.iskeywordmatch("not linux", { "debug", "windows", "vs2005" })) end function T.keywords.match_ok_with_first_or() test.istrue(premake.iskeywordmatch("windows or linux", { "debug", "windows", "vs2005" })) end function T.keywords.match_ok_with_first_or() test.istrue(premake.iskeywordmatch("windows or linux", { "debug", "linux", "vs2005" })) end function T.keywords.match_ok_with_not_and_or() test.istrue(premake.iskeywordmatch("not macosx or linux", { "debug", "windows", "vs2005" })) end function T.keywords.match_fail_with_not_and_or() test.isfalse(premake.iskeywordmatch("not macosx or windows", { "debug", "windows", "vs2005" })) end function T.keywords.match_ok_required_term() test.istrue(premake.iskeywordsmatch({ "debug", "hello.c" }, { "debug", "windows", "vs2005", required="hello.c" })) end function T.keywords.match_fail_required_term() test.isfalse(premake.iskeywordsmatch({ "debug" }, { "debug", "windows", "vs2005", required="hello.c" })) end premake-4.3-src+repack1/tests/test_string.lua0000644000000000000000000000301611470465410020025 0ustar rootroot-- -- tests/test_string.lua -- Automated test suite for the new string functions. -- Copyright (c) 2008 Jason Perkins and the Premake project -- T.string = { } -- -- string.endswith() tests -- function T.string.endswith_ReturnsTrue_OnMatch() test.istrue(string.endswith("Abcdef", "def")) end function T.string.endswith_ReturnsFalse_OnMismatch() test.isfalse(string.endswith("Abcedf", "efg")) end function T.string.endswith_ReturnsFalse_OnLongerNeedle() test.isfalse(string.endswith("Abc", "Abcdef")) end function T.string.endswith_ReturnsFalse_OnNilHaystack() test.isfalse(string.endswith(nil, "ghi")) end function T.string.endswith_ReturnsFalse_OnNilNeedle() test.isfalse(string.endswith("Abc", nil)) end function T.string.endswith_ReturnsTrue_OnExactMatch() test.istrue(string.endswith("/", "/")) end -- -- string.explode() tests -- function T.string.explode_ReturnsParts_OnValidCall() test.isequal({"aaa","bbb","ccc"}, string.explode("aaa/bbb/ccc", "/", true)) end -- -- string.startswith() tests -- function T.string.startswith_OnMatch() test.istrue(string.startswith("Abcdef", "Abc")) end function T.string.startswith_OnMismatch() test.isfalse(string.startswith("Abcdef", "ghi")) end function T.string.startswith_OnLongerNeedle() test.isfalse(string.startswith("Abc", "Abcdef")) end function T.string.startswith_OnEmptyHaystack() test.isfalse(string.startswith("", "Abc")) end function T.string.startswith_OnEmptyNeedle() test.istrue(string.startswith("Abcdef", "")) end premake-4.3-src+repack1/tests/folder/0000755000000000000000000000000011470465410016230 5ustar rootrootpremake-4.3-src+repack1/tests/folder/ok.lua0000644000000000000000000000001411470465410017337 0ustar rootrootreturn "ok" premake-4.3-src+repack1/tests/folder/ok.lua.20000644000000000000000000000001411470465410017477 0ustar rootrootreturn "ok" premake-4.3-src+repack1/tests/actions/0000755000000000000000000000000011470465410016415 5ustar rootrootpremake-4.3-src+repack1/tests/actions/test_clean.lua0000644000000000000000000001036411470465410021245 0ustar rootroot-- -- tests/actions/test_clean.lua -- Automated test suite for the "clean" action. -- Copyright (c) 2009 Jason Perkins and the Premake project -- T.clean = { } -- -- Replacement functions for remove() and rmdir() for testing -- local os_remove, os_rmdir, cwd local removed local function test_remove(fn) if not cwd then cwd = os.getcwd() end table.insert(removed, path.getrelative(cwd, fn)) end -- -- Setup/teardown -- local sln function T.clean.setup() _ACTION = "clean" os_remove = os.remove os_rmdir = os.rmdir os.remove = test_remove os.rmdir = test_remove removed = {} sln = solution "MySolution" configurations { "Debug", "Release" } end function T.clean.teardown() os.remove = os_remove os.rmdir = os_rmdir end local function prepare() premake.buildconfigs() premake.action.call("clean") end -- -- Tests -- function T.clean.SolutionFiles() prepare() test.contains(removed, "MySolution.sln") test.contains(removed, "MySolution.suo") test.contains(removed, "MySolution.ncb") test.contains(removed, "MySolution.userprefs") test.contains(removed, "MySolution.usertasks") test.contains(removed, "MySolution.workspace") test.contains(removed, "MySolution_wsp.mk") test.contains(removed, "MySolution.tags") test.contains(removed, "Makefile") end function T.clean.CppProjectFiles() prj = project "MyProject" language "C++" kind "ConsoleApp" prepare() test.contains(removed, "MyProject.vcproj") test.contains(removed, "MyProject.pdb") test.contains(removed, "MyProject.idb") test.contains(removed, "MyProject.ilk") test.contains(removed, "MyProject.cbp") test.contains(removed, "MyProject.depend") test.contains(removed, "MyProject.layout") test.contains(removed, "MyProject.mk") test.contains(removed, "MyProject.list") test.contains(removed, "MyProject.out") test.contains(removed, "MyProject.make") end function T.clean.CsProjectFiles() prj = project "MyProject" language "C#" kind "ConsoleApp" prepare() test.contains(removed, "MyProject.csproj") test.contains(removed, "MyProject.csproj.user") test.contains(removed, "MyProject.pdb") test.contains(removed, "MyProject.idb") test.contains(removed, "MyProject.ilk") test.contains(removed, "MyProject.make") end function T.clean.ObjectDirsAndFiles() prj = project "MyProject" language "C++" kind "ConsoleApp" prepare() test.contains(removed, "obj") test.contains(removed, "obj/Debug") test.contains(removed, "obj/Release") end function T.clean.CppConsoleAppFiles() prj = project "MyProject" language "C++" kind "ConsoleApp" prepare() test.contains(removed, "MyProject") test.contains(removed, "MyProject.exe") test.contains(removed, "MyProject.elf") test.contains(removed, "MyProject.vshost.exe") test.contains(removed, "MyProject.exe.manifest") end function T.clean.CppWindowedAppFiles() prj = project "MyProject" language "C++" kind "WindowedApp" prepare() test.contains(removed, "MyProject") test.contains(removed, "MyProject.exe") test.contains(removed, "MyProject.app") end function T.clean.CppSharedLibFiles() prj = project "MyProject" language "C++" kind "SharedLib" prepare() test.contains(removed, "MyProject.dll") test.contains(removed, "libMyProject.so") test.contains(removed, "MyProject.lib") test.contains(removed, "libMyProject.dylib") end function T.clean.CppStaticLibFiles() prj = project "MyProject" language "C++" kind "StaticLib" prepare() test.contains(removed, "MyProject.lib") test.contains(removed, "libMyProject.a") end function T.clean.PlatformObjects() platforms { "Native", "x32" } prj = project "MyProject" language "C++" kind "ConsoleApp" prepare() test.contains(removed, "obj/Debug") test.contains(removed, "obj/Release") test.contains(removed, "obj/x32/Debug") test.contains(removed, "obj/x32/Release") end function T.clean.CppConsoleAppFiles_OnSuffix() prj = project "MyProject" language "C++" kind "ConsoleApp" targetsuffix "_x" prepare() test.contains(removed, "MyProject_x") test.contains(removed, "MyProject_x.exe") test.contains(removed, "MyProject_x.elf") test.contains(removed, "MyProject_x.vshost.exe") test.contains(removed, "MyProject_x.exe.manifest") end premake-4.3-src+repack1/tests/actions/make/0000755000000000000000000000000011470465410017332 5ustar rootrootpremake-4.3-src+repack1/tests/actions/make/test_make_pch.lua0000644000000000000000000000307411470465410022647 0ustar rootroot-- -- tests/actions/make/test_make_pch.lua -- Validate the setup for precompiled headers in makefiles. -- Copyright (c) 2010 Jason Perkins and the Premake project -- T.make_pch = { } local suite = T.make_pch local _ = premake.make.cpp -- -- Setup and teardown -- local sln, prj, cfg function suite.setup() sln, prj = test.createsolution() end local function prepare() io.capture() premake.buildconfigs() cfg = premake.getconfig(prj, "Debug") end -- -- Configuration block tests -- function suite.NoConfig_OnNoHeaderSet() prepare() _.pchconfig(cfg) test.capture [[]] end function suite.NoConfig_OnHeaderAndNoPCHFlag() pchheader "include/myproject.h" flags { NoPCH } prepare() _.pchconfig(cfg) test.capture [[]] end function suite.ConfigBlock_OnPchEnabled() pchheader "include/myproject.h" prepare() _.pchconfig(cfg) test.capture [[ PCH = include/myproject.h GCH = $(OBJDIR)/myproject.h.gch CPPFLAGS += -I$(OBJDIR) -include $(OBJDIR)/myproject.h ]] end -- -- Build rule tests -- function suite.BuildRules_OnCpp() pchheader "include/myproject.h" prepare() _.pchrules(prj) test.capture [[ ifneq (,$(PCH)) $(GCH): $(PCH) @echo $(notdir $<) -$(SILENT) cp $< $(OBJDIR) $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<" endif ]] end function suite.BuildRules_OnC() language "C" pchheader "include/myproject.h" prepare() _.pchrules(prj) test.capture [[ ifneq (,$(PCH)) $(GCH): $(PCH) @echo $(notdir $<) -$(SILENT) cp $< $(OBJDIR) $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" endif ]] end premake-4.3-src+repack1/tests/actions/make/test_make_escaping.lua0000644000000000000000000000146111470465410023664 0ustar rootroot-- -- tests/actions/make/test_make_escaping.lua -- Validate the escaping of literal values in Makefiles. -- Copyright (c) 2010 Jason Perkins and the Premake project -- T.make_escaping = { } local suite = T.make_escaping function suite.Escapes_Spaces() test.isequal("Program\\ Files", _MAKE.esc("Program Files")) end function suite.Escapes_Backslashes() test.isequal("Program\\\\Files", _MAKE.esc("Program\\Files")) end function suite.Escapes_Parens() test.isequal("Debug\\(x86\\)", _MAKE.esc("Debug(x86)")) end function suite.DoesNotEscape_ShellReplacements() test.isequal("-L$(NVSDKCUDA_ROOT)/C/lib", _MAKE.esc("-L$(NVSDKCUDA_ROOT)/C/lib")) end function suite.CanEscape_ShellReplacementCapturesShortest() test.isequal("a\\(x\\)b$(ROOT)c\\(y\\)d", _MAKE.esc("a(x)b$(ROOT)c(y)d")) end premake-4.3-src+repack1/tests/actions/vstudio/0000755000000000000000000000000011470465410020112 5ustar rootrootpremake-4.3-src+repack1/tests/actions/vstudio/test_vs200x_vcproj_linker.lua0000755000000000000000000000472611470465410025661 0ustar rootroot-- -- tests/actions/vstudio/test_vs200x_vcproj_linker.lua -- Automated tests for Visual Studio 2002-2008 C/C++ linker block. -- Copyright (c) 2009, 2010 Jason Perkins and the Premake project -- T.vs200x_vcproj_linker = { } local suite = T.vs200x_vcproj_linker local vcproj = premake.vstudio.vcproj -- -- Setup/Teardown -- local sln, prj function suite.setup() _ACTION = "vs2005" sln, prj = test.createsolution() end local function prepare() io.capture() premake.buildconfigs() end -- -- Test default linker blocks for each target kind -- (ConsoleApp, StaticLib, etc.) -- function suite.DefaultLinkerBlock_OnConsoleApp() kind "ConsoleApp" prepare() premake.vs200x_vcproj_VCLinkerTool(premake.getconfig(prj, "Debug")) test.capture [[ ]] end function suite.DefaultLinkerBlock_OnWindowedApp() kind "WindowedApp" prepare() premake.vs200x_vcproj_VCLinkerTool(premake.getconfig(prj, "Debug")) test.capture [[ ]] end function suite.DefaultLinkerBlock_OnSharedLib() kind "SharedLib" prepare() premake.vs200x_vcproj_VCLinkerTool(premake.getconfig(prj, "Debug")) test.capture [[ ]] end function suite.DefaultLinkerBlock_OnStaticLib() kind "StaticLib" prepare() premake.vs200x_vcproj_VCLinkerTool(premake.getconfig(prj, "Debug")) test.capture [[ ]] end -- -- linkoptions tests -- function suite.AdditionalOptions_OnStaticLib() kind "StaticLib" linkoptions { "/ltcg", "/lZ" } prepare() premake.vs200x_vcproj_VCLinkerTool(premake.getconfig(prj, "Debug")) test.capture [[ ]] end premake-4.3-src+repack1/tests/actions/vstudio/test_vs2010_filters.lua0000644000000000000000000002005011470465410024334 0ustar rootroot T.vs2010_filters = { } local vs10_filters = T.vs2010_filters local vs10_helpers = premake.vstudio.vs10_helpers local sln, prj function vs10_filters.setup() _ACTION = "vs2010" sln = solution "MySolution" configurations { "Debug" } platforms {} prj = project "MyProject" language "C++" kind "ConsoleApp" end local function get_buffer() io.capture() premake.buildconfigs() sln.vstudio_configs = premake.vstudio_buildconfigs(sln) premake.vs2010_vcxproj_filters(prj) buffer = io.endcapture() return buffer end function vs10_filters.path_noPath_returnsNil() local result = vs10_helpers.file_path("foo.h") test.isequal(nil,result) end function vs10_filters.path_hasOneDirectoryPath_returnsIsFoo() local path = "foo" local result = vs10_helpers.file_path(path .."\\foo.h") test.isequal(path,result) end function vs10_filters.path_hasTwoDirectoryPath_returnsIsFooSlashBar() local path = "foo\\bar" local result = vs10_helpers.file_path(path .."\\foo.h") test.isequal(path,result) end function vs10_filters.path_hasTwoDirectoryPath_returnsIsFooSlashBar_Baz() local path = "foo\\bar_baz" local result = vs10_helpers.file_path(path .."\\foo.h") test.isequal(path,result) end function vs10_filters.path_extensionWithHyphen_returnsIsFoo() local path = "foo" local result = vs10_helpers.file_path(path .."\\foo-bar.h") test.isequal(path,result) end function vs10_filters.path_extensionWithNumber_returnsIs2Foo() local path = "foo" local result = vs10_helpers.file_path(path .."\\2foo.h") test.isequal(path,result) end function vs10_filters.path_hasThreeDirectoryPath_returnsIsFooSlashBarSlashBaz() local path = "foo\\bar\\baz" local result = vs10_helpers.file_path(path .."\\foo.h") test.isequal(path,result) end function vs10_filters.path_hasDotDotSlashDirectoryPath_returnsNil() local path = ".." local result = vs10_helpers.file_path(path .."\\foo.h") test.isequal(nil,result) end function vs10_filters.removeRelativePath_noRelativePath_returnsInput() local path = "foo.h" local result = vs10_helpers.remove_relative_path(path) test.isequal("foo.h",result) end function vs10_filters.removeRelativePath_dotDotSlashFoo_returnsFoo() local path = "..\\foo" local result = vs10_helpers.remove_relative_path(path) test.isequal("foo",result) end function vs10_filters.removeRelativePath_dotDotSlashDotDotSlashFoo_returnsFoo() local path = "..\\..\\foo" local result = vs10_helpers.remove_relative_path(path) test.isequal("foo",result) end function vs10_filters.removeRelativePath_DotSlashFoo_returnsFoo() local path = ".\\foo" local result = vs10_helpers.remove_relative_path(path) test.isequal("foo",result) end function vs10_filters.listOfDirectories_oneDirectory_returnsSizeIsOne() local result = vs10_helpers.list_of_directories_in_path("foo\\bar.h") test.isequal(1,#result) end function vs10_filters.listOfDirectories_oneDirectory_returnsContainsFoo() local result = vs10_helpers.list_of_directories_in_path("foo\\bar.h") test.contains(result,"foo") end function vs10_filters.listOfDirectories_twoDirectories_returnsSizeIsTwo() local result = vs10_helpers.list_of_directories_in_path("foo\\bar\\bar.h") test.isequal(2,#result) end function vs10_filters.listOfDirectories_twoDirectories_secondEntryIsFooSlashBar() local result = vs10_helpers.list_of_directories_in_path("foo\\bar\\bar.h") test.isequal("foo\\bar",result[2]) end function vs10_filters.listOfDirectories_dotSlash_returnsIsEmpty() local result = vs10_helpers.list_of_directories_in_path(".\\bar.h") test.isequal(0,#result) end function vs10_filters.tableOfFileFilters_returnSizeIsTwo() local t = { foo = {'foo\\bar.h'}, bar = {'foo\\bar.h'}, baz = {'baz\\bar.h'} } local result = vs10_helpers.table_of_file_filters(t) test.isequal(2,#result) end function vs10_filters.tableOfFileFilters_returnContainsFoo() local t = { foo = {'foo\\bar.h'}, bar = {'foo\\bar.h'}, baz = {'baz\\bar.h'} } local result = vs10_helpers.table_of_file_filters(t) --order is not defined test.contains(result,'foo') end function vs10_filters.tableOfFileFilters_returnContainsBaz() local t = { foo = {'foo\\bar.h'}, bar = {'foo\\bar.h'}, baz = {'baz\\bar.h'} } local result = vs10_helpers.table_of_file_filters(t) --order is not defined test.contains(result,'baz') end function vs10_filters.tableOfFileFilters_returnSizeIsFour() local t = { foo = {'foo\\bar.h'}, bar = {'foo\\bar\\bar.h'}, baz = {'bar\\bar.h'}, bazz = {'bar\\foo\\bar.h'} } local result = vs10_helpers.table_of_file_filters(t) --order is not defined test.isequal(4,#result) end function vs10_filters.tableOfFileFilters_tableHasSubTableWithTwoEntries_returnSizeIsTwo() local t = { foo = {'foo\\bar.h','foo\\bar\\bar.h'} } local result = vs10_helpers.table_of_file_filters(t) --order is not defined test.isequal(2,#result) end function vs10_filters.noInputFiles_bufferDoesNotContainTagFilter() local buffer = get_buffer() test.string_does_not_contain(buffer,"") end function vs10_filters.oneInputFileYetNoDirectory_bufferDoesNotContainTagFilter() files { "dontCare.h" } local buffer = get_buffer() test.string_does_not_contain(buffer,".*.*") end function vs10_filters.oneInputFileWithDirectory_bufferContainsTagFilterWithIncludeSetToFoo() files { "foo\\dontCare.h" } local buffer = get_buffer() test.string_contains(buffer,'') end function vs10_filters.clIncludeFilter_oneInputFile_bufferContainsTagClInclude() files { "dontCare.h" } local buffer = get_buffer() test.string_contains(buffer,'') end function vs10_filters.clCompileFilter_oneInputFile_bufferContainsTagClCompile() files { "dontCare.cpp" } local buffer = get_buffer() test.string_contains(buffer,'.*') end function vs10_links.additionalDependancies_isInsideLinkBlock() configuration("Debug") links{"link_test"} local buffer = get_buffer() test.string_contains(buffer, '.*.*%%%(AdditionalDependencies%).*') end function vs10_links.additionalDependancies_containsLinkTestDotLib() configuration("Debug") links{"link_test"} local buffer = get_buffer() test.string_contains(buffer, 'link_test%.lib;%%%(AdditionalDependencies%)') end function vs10_links.outPutFile_isEqualToOutDirMyProjectDotExe() local buffer = get_buffer() test.string_contains(buffer,'%$%(OutDir%)MyProject.exe') end function vs10_links.additionalLibraryDirectories_inputNoDirectories_tagsAreEmpty() local buffer = get_buffer() test.string_contains(buffer, '%%%(AdditionalLibraryDirectories%)') end function vs10_links.additionalLibraryDirectories_inputTestPath_tagsContainExspectedValue() configuration("Debug") libdirs { "test_path" } local buffer = get_buffer() local exspect = "test_path;" test.string_contains(buffer, ''..exspect..'%%%(AdditionalLibraryDirectories%)') end function vs10_links.additionalLibraryDirectories_inputTwoPaths_tagsContainExspectedValue() configuration("Debug") libdirs { "test_path","another_path" } local buffer = get_buffer() local exspect = "test_path;another_path;" test.string_contains(buffer, ''..exspect..'%%%(AdditionalLibraryDirectories%)') end function vs10_links.generateDebugInformation_withoutSymbolsFlag_valueInTagsIsFalse() local buffer = get_buffer() test.string_contains(buffer,'false') end function vs10_links.generateDebugInformation_withSymbolsFlag_valueInTagsIsTrue() flags {"Symbols"} local buffer = get_buffer() test.string_contains(buffer,'true') end function vs10_links.noOptimiseFlag_optimizeReferences_isNotInBuffer() local buffer = get_buffer() test.string_does_not_contain(buffer,'OptimizeReferences') end function vs10_links.noOptimiseFlag_enableCOMDATFolding_isNotInBuffer() local buffer = get_buffer() test.string_does_not_contain(buffer,'EnableCOMDATFolding') end function vs10_links.optimiseFlag_optimizeReferences_valueInsideTagsIsTrue() flags{"Optimize"} local buffer = get_buffer() test.string_contains(buffer,'true') end function vs10_links.noOptimiseFlag_enableCOMDATFolding_valueInsideTagsIsTrue() flags{"Optimize"} local buffer = get_buffer() test.string_contains(buffer,'EnableCOMDATFolding>truemainCRTStartup') end function vs10_links.entryPointSymbol_noWimMainFlag_valueInTagsIsMainCrtStartUp() local buffer = get_buffer() test.string_contains(buffer,'mainCRTStartup') end function vs10_links.entryPointSymbol_winMainFlag_doesNotContainEntryPointSymbol() flags{"WinMain"} local buffer = get_buffer() test.string_does_not_contain(buffer,'') end function vs10_links.targetMachine_default_valueInTagsIsMachineX86() local buffer = get_buffer() test.string_contains(buffer,'MachineX86') end function vs10_links.targetMachine_x32_valueInTagsIsMachineX64() platforms {"x32"} local buffer = get_buffer() test.string_contains(buffer,'MachineX86') end function vs10_links.targetMachine_x64_valueInTagsIsMachineX64() platforms {"x64"} local buffer = get_buffer() test.string_contains(buffer,'MachineX64') end premake-4.3-src+repack1/tests/actions/vstudio/test_vs2010_vcxproj.lua0000644000000000000000000003456311470465410024375 0ustar rootroot T.vs2010_vcxproj = { } local vs10_vcxproj = T.vs2010_vcxproj local include_directory = "bar/foo" local include_directory2 = "baz/foo" local debug_define = "I_AM_ALIVE_NUMBER_FIVE" local vs10_helpers = premake.vstudio.vs10_helpers local sln, prj function vs10_vcxproj.teardown() sln = nil prj = nil end function vs10_vcxproj.setup() _ACTION = "vs2010" sln = solution "MySolution" configurations { "Debug", "Release" } platforms {} prj = project "MyProject" language "C++" kind "ConsoleApp" uuid "AE61726D-187C-E440-BD07-2556188A6565" includedirs { include_directory, include_directory2 } files { "foo/dummyHeader.h", "foo/dummySource.cpp", "../src/host/*h", "../src/host/*.c", "dummyResourceScript.rc" } configuration("Release") flags {"Optimize"} links{"foo","bar"} configuration("Debug") defines {debug_define} links{"foo_d"} end local function get_buffer() io.capture() premake.buildconfigs() sln.vstudio_configs = premake.vstudio_buildconfigs(sln) premake.vs2010_vcxproj(prj) local buffer = io.endcapture() return buffer end function vs10_vcxproj.xmlDeclarationPresent() local buffer = get_buffer() test.istrue(string.startswith(buffer, '')) end function vs10_vcxproj.projectBlocksArePresent() local buffer = get_buffer() test.string_contains(buffer,'') end function vs10_vcxproj.projectOpenTagIsCorrect() local buffer = get_buffer() test.string_contains(buffer,'.*') end function vs10_vcxproj.configItemGroupPresent() local buffer = get_buffer() test.string_contains(buffer,'.*') end function vs10_vcxproj.configBlocksArePresent() local buffer = get_buffer() test.string_contains(buffer,'') end function vs10_vcxproj.configTypeBlockPresent() local buffer = get_buffer() test.string_contains(buffer,'.*') end function vs10_vcxproj.twoConfigTypeBlocksPresent() local buffer = get_buffer() test.string_contains(buffer,'.*') end function vs10_vcxproj.propsDefaultForCppProjArePresent() local buffer = get_buffer() test.string_contains(buffer,'') end function vs10_vcxproj.propsForCppProjArePresent() local buffer = get_buffer() test.string_contains(buffer,'') end function vs10_vcxproj.extensionSettingArePresent() local buffer = get_buffer() test.string_contains(buffer,'.*') end function vs10_vcxproj.userMacrosPresent() local buffer = get_buffer() test.string_contains(buffer,'') end function vs10_vcxproj.intermediateAndOutDirsPropertyGroupWithMagicNumber() local buffer = get_buffer() test.string_contains(buffer,'.*<_ProjectFileVersion>10%.0%.30319%.1') end function vs10_vcxproj.outDirPresent() local buffer = get_buffer() test.string_contains(buffer,'') end function vs10_vcxproj.initDirPresent() local buffer = get_buffer() test.string_contains(buffer,'') end function vs10_vcxproj.projectWithDebugAndReleaseConfig_twoOutDirsAndTwoIntDirs() local buffer = get_buffer() test.string_contains(buffer,'.*.*.*') end function vs10_vcxproj.containsItemDefinition() local buffer = get_buffer() test.string_contains(buffer,'.*') end function vs10_vcxproj.containsClCompileBlock() local buffer = get_buffer() test.string_contains(buffer,'.*') end function vs10_vcxproj.containsAdditionalOptions() buildoptions {"/Gm"} local buffer = get_buffer() test.string_contains(buffer,'/Gm %%%(AdditionalOptions%)') end local function cl_compile_string(version) return '.*' end function vs10_vcxproj.debugHasNoOptimisation() local buffer = get_buffer() test.string_contains(buffer, cl_compile_string('Debug').. '.*Disabled.*') end function vs10_vcxproj.releaseHasFullOptimisation() local buffer = get_buffer() test.string_contains(buffer, cl_compile_string('Release').. '.*Full.*') end function vs10_vcxproj.includeDirectories_debugEntryContains_include_directory() local buffer = get_buffer() test.string_contains(buffer,cl_compile_string('Debug').. '.*'.. path.translate(include_directory, '\\') ..'.*') end function vs10_vcxproj.includeDirectories_debugEntryContains_include_directory2PrefixWithSemiColon() local buffer = get_buffer() test.string_contains(buffer,cl_compile_string('Debug').. '.*.*;'.. path.translate(include_directory2, '\\') ..'.*') end function vs10_vcxproj.includeDirectories_debugEntryContains_include_directory2PostfixWithSemiColon() local buffer = get_buffer() test.string_contains(buffer,cl_compile_string('Debug').. '.*.*'.. path.translate(include_directory2, '\\') ..';.*') end function vs10_vcxproj.debugContainsPreprossorBlock() local buffer = get_buffer() test.string_contains(buffer,cl_compile_string('Debug').. '.*.*') end function vs10_vcxproj.debugHasDebugDefine() local buffer = get_buffer() test.string_contains(buffer,cl_compile_string('Debug')..'.*.*'..debug_define..'.*') end function vs10_vcxproj.releaseHasStringPoolingOn() local buffer = get_buffer() test.string_contains(buffer,cl_compile_string('Release')..'.*true') end function vs10_vcxproj.hasItemGroupSection() local buffer = get_buffer() test.string_contains(buffer,'.*') end function vs10_vcxproj.fileExtension_extEqualH() local ext = vs10_helpers.get_file_extension('foo.h') test.isequal('h', ext) end function vs10_vcxproj.fileExtension_containsTwoDots_extEqualH() local ext = vs10_helpers.get_file_extension('foo.bar.h') test.isequal('h', ext) end function vs10_vcxproj.fileExtension_alphaNumeric_extEqualOneH() local ext = vs10_helpers.get_file_extension('foo.1h') test.isequal('1h', ext) end function vs10_vcxproj.fileExtension_alphaNumericWithUnderscore_extEqualOne_H() local ext = vs10_helpers.get_file_extension('foo.1_h') test.isequal('1_h', ext) end function vs10_vcxproj.fileExtension_containsHyphen_extEqualHHyphenH() local ext = vs10_helpers.get_file_extension('foo.h-h') test.isequal('h-h', ext) end function vs10_vcxproj.fileExtension_containsMoreThanOneDot_extEqualOneH() local ext = vs10_helpers.get_file_extension('foo.bar.h') test.isequal('h', ext) end local function SortAndReturnSortedInputFiles(input) local sorted = { ClInclude ={}, ClCompile ={}, None ={}, ResourceCompile ={} } vs10_helpers.sort_input_files(input,sorted) return sorted end function vs10_vcxproj.sortFile_headerFile_SortedClIncludeEqualToFile() local file = {"bar.h"} local sorted = SortAndReturnSortedInputFiles(file) test.isequal(file, sorted.ClInclude) end function vs10_vcxproj.sortFile_srcFile_SortedClCompileEqualToFile() local file = {"b.cxx"} local sorted = SortAndReturnSortedInputFiles(file) test.isequal(file, sorted.ClCompile) end function vs10_vcxproj.sortFile_notRegistered_SortedNoneEqualToFile() local file = {"foo.bar.00h"} local sorted = SortAndReturnSortedInputFiles(file) test.isequal(file, sorted.None) end function vs10_vcxproj.sortFile_resourceScript_resourceCompileEqualToFile() local file = {"foo.rc"} local sorted = SortAndReturnSortedInputFiles(file) test.isequal(file, sorted.ResourceCompile) end function vs10_vcxproj.itemGroupSection_hasResourceCompileSection() --for some reason this does not work here and it needs to be in --the project setting at the top ? --files{"dummyResourceScript.rc"} local buffer = get_buffer() test.string_contains(buffer,'.*') end function vs10_vcxproj.itemGroupSection_hasHeaderListed() local buffer = get_buffer() test.string_contains(buffer,'.*.*') end function vs10_vcxproj.checkProjectConfigurationOpeningTag_hasACloseingAngleBracket() local buffer = get_buffer() test.string_contains(buffer,'') end function vs10_vcxproj.postBuildEvent_isPresent() postbuildcommands { "doSomeThing" } local buffer = get_buffer() test.string_contains(buffer,'.*.*.*') end function vs10_vcxproj.postBuildEvent_containsCorrectInformationBetweenCommandTag() postbuildcommands { "doSomeThing" } local buffer = get_buffer() test.string_contains(buffer,'.*doSomeThing.*') end function vs10_vcxproj.postBuildEvent_eventEncloseByQuotes_containsCorrectInformationBetweenCommandTag() postbuildcommands { "\"doSomeThing\"" } local buffer = get_buffer() test.string_contains(buffer,'.*"doSomeThing".*') end function vs10_vcxproj.outDir_directorySuppliedIsNotSlashPostFixed_bufferContainsOutDirSlashPostFixed() targetdir("dir") local buffer = get_buffer() test.string_contains(buffer,'dir\\') end --postfixed directory slashes are removed by default --yet these following two tests are to ensure if this behaviour is changed they will fail function vs10_vcxproj.outDir_directorySuppliedWhichIsForwardSlashPostFixed_bufferContainsOutDirSlashPostFixed() targetdir("dir/") local buffer = get_buffer() test.string_contains(buffer,'dir\\') end function vs10_vcxproj.outDir_directorySuppliedWhichIsWindowsSlashPostFixed_bufferContainsOutDirSlashPostFixed() targetdir("dir\\") local buffer = get_buffer() test.string_contains(buffer,'dir\\') end function vs10_vcxproj.objectDir_directorySuppliedIsNotSlashPostFixed_bufferContainsIntermediateDirSlashPostFixed() objdir ("dir") local buffer = get_buffer() test.string_contains(buffer,'dir\\') end --postfixed directory slashes are removed by default --yet these following two tests are to ensure if this behaviour is changed they will fail function vs10_vcxproj.objectDir_directorySuppliedWhichIsSlashPostFixed_bufferContainsIntermediateDirSlashPostFixed() objdir ("dir/") local buffer = get_buffer() test.string_contains(buffer,'dir\\') end function vs10_vcxproj.objectDir_directorySuppliedWhichIsWindowsSlashPostFixed_bufferContainsIntermediateDirSlashPostFixed() objdir ("dir\\") local buffer = get_buffer() test.string_contains(buffer,'dir\\') end function vs10_vcxproj.targetName() configuration("Debug") targetname ("foo_d") local buffer = get_buffer() test.string_contains(buffer,'foo_d') end function vs10_vcxproj.noExtraWarnings_bufferDoesNotContainSmallerTypeCheck() local buffer = get_buffer() test.string_does_not_contain(buffer,'') end function vs10_vcxproj.debugAndExtraWarnings_bufferContainsSmallerTypeCheck() configuration("Debug") flags {"ExtraWarnings"} local buffer = get_buffer() test.string_contains(buffer,'true') end function vs10_vcxproj.releaseAndExtraWarnings_bufferDoesNotContainSmallerTypeCheck() configuration("Release") flags {"ExtraWarnings"} local buffer = get_buffer() test.string_does_not_contain(buffer,'') end function vs10_vcxproj.onlyOneProjectConfigurationBlockWhenMultipleConfigs() local buffer = get_buffer() test.string_does_not_contain(buffer,'.*') end function vs10_vcxproj.languageC_bufferContainsCompileAsC() language "C" local buffer = get_buffer() test.string_contains(buffer,'CompileAsC') end local debug_config_pch_string = 'Create' function vs10_vcxproj.noPchFlagSet_bufferDoesNotContainPchCreate() configuration("Debug") flags{"NoPCH"} local buffer = get_buffer() test.string_does_not_contain(buffer,debug_config_pch_string) end function vs10_vcxproj.pchHeaderSetYetPchSourceIsNot_bufferDoesNotContainPchCreate() configuration("Debug") pchheader "foo/dummyHeader.h" local buffer = get_buffer() test.string_does_not_contain(buffer,debug_config_pch_string) end function vs10_vcxproj.pchHeaderAndPchSourceSet_bufferContainPchCreate() configuration("Debug") pchheader "foo/dummyHeader.h" pchsource "foo/dummySource.cpp" local buffer = get_buffer() test.string_contains(buffer,debug_config_pch_string) end function vs10_vcxproj.pchHeaderAndSourceSet_yetAlsoNoPch_bufferDoesNotContainpchCreate() configuration('Debug') pchheader "foo/dummyHeader.h" pchsource "foo/dummySource.cpp" flags{"NoPCH"} local buffer = get_buffer() test.string_does_not_contain(buffer,debug_config_pch_string) end premake-4.3-src+repack1/tests/actions/vstudio/test_vs200x_vcproj.lua0000644000000000000000000003545011470465410024310 0ustar rootroot-- -- tests/test_vs200x_vcproj.lua -- Automated test suite for Visual Studio 2002-2008 C/C++ project generation. -- Copyright (c) 2009 Jason Perkins and the Premake project -- T.vs200x_vcproj = { } local suite = T.vs200x_vcproj local vcproj = premake.vstudio.vcproj -- -- Configure a solution for testing -- local sln, prj function suite.setup() _ACTION = "vs2005" sln = solution "MySolution" configurations { "Debug", "Release" } platforms {} project "DotNetProject" -- to test handling of .NET platform in solution language "C#" kind "ConsoleApp" prj = project "MyProject" language "C++" kind "ConsoleApp" uuid "AE61726D-187C-E440-BD07-2556188A6565" end local function prepare() io.capture() premake.buildconfigs() sln.vstudio_configs = premake.vstudio_buildconfigs(sln) local cfg = premake.getconfig(sln.projects[2]) cfg.name = prj.name cfg.blocks = prj.blocks prj = cfg end -- -- Make sure I've got the basic layout correct -- function suite.BasicLayout() prepare() premake.vs200x_vcproj(prj) test.capture [[ ]] end -- -- Test the element -- function suite.Configuration_OnMFCFlag() flags { "MFC" } prepare() vcproj.Configuration("Debug|Win32", premake.getconfig(prj, "Debug")) test.capture [[ ]] end -- -- Test multiple platforms -- function suite.Platforms_OnMultiplePlatforms() platforms { "x32", "x64" } prepare() premake.vs200x_vcproj(prj) local result = io.endcapture() test.istrue(result:find ' ]] end -- -- Test Xbox360 handling -- function suite.PlatformsList_OnXbox360() platforms { "Native", "Xbox360" } prepare() premake.vs200x_vcproj_platforms(prj) test.capture [[ ]] end function suite.CompilerBlock_OnXbox360() platforms { "Xbox360" } prepare() premake.vs200x_vcproj_VCCLCompilerTool(premake.getconfig(prj, "Debug", "Xbox360")) test.capture [[ ]] end -- -- Test PS3 handling -- function suite.PlatformsList_OnPS3() platforms { "Native", "PS3" } prepare() premake.vs200x_vcproj_platforms(prj) test.capture [[ ]] end function suite.CompilerBlock_OnPS3() platforms { "PS3" } flags { "Symbols" } includedirs { "include/pkg1", "include/pkg2" } defines { "DEFINE1", "DEFINE2" } prepare() premake.vs200x_vcproj_VCCLCompilerTool_GCC(premake.getconfig(prj, "Debug", "PS3")) test.capture [[ ]] end function suite.LinkerBlock_OnPS3ConsoleApp() platforms { "PS3" } prepare() premake.vs200x_vcproj_VCLinkerTool_GCC(premake.getconfig(prj, "Debug", "PS3")) test.capture [[ ]] end function suite.LinkerBlock_OnPS3StaticLib() platforms { "PS3" } kind "StaticLib" prepare() premake.vs200x_vcproj_VCLinkerTool_GCC(premake.getconfig(prj, "Debug", "PS3")) test.capture [[ ]] end function suite.LinkerBlock_OnPS3SharedLink() platforms { "PS3" } links { "MyLibrary" } project "MyLibrary" language "C++" kind "SharedLib" prepare() premake.vs200x_vcproj_VCLinkerTool_GCC(premake.getconfig(prj, "Debug", "PS3")) test.capture [[ ]] end -- -- Test manifest file handling. -- function suite.VCManifestTool_OnNoManifests() files { "hello.c", "goodbye.c" } prepare() premake.vs200x_vcproj_VCManifestTool(premake.getconfig(prj, "Debug")) test.capture [[ ]] end function suite.VCManifestTool_OnNoManifests() files { "hello.c", "project1.manifest", "goodbye.c", "project2.manifest" } prepare() premake.vs200x_vcproj_VCManifestTool(premake.getconfig(prj, "Debug")) test.capture [[ ]] end -- -- Test precompiled header handling -- function suite.CompilerBlock_OnPCH() pchheader "source/common.h" pchsource "source/common.cpp" prepare() premake.vs200x_vcproj_VCCLCompilerTool(premake.getconfig(prj, "Debug")) test.capture [[ ]] end function suite.Files_OnPCH_OnWindows() files { "afxwin.cpp" } pchsource "afxwin.cpp" prepare() _VS.files(prj, "afxwin.cpp", "Item", 1) test.capture [[ ]] end function suite.Files_OnPCH_OnXbox360() files { "afxwin.cpp" } pchsource "afxwin.cpp" platforms { "Xbox360" } prepare() sln.vstudio_configs = premake.vstudio_buildconfigs(sln) _VS.files(prj, "afxwin.cpp", "Item", 1) test.capture [[ ]] end -- -- Floating point flag tests -- function suite.CompilerBlock_OnFpFast() flags { "FloatFast" } prepare() premake.vs200x_vcproj_VCCLCompilerTool(premake.getconfig(prj, "Debug")) test.capture [[ ]] end function suite.CompilerBlock_OnFpStrict() flags { "FloatStrict" } prepare() premake.vs200x_vcproj_VCCLCompilerTool(premake.getconfig(prj, "Debug")) test.capture [[ ]] end -- -- PDB file naming tests -- function suite.CompilerBlock_OnTargetName() targetname "foob" prepare() premake.vs200x_vcproj_VCCLCompilerTool(premake.getconfig(prj, "Debug")) test.capture [[ ]] end -- -- Compilation option tests -- function suite.CompilerBlock_OnNoMinimalRebuild() flags { "Symbols", "NoMinimalRebuild" } prepare() premake.vs200x_vcproj_VCCLCompilerTool(premake.getconfig(prj, "Debug")) test.capture [[ ]] end -- -- RuntimeLibrary tests -- function suite.CompilerBlock_RuntimeLibrary_IsDebug_OnSymbolsNoOptimize() flags { "Symbols" } prepare() premake.vs200x_vcproj_VCCLCompilerTool(premake.getconfig(prj, "Debug")) test.capture [[ ]] end function suite.CompilerBlock_RuntimeLibrary_IsRelease_OnOptimize() flags { "Symbols", "Optimize" } prepare() premake.vs200x_vcproj_VCCLCompilerTool(premake.getconfig(prj, "Debug")) test.capture [[ ]] end -- -- C language support -- function suite.CompilerBlock_RuntimeLibrary_IsDebug_OnSymbolsNoOptimize() language "C" flags { "Symbols" } prepare() premake.vs200x_vcproj_VCCLCompilerTool(premake.getconfig(prj, "Debug")) test.capture [[ ]] end premake-4.3-src+repack1/tests/actions/vstudio/test_vs2010_flags.lua0000644000000000000000000001722511470465410023772 0ustar rootroot T.vs2010_flags = { } local vs10_flags = T.vs2010_flags local sln, prj function vs10_flags.setup() _ACTION = "vs2010" sln = solution "MySolution" configurations { "Debug" } platforms {} prj = project "MyProject" language "C++" kind "ConsoleApp" uuid "AE61726D-187C-E440-BD07-2556188A6565" includedirs{"foo/bar"} end local function get_buffer() io.capture() premake.buildconfigs() sln.vstudio_configs = premake.vstudio_buildconfigs(sln) premake.vs2010_vcxproj(prj) local buffer = io.endcapture() return buffer end function vs10_flags.sseSet() flags {"EnableSSE"} local buffer = get_buffer() test.string_contains(buffer,'StreamingSIMDExtensions') end function vs10_flags.sse2Set() flags {"EnableSSE2"} local buffer = get_buffer() test.string_contains(buffer,'StreamingSIMDExtensions2') end function vs10_flags.extraWarningNotSet_warningLevelIsThree() local buffer = get_buffer() test.string_contains(buffer,'Level3') end function vs10_flags.extraWarning_warningLevelIsFour() flags {"ExtraWarnings"} local buffer = get_buffer() test.string_contains(buffer,'Level4') end function vs10_flags.extraWarning_treatWarningsAsError_setToTrue() flags {"FatalWarnings"} local buffer = get_buffer() test.string_contains(buffer,'true') end function vs10_flags.floatFast_floatingPointModel_setToFast() flags {"FloatFast"} local buffer = get_buffer() test.string_contains(buffer,'Fast') end function vs10_flags.floatStrict_floatingPointModel_setToStrict() flags {"FloatStrict"} local buffer = get_buffer() test.string_contains(buffer,'Strict') end function vs10_flags.nativeWideChar_TreatWChar_tAsBuiltInType_setToTrue() flags {"NativeWChar"} local buffer = get_buffer() test.string_contains(buffer,'true') end function vs10_flags.nativeWideChar_TreatWChar_tAsBuiltInType_setToFalse() flags {"NoNativeWChar"} local buffer = get_buffer() test.string_contains(buffer,'false') end function vs10_flags.noExceptions_exceptionHandling_setToFalse() flags {"NoExceptions"} local buffer = get_buffer() test.string_contains(buffer,'false') end function vs10_flags.structuredExceptions_exceptionHandling_setToAsync() flags {"SEH"} local buffer = get_buffer() test.string_contains(buffer,'Async') end function vs10_flags.noFramePointer_omitFramePointers_setToTrue() flags {"NoFramePointer"} local buffer = get_buffer() test.string_contains(buffer,'true') end function vs10_flags.noRTTI_runtimeTypeInfo_setToFalse() flags {"NoRTTI"} local buffer = get_buffer() test.string_contains(buffer,'false') end function vs10_flags.optimizeSize_optimization_setToMinSpace() flags {"OptimizeSize"} local buffer = get_buffer() test.string_contains(buffer,'MinSpace') end function vs10_flags.optimizeSpeed_optimization_setToMaxSpeed() flags {"OptimizeSpeed"} local buffer = get_buffer() test.string_contains(buffer,'MaxSpeed') end function vs10_flags.optimizeSpeed_optimization_setToMaxSpeed() flags {"Optimize"} local buffer = get_buffer() test.string_contains(buffer,'Full') end local debug_string = "Symbols" local release_string = "Optimize" function vs10_flags.debugHasNoStaticRuntime_runtimeLibrary_setToMultiThreadedDebugDLL() flags {debug_string} local buffer = get_buffer() test.string_contains(buffer,'MultiThreadedDebugDLL') end function vs10_flags.debugAndStaticRuntime_runtimeLibrary_setToMultiThreadedDebug() flags {debug_string,"StaticRuntime"} local buffer = get_buffer() test.string_contains(buffer,'MultiThreadedDebug') end function vs10_flags.releaseHasNoStaticRuntime_runtimeLibrary_setToMultiThreadedDLL() flags {release_string} local buffer = get_buffer() test.string_contains(buffer,'MultiThreadedDLL') end function vs10_flags.releaseAndStaticRuntime_runtimeLibrary_setToMultiThreaded() flags {release_string,"StaticRuntime"} local buffer = get_buffer() test.string_contains(buffer,'MultiThreaded') end function vs10_flags.noCharacterSetDefine_characterSet_setToMultiByte() local buffer = get_buffer() test.string_contains(buffer,'MultiByte') end function vs10_flags.unicode_characterSet_setToUnicode() flags {"Unicode"} local buffer = get_buffer() test.string_contains(buffer,'Unicode') end function vs10_flags.debugAndNoMinimalRebuildAndSymbols_minimalRebuild_setToFalse() flags {debug_string,"NoMinimalRebuild"} local buffer = get_buffer() test.string_contains(buffer,'false') end function vs10_flags.debugYetNotMinimalRebuild_minimalRebuild_setToTrue() flags {debug_string} local buffer = get_buffer() test.string_contains(buffer,'true') end function vs10_flags.release_minimalRebuild_setToFalse() flags {release_string} local buffer = get_buffer() test.string_contains(buffer,'false') end function vs10_flags.mfc_useOfMfc_setToStatic() flags{"MFC"} local buffer = get_buffer() test.string_contains(buffer,'Dynamic') end function vs10_flags.Symbols_DebugInformationFormat_setToEditAndContinue() flags{"Symbols"} local buffer = get_buffer() test.string_contains(buffer,'EditAndContinue') end function vs10_flags.symbolsAndNoEditAndContinue_DebugInformationFormat_setToProgramDatabase() flags{"Symbols","NoEditAndContinue"} local buffer = get_buffer() test.string_contains(buffer,'ProgramDatabase') end function vs10_flags.symbolsAndRelease_DebugInformationFormat_setToProgramDatabase() flags{"Symbols",release_string} local buffer = get_buffer() test.string_contains(buffer,'ProgramDatabase') end function vs10_flags.noSymbols_DebugInformationFormat_blockIsEmpty() local buffer = get_buffer() test.string_contains(buffer,'') end function vs10_flags.symbols_64BitBuild_DebugInformationFormat_setToOldStyle() flags{"Symbols"} platforms{"x64"} local buffer = get_buffer() test.string_contains(buffer,'OldStyle') end function vs10_flags.noManifest_GenerateManifest_setToFalse() flags{"NoManifest"} local buffer = get_buffer() test.string_contains(buffer,'false') end function vs10_flags.noSymbols_bufferDoesNotContainprogramDataBaseFile() local buffer = get_buffer() test.string_does_not_contain(buffer,'.*.*') end function vs10_flags.symbols_bufferContainsprogramDataBaseFile() flags{"Symbols"} local buffer = get_buffer() test.string_contains(buffer,'.*%$%(OutDir%)MyProject%.pdb.*') end premake-4.3-src+repack1/tests/actions/vstudio/test_vs2010_project_kinds.lua0000644000000000000000000001724311470465410025534 0ustar rootroot T.vs2010_project_kinds= { } local vs10_project_kinds = T.vs2010_project_kinds local sln, prj function vs10_project_kinds.setup() _ACTION = "vs2010" sln = solution "MySolution" configurations { "Debug" } platforms {} prj = project "MyProject" language "C++" end local function get_buffer() io.capture() premake.buildconfigs() sln.vstudio_configs = premake.vstudio_buildconfigs(sln) premake.vs2010_vcxproj(prj) buffer = io.endcapture() return buffer end --incorrect assumption --[[ function vs10_project_kinds.staticLib_doesNotContainLinkSection() kind "StaticLib" local buffer = get_buffer() test.string_does_not_contain(buffer,'.*') end --]] function vs10_project_kinds.staticLib_containsLibSection() kind "StaticLib" local buffer = get_buffer() test.string_contains(buffer,'.*.*') end function vs10_project_kinds.staticLib_libSection_containsProjectNameDotLib() kind "StaticLib" local buffer = get_buffer() test.string_contains(buffer,'.*.*MyProject.lib.*.*') end --[[ function vs10_project_kinds.sharedLib_fail_asIDoNotKnowWhatItShouldLookLike_printsTheBufferSoICanCompare() kind "SharedLib" local buffer = get_buffer() test.string_contains(buffer,'youWillNotFindThis') end --]] --[[ check OutDir in debug it is showing "." shared lib missing ??? in link section when noInportLib not used --]] --check why true is missing in a debug static lib and shared lib build function vs10_project_kinds.staticLib_valueInMinimalRebuildIsTrue() kind "StaticLib" flags {"Symbols"} local buffer = get_buffer() test.string_contains(buffer,'.*true.*') end function vs10_project_kinds.sharedLib_valueInMinimalRebuildIsTrue() kind "SharedLib" flags {"Symbols"} local buffer = get_buffer() test.string_contains(buffer,'.*true.*') end --shared lib missing EditAndContinue in ClCompile section function vs10_project_kinds.sharedLib_valueDebugInformationFormatIsEditAndContinue() kind "SharedLib" flags {"Symbols"} local buffer = get_buffer() test.string_contains(buffer,'.*EditAndContinue.*') end function vs10_project_kinds.sharedLib_valueGenerateDebugInformationIsTrue() kind "SharedLib" flags {"Symbols"} local buffer = get_buffer() test.string_contains(buffer,'.*true.*') end function vs10_project_kinds.sharedLib_linkSectionContainsImportLibrary() kind "SharedLib" local buffer = get_buffer() test.string_contains(buffer,'.*.*.*') end function vs10_project_kinds.sharedLib_bufferContainsImportLibrary() kind "SharedLib" local buffer = get_buffer() test.string_contains(buffer,'.*MyProject.lib.*') end --should this go in vs2010_flags??? function vs10_project_kinds.sharedLib_withNoImportLibraryFlag_linkSectionContainsImportLibrary() kind "SharedLib" flags{"NoImportLib"} local buffer = get_buffer() test.string_contains(buffer,'.*.*.*') end function vs10_project_kinds.sharedLib_withOutNoImportLibraryFlag_propertyGroupSectionContainsIgnoreImportLibrary() kind "SharedLib" local buffer = get_buffer() test.string_contains(buffer,'.*.*') end function vs10_project_kinds.sharedLib_withNoImportLibraryFlag_propertyGroupSectionContainsIgnoreImportLibrary() kind "SharedLib" flags{"NoImportLib"} local buffer = get_buffer() test.string_contains(buffer,'.*.*') end function vs10_project_kinds.sharedLib_withOutNoImportLibraryFlag_ignoreImportLibraryValueIsFalse() kind "SharedLib" local buffer = get_buffer() test.string_contains(buffer,'.*.*') end function vs10_project_kinds.sharedLib_withNoImportLibraryFlag_ignoreImportLibraryValueIsTrue() kind "SharedLib" flags{"NoImportLib"} local buffer = get_buffer() test.string_contains(buffer,'.*.*') end --shared lib LinkIncremental set to incorrect value of false function vs10_project_kinds.staticLib_doesNotContainLinkIncremental() kind "StaticLib" flags {"Symbols"} local buffer = get_buffer() test.string_does_not_contain(buffer,'') end function vs10_project_kinds.sharedLib_withoutOptimisation_linkIncrementalValueIsTrue() kind "SharedLib" local buffer = get_buffer() test.string_contains(buffer,'') end function vs10_project_kinds.sharedLib_withOptimisation_linkIncrementalValueIsFalse() kind "SharedLib" flags{"Optimize"} local buffer = get_buffer() test.string_contains(buffer,'') end --check all configs %(AdditionalIncludeDirectories) missing before AdditionalIncludeDirectories end tag in ClCompile function vs10_project_kinds.kindDoesNotMatter_noAdditionalDirectoriesSpecified_bufferDoesNotContainAdditionalIncludeDirectories() kind "SharedLib" local buffer = get_buffer() test.string_does_not_contain(buffer,'.*.*') end function vs10_project_kinds.configType_configIsWindowedApp_resultComparesEqualToApplication() local t = { kind = "WindowedApp"} local result = premake.vstudio.vs10_helpers.config_type(t) test.isequal('Application',result) end function vs10_project_kinds.linkOptions_staticLib_bufferContainsAdditionalOptionsInSideLibTag() kind "StaticLib" linkoptions{'/dummyOption'} test.string_contains(get_buffer(), '.*%%%(AdditionalOptions%).*') end function vs10_project_kinds.noLinkOptions_staticLib_bufferDoesNotContainAdditionalOptionsInSideLibTag() kind "StaticLib" test.string_does_not_contain(get_buffer(), '.*%%%(AdditionalOptions%).*') end function vs10_project_kinds.linkOptions_staticLib_bufferContainsPassedOption() kind "StaticLib" linkoptions{'/dummyOption'} test.string_contains(get_buffer(), '/dummyOption %%%(AdditionalOptions%).*') end function vs10_project_kinds.linkOptions_windowedApp_bufferContainsAdditionalOptionsInSideLinkTag() kind "WindowedApp" linkoptions{'/dummyOption'} test.string_contains(get_buffer(), '.* %%%(AdditionalOptions%).*') end function vs10_project_kinds.linkOptions_consoleApp_bufferContainsAdditionalOptionsInSideLinkTag() kind "ConsoleApp" linkoptions{'/dummyOption'} test.string_contains(get_buffer(), '.* %%%(AdditionalOptions%).*') end function vs10_project_kinds.linkOptions_sharedLib_bufferContainsAdditionalOptionsInSideLinkTag() kind "SharedLib" linkoptions{'/dummyOption'} test.string_contains(get_buffer(), '.* %%%(AdditionalOptions%).*') end premake-4.3-src+repack1/tests/actions/vstudio/test_vs2005_csproj.lua0000644000000000000000000000631711470465410024202 0ustar rootroot-- -- tests/actions/test_vs2005_csproj.lua -- Automated test suite for Visual Studio 2005-2008 C# project generation. -- Copyright (c) 2010 Jason Perkins and the Premake project -- T.vs2005_csproj = { } local suite = T.vs2005_csproj local cs2005 = premake.vstudio.cs2005 -- -- Configure a solution for testing -- local sln, prj function suite.setup() _ACTION = "vs2005" sln = solution "MySolution" configurations { "Debug", "Release" } platforms {} project "MyProject" language "C#" kind "ConsoleApp" uuid "AE61726D-187C-E440-BD07-2556188A6565" end local function prepare() io.capture() premake.buildconfigs() prj = premake.solution.getproject(sln, 1) end -- -- Project element tests -- function suite.projectelement_OnVs2005() _ACTION = "vs2005" prepare() cs2005.projectelement(prj) test.capture [[ ]] end function suite.projectelement_OnVs2008() _ACTION = "vs2008" prepare() cs2005.projectelement(prj) test.capture [[ ]] end -- -- Project settings tests -- function suite.projectsettings_OnVs2005() _ACTION = "vs2005" prepare() cs2005.projectsettings(prj) test.capture [[ Debug AnyCPU 8.0.50727 2.0 {AE61726D-187C-E440-BD07-2556188A6565} Exe Properties MyProject MyProject ]] end function suite.projectsettings_OnVs2008() _ACTION = "vs2008" prepare() cs2005.projectsettings(prj) test.capture [[ Debug AnyCPU 9.0.21022 2.0 {AE61726D-187C-E440-BD07-2556188A6565} Exe Properties MyProject MyProject ]] end function suite.projectsettings_OnFrameworkVersion() _ACTION = "vs2005" framework "3.0" prepare() cs2005.projectsettings(prj) test.capture [[ Debug AnyCPU 8.0.50727 2.0 {AE61726D-187C-E440-BD07-2556188A6565} Exe Properties MyProject MyProject v3.0 ]] end premake-4.3-src+repack1/tests/actions/xcode/0000755000000000000000000000000011470465410017517 5ustar rootrootpremake-4.3-src+repack1/tests/actions/xcode/test_xcode_dependencies.lua0000644000000000000000000002272211470465410025076 0ustar rootroot-- -- tests/actions/xcode/test_xcode_dependencies.lua -- Automated test suite for Xcode project dependencies. -- Copyright (c) 2009 Jason Perkins and the Premake project -- T.xcode3_deps = { } local suite = T.xcode3_deps local xcode = premake.xcode --------------------------------------------------------------------------- -- Setup/Teardown --------------------------------------------------------------------------- local sln, prj, prj2, tr function suite.setup() premake.action.set("xcode3") xcode.used_ids = { } -- reset the list of generated IDs sln, prj = test.createsolution() links { "MyProject2" } prj2 = test.createproject(sln) kind "StaticLib" configuration "Debug" targetsuffix "-d" end local function prepare() io.capture() premake.buildconfigs() xcode.preparesolution(sln) tr = xcode.buildprjtree(premake.solution.getproject(sln, 1)) end --------------------------------------------------------------------------- -- PBXBuildFile tests --------------------------------------------------------------------------- function suite.PBXBuildFile_ListsDependencyTargets_OnStaticLib() prepare() xcode.PBXBuildFile(tr) test.capture [[ /* Begin PBXBuildFile section */ [libMyProject2-d.a:build] /* libMyProject2-d.a in Frameworks */ = {isa = PBXBuildFile; fileRef = [libMyProject2-d.a] /* libMyProject2-d.a */; }; /* End PBXBuildFile section */ ]] end function suite.PBXBuildFile_ListsDependencyTargets_OnSharedLib() kind "SharedLib" prepare() xcode.PBXBuildFile(tr) test.capture [[ /* Begin PBXBuildFile section */ [libMyProject2-d.dylib:build] /* libMyProject2-d.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = [libMyProject2-d.dylib] /* libMyProject2-d.dylib */; }; /* End PBXBuildFile section */ ]] end --------------------------------------------------------------------------- -- PBXContainerItemProxy tests --------------------------------------------------------------------------- function suite.PBXContainerItemProxy_ListsProjectConfigs() prepare() xcode.PBXContainerItemProxy(tr) test.capture [[ /* Begin PBXContainerItemProxy section */ [MyProject2.xcodeproj:prodprox] /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = [MyProject2.xcodeproj] /* MyProject2.xcodeproj */; proxyType = 2; remoteGlobalIDString = [libMyProject2-d.a:product]; remoteInfo = "libMyProject2-d.a"; }; [MyProject2.xcodeproj:targprox] /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = [MyProject2.xcodeproj] /* MyProject2.xcodeproj */; proxyType = 1; remoteGlobalIDString = [libMyProject2-d.a:target]; remoteInfo = "libMyProject2-d.a"; }; /* End PBXContainerItemProxy section */ ]] end --------------------------------------------------------------------------- -- PBXFileReference tests --------------------------------------------------------------------------- function suite.PBXFileReference_ListsDependencies() prepare() xcode.PBXFileReference(tr) test.capture [[ /* Begin PBXFileReference section */ [MyProject:product] /* MyProject */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = "MyProject"; path = "MyProject"; sourceTree = BUILT_PRODUCTS_DIR; }; [MyProject2.xcodeproj] /* MyProject2.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "MyProject2.xcodeproj"; path = "MyProject2.xcodeproj"; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ ]] end function suite.PBXFileReference_UsesRelativePaths() prj.location = "MyProject" prj2.location = "MyProject2" prepare() xcode.PBXFileReference(tr) test.capture [[ /* Begin PBXFileReference section */ [MyProject:product] /* MyProject */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = "MyProject"; path = "MyProject"; sourceTree = BUILT_PRODUCTS_DIR; }; [MyProject2.xcodeproj] /* MyProject2.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "MyProject2.xcodeproj"; path = "../MyProject2/MyProject2.xcodeproj"; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ ]] end --------------------------------------------------------------------------- -- PBXFrameworksBuildPhase tests --------------------------------------------------------------------------- function suite.PBXFrameworksBuildPhase_ListsDependencies_OnStaticLib() prepare() xcode.PBXFrameworksBuildPhase(tr) test.capture [[ /* Begin PBXFrameworksBuildPhase section */ [MyProject:fxs] /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( [libMyProject2-d.a:build] /* libMyProject2-d.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ ]] end function suite.PBXFrameworksBuildPhase_ListsDependencies_OnSharedLib() kind "SharedLib" prepare() xcode.PBXFrameworksBuildPhase(tr) test.capture [[ /* Begin PBXFrameworksBuildPhase section */ [MyProject:fxs] /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( [libMyProject2-d.dylib:build] /* libMyProject2-d.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ ]] end --------------------------------------------------------------------------- -- PBXGroup tests --------------------------------------------------------------------------- function suite.PBXGroup_ListsDependencies() prepare() xcode.PBXGroup(tr) -- test.print(io.endcapture()) test.capture [[ /* Begin PBXGroup section */ [MyProject] /* MyProject */ = { isa = PBXGroup; children = ( [Products] /* Products */, [Projects] /* Projects */, ); name = "MyProject"; sourceTree = ""; }; [Products] /* Products */ = { isa = PBXGroup; children = ( [MyProject:product] /* MyProject */, ); name = "Products"; sourceTree = ""; }; [Projects] /* Projects */ = { isa = PBXGroup; children = ( [MyProject2.xcodeproj] /* MyProject2.xcodeproj */, ); name = "Projects"; sourceTree = ""; }; [MyProject2.xcodeproj:prodgrp] /* Products */ = { isa = PBXGroup; children = ( [libMyProject2-d.a] /* libMyProject2-d.a */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ ]] end --------------------------------------------------------------------------- -- PBXNativeTarget tests --------------------------------------------------------------------------- function suite.PBXNativeTarget_ListsDependencies() prepare() xcode.PBXNativeTarget(tr) test.capture [[ /* Begin PBXNativeTarget section */ [MyProject:target] /* MyProject */ = { isa = PBXNativeTarget; buildConfigurationList = [MyProject:cfg] /* Build configuration list for PBXNativeTarget "MyProject" */; buildPhases = ( [MyProject:rez] /* Resources */, [MyProject:src] /* Sources */, [MyProject:fxs] /* Frameworks */, ); buildRules = ( ); dependencies = ( [MyProject2.xcodeproj:targdep] /* PBXTargetDependency */, ); name = "MyProject"; productInstallPath = "$(HOME)/bin"; productName = "MyProject"; productReference = [MyProject:product] /* MyProject */; productType = "com.apple.product-type.tool"; }; /* End PBXNativeTarget section */ ]] end --------------------------------------------------------------------------- -- PBXProject tests --------------------------------------------------------------------------- function suite.PBXProject_ListsDependencies() prepare() xcode.PBXProject(tr) test.capture [[ /* Begin PBXProject section */ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "MyProject" */; compatibilityVersion = "Xcode 3.1"; hasScannedForEncodings = 1; mainGroup = [MyProject] /* MyProject */; projectDirPath = ""; projectReferences = ( { ProductGroup = [MyProject2.xcodeproj:prodgrp] /* Products */; ProjectRef = [MyProject2.xcodeproj] /* MyProject2.xcodeproj */; }, ); projectRoot = ""; targets = ( [MyProject:target] /* MyProject */, ); }; /* End PBXProject section */ ]] end --------------------------------------------------------------------------- -- PBXReferenceProxy tests --------------------------------------------------------------------------- function suite.PBXReferenceProxy_ListsDependencies() prepare() xcode.PBXReferenceProxy(tr) test.capture [[ /* Begin PBXReferenceProxy section */ [libMyProject2-d.a] /* libMyProject2-d.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libMyProject2-d.a"; remoteRef = [MyProject2.xcodeproj:prodprox] /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ ]] end --------------------------------------------------------------------------- -- PBXTargetDependency tests --------------------------------------------------------------------------- function suite.PBXTargetDependency_ListsDependencies() prepare() xcode.PBXTargetDependency(tr) test.capture [[ /* Begin PBXTargetDependency section */ [MyProject2.xcodeproj:targdep] /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "libMyProject2-d.a"; targetProxy = [MyProject2.xcodeproj:targprox] /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ ]] end premake-4.3-src+repack1/tests/actions/xcode/test_xcode_common.lua0000644000000000000000000000305711470465410023740 0ustar rootroot-- -- tests/actions/xcode/test_xcode_common.lua -- Automated test suite for functions shared between Xcode projects and solutions -- Copyright (c) 2009 Jason Perkins and the Premake project -- T.xcode3common = { } local suite = T.xcode3common local xcode = premake.xcode -- -- Replacement for xcode.newid(). Creates a synthetic ID based on the node name, -- it's intended usage (file ID, build ID, etc.) and its place in the tree. This -- makes it easier to tell if the right ID is being used in the right places. -- xcode.used_ids = {} xcode.newid = function(node, usage) local name = node.name if usage then name = name .. ":" .. usage end if xcode.used_ids[name] then local count = xcode.used_ids[name] + 1 xcode.used_ids[name] = count name = name .. "(" .. count .. ")" else xcode.used_ids[name] = 1 end return "[" .. name .. "]" end --------------------------------------------------------------------------- -- Setup --------------------------------------------------------------------------- function suite.setup() io.capture() end --------------------------------------------------------------------------- -- Header/footer tests --------------------------------------------------------------------------- function suite.Header_IsCorrect() xcode.Header() test.capture [[ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 45; objects = { ]] end function suite.Footer() xcode.Footer() test.capture [[ }; rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; } ]] end premake-4.3-src+repack1/tests/actions/xcode/test_xcode_project.lua0000644000000000000000000013755211470465410024126 0ustar rootroot-- -- tests/actions/xcode/test_xcode_project.lua -- Automated test suite for Xcode project generation. -- Copyright (c) 2009-2010 Jason Perkins and the Premake project -- T.xcode3_project = { } local suite = T.xcode3_project local xcode = premake.xcode --------------------------------------------------------------------------- -- Setup/Teardown --------------------------------------------------------------------------- local sln, tr function suite.setup() premake.action.set("xcode3") io.eol = "\n" xcode.used_ids = { } -- reset the list of generated IDs sln = test.createsolution() end local function prepare() io.capture() premake.buildconfigs() xcode.preparesolution(sln) local prj = premake.solution.getproject(sln, 1) tr = xcode.buildprjtree(prj) end --------------------------------------------------------------------------- -- PBXBuildFile tests --------------------------------------------------------------------------- function suite.PBXBuildFile_ListsCppSources() files { "source.h", "source.c", "source.cpp", "Info.plist" } prepare() xcode.PBXBuildFile(tr) test.capture [[ /* Begin PBXBuildFile section */ [source.c:build] /* source.c in Sources */ = {isa = PBXBuildFile; fileRef = [source.c] /* source.c */; }; [source.cpp:build] /* source.cpp in Sources */ = {isa = PBXBuildFile; fileRef = [source.cpp] /* source.cpp */; }; /* End PBXBuildFile section */ ]] end function suite.PBXBuildFile_ListsObjCSources() files { "source.h", "source.m", "source.mm", "Info.plist" } prepare() xcode.PBXBuildFile(tr) test.capture [[ /* Begin PBXBuildFile section */ [source.m:build] /* source.m in Sources */ = {isa = PBXBuildFile; fileRef = [source.m] /* source.m */; }; [source.mm:build] /* source.mm in Sources */ = {isa = PBXBuildFile; fileRef = [source.mm] /* source.mm */; }; /* End PBXBuildFile section */ ]] end function suite.PBXBuildFile_ListsResourceFilesOnlyOnceWithGroupID() files { "English.lproj/MainMenu.xib", "French.lproj/MainMenu.xib" } prepare() xcode.PBXBuildFile(tr) test.capture [[ /* Begin PBXBuildFile section */ [MainMenu.xib:build] /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = [MainMenu.xib] /* MainMenu.xib */; }; /* End PBXBuildFile section */ ]] end function suite.PBXBuildFile_ListsFrameworks() links { "Cocoa.framework", "ldap" } prepare() xcode.PBXBuildFile(tr) test.capture [[ /* Begin PBXBuildFile section */ [Cocoa.framework:build] /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = [Cocoa.framework] /* Cocoa.framework */; }; /* End PBXBuildFile section */ ]] end --------------------------------------------------------------------------- -- PBXFileReference tests --------------------------------------------------------------------------- function suite.PBXFileReference_ListsConsoleTarget() prepare() xcode.PBXFileReference(tr) test.capture [[ /* Begin PBXFileReference section */ [MyProject:product] /* MyProject */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = "MyProject"; path = "MyProject"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ ]] end function suite.PBXFileReference_ListsWindowedTarget() kind "WindowedApp" prepare() xcode.PBXFileReference(tr) test.capture [[ /* Begin PBXFileReference section */ [MyProject.app:product] /* MyProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; name = "MyProject.app"; path = "MyProject.app"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ ]] end function suite.PBXFileReference_ListsStaticLibTarget() kind "StaticLib" prepare() xcode.PBXFileReference(tr) test.capture [[ /* Begin PBXFileReference section */ [libMyProject.a:product] /* libMyProject.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = "libMyProject.a"; path = "libMyProject.a"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ ]] end function suite.PBXFileReference_ListsSharedLibTarget() kind "SharedLib" prepare() xcode.PBXFileReference(tr) test.capture [[ /* Begin PBXFileReference section */ [libMyProject.dylib:product] /* libMyProject.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; name = "libMyProject.dylib"; path = "libMyProject.dylib"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ ]] end function suite.PBXFileReference_ListsSourceFiles() files { "source.c" } prepare() xcode.PBXFileReference(tr) test.capture [[ /* Begin PBXFileReference section */ [source.c] /* source.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "source.c"; path = "source.c"; sourceTree = ""; }; ]] end function suite.PBXFileReference_ListsXibCorrectly() files { "English.lproj/MainMenu.xib", "French.lproj/MainMenu.xib" } prepare() xcode.PBXFileReference(tr) test.capture [[ /* Begin PBXFileReference section */ [English] /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "English"; path = "English.lproj/MainMenu.xib"; sourceTree = ""; }; [French] /* French */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "French"; path = "French.lproj/MainMenu.xib"; sourceTree = ""; }; ]] end function suite.PBXFileReference_ListsStringsCorrectly() files { "English.lproj/InfoPlist.strings", "French.lproj/InfoPlist.strings" } prepare() xcode.PBXFileReference(tr) test.capture [[ /* Begin PBXFileReference section */ [English] /* English */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "English"; path = "English.lproj/InfoPlist.strings"; sourceTree = ""; }; [French] /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "French"; path = "French.lproj/InfoPlist.strings"; sourceTree = ""; }; ]] end function suite.PBXFileReference_ListFrameworksCorrectly() links { "Cocoa.framework" } prepare() xcode.PBXFileReference(tr) test.capture [[ /* Begin PBXFileReference section */ [Cocoa.framework] /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = "Cocoa.framework"; path = "/System/Library/Frameworks/Cocoa.framework"; sourceTree = ""; }; ]] end function suite.PBXFileReference_ListsIconFiles() files { "Icon.icns" } prepare() xcode.PBXFileReference(tr) test.capture [[ /* Begin PBXFileReference section */ [Icon.icns] /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = "Icon.icns"; path = "Icon.icns"; sourceTree = ""; }; ]] end function suite.PBXFileReference_IgnoresTargetDir() targetdir "bin" kind "WindowedApp" prepare() xcode.PBXFileReference(tr) test.capture [[ /* Begin PBXFileReference section */ [MyProject.app:product] /* MyProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; name = "MyProject.app"; path = "MyProject.app"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ ]] end function suite.PBXFileReference_UsesTargetSuffix() targetsuffix "-d" kind "SharedLib" prepare() xcode.PBXFileReference(tr) test.capture [[ /* Begin PBXFileReference section */ [libMyProject-d.dylib:product] /* libMyProject-d.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; name = "libMyProject-d.dylib"; path = "libMyProject-d.dylib"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ ]] end --------------------------------------------------------------------------- -- PBXFrameworksBuildPhase tests --------------------------------------------------------------------------- function suite.PBXFrameworksBuildPhase_OnNoFiles() prepare() xcode.PBXFrameworksBuildPhase(tr) test.capture [[ /* Begin PBXFrameworksBuildPhase section */ [MyProject:fxs] /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ ]] end function suite.PBXFrameworksBuild_ListsFrameworksCorrectly() links { "Cocoa.framework" } prepare() xcode.PBXFrameworksBuildPhase(tr) test.capture [[ /* Begin PBXFrameworksBuildPhase section */ [MyProject:fxs] /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( [Cocoa.framework:build] /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ ]] end --------------------------------------------------------------------------- -- PBXGroup tests --------------------------------------------------------------------------- function suite.PBXGroup_OnNoFiles() prepare() xcode.PBXGroup(tr) test.capture [[ /* Begin PBXGroup section */ [MyProject] /* MyProject */ = { isa = PBXGroup; children = ( [Products] /* Products */, ); name = "MyProject"; sourceTree = ""; }; [Products] /* Products */ = { isa = PBXGroup; children = ( [MyProject:product] /* MyProject */, ); name = "Products"; sourceTree = ""; }; /* End PBXGroup section */ ]] end function suite.PBXGroup_OnSourceFiles() files { "source.h" } prepare() xcode.PBXGroup(tr) test.capture [[ /* Begin PBXGroup section */ [MyProject] /* MyProject */ = { isa = PBXGroup; children = ( [source.h] /* source.h */, [Products] /* Products */, ); name = "MyProject"; sourceTree = ""; }; [Products] /* Products */ = { isa = PBXGroup; children = ( [MyProject:product] /* MyProject */, ); name = "Products"; sourceTree = ""; }; /* End PBXGroup section */ ]] end function suite.PBXGroup_OnSourceSubdirs() files { "include/premake/source.h" } prepare() xcode.PBXGroup(tr) test.capture [[ /* Begin PBXGroup section */ [MyProject] /* MyProject */ = { isa = PBXGroup; children = ( [include] /* include */, [Products] /* Products */, ); name = "MyProject"; sourceTree = ""; }; [include] /* include */ = { isa = PBXGroup; children = ( [premake] /* premake */, ); name = "include"; path = include; sourceTree = ""; }; [premake] /* premake */ = { isa = PBXGroup; children = ( [source.h] /* source.h */, ); name = "premake"; path = premake; sourceTree = ""; }; ]] end function suite.PBXGroup_SortsFiles() files { "test.h", "source.h", "source.cpp" } prepare() xcode.PBXGroup(tr) test.capture [[ /* Begin PBXGroup section */ [MyProject] /* MyProject */ = { isa = PBXGroup; children = ( [source.cpp] /* source.cpp */, [source.h] /* source.h */, [test.h] /* test.h */, [Products] /* Products */, ); name = "MyProject"; sourceTree = ""; }; [Products] /* Products */ = { isa = PBXGroup; children = ( [MyProject:product] /* MyProject */, ); name = "Products"; sourceTree = ""; }; /* End PBXGroup section */ ]] end function suite.PBXGroup_OnResourceFiles() files { "English.lproj/MainMenu.xib", "French.lproj/MainMenu.xib", "Info.plist" } prepare() xcode.PBXGroup(tr) test.capture [[ /* Begin PBXGroup section */ [MyProject] /* MyProject */ = { isa = PBXGroup; children = ( [Info.plist] /* Info.plist */, [MainMenu.xib] /* MainMenu.xib */, [Products] /* Products */, ); name = "MyProject"; sourceTree = ""; }; [Products] /* Products */ = { isa = PBXGroup; children = ( [MyProject:product] /* MyProject */, ); name = "Products"; sourceTree = ""; }; /* End PBXGroup section */ ]] end function suite.PBXGroup_OnFrameworks() links { "Cocoa.framework" } prepare() xcode.PBXGroup(tr) test.capture [[ /* Begin PBXGroup section */ [MyProject] /* MyProject */ = { isa = PBXGroup; children = ( [Frameworks] /* Frameworks */, [Products] /* Products */, ); name = "MyProject"; sourceTree = ""; }; [Frameworks] /* Frameworks */ = { isa = PBXGroup; children = ( [Cocoa.framework] /* Cocoa.framework */, ); name = "Frameworks"; sourceTree = ""; }; ]] end --------------------------------------------------------------------------- -- PBXNativeTarget tests --------------------------------------------------------------------------- function suite.PBXNativeTarget_OnConsoleApp() prepare() xcode.PBXNativeTarget(tr) test.capture [[ /* Begin PBXNativeTarget section */ [MyProject:target] /* MyProject */ = { isa = PBXNativeTarget; buildConfigurationList = [MyProject:cfg] /* Build configuration list for PBXNativeTarget "MyProject" */; buildPhases = ( [MyProject:rez] /* Resources */, [MyProject:src] /* Sources */, [MyProject:fxs] /* Frameworks */, ); buildRules = ( ); dependencies = ( ); name = "MyProject"; productInstallPath = "$(HOME)/bin"; productName = "MyProject"; productReference = [MyProject:product] /* MyProject */; productType = "com.apple.product-type.tool"; }; /* End PBXNativeTarget section */ ]] end function suite.PBXNativeTarget_OnWindowedApp() kind "WindowedApp" prepare() xcode.PBXNativeTarget(tr) test.capture [[ /* Begin PBXNativeTarget section */ [MyProject.app:target] /* MyProject */ = { isa = PBXNativeTarget; buildConfigurationList = [MyProject.app:cfg] /* Build configuration list for PBXNativeTarget "MyProject" */; buildPhases = ( [MyProject.app:rez] /* Resources */, [MyProject.app:src] /* Sources */, [MyProject.app:fxs] /* Frameworks */, ); buildRules = ( ); dependencies = ( ); name = "MyProject"; productInstallPath = "$(HOME)/Applications"; productName = "MyProject"; productReference = [MyProject.app:product] /* MyProject.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ ]] end function suite.PBXNativeTarget_OnSharedLib() kind "SharedLib" prepare() xcode.PBXNativeTarget(tr) test.capture [[ /* Begin PBXNativeTarget section */ [libMyProject.dylib:target] /* MyProject */ = { isa = PBXNativeTarget; buildConfigurationList = [libMyProject.dylib:cfg] /* Build configuration list for PBXNativeTarget "MyProject" */; buildPhases = ( [libMyProject.dylib:rez] /* Resources */, [libMyProject.dylib:src] /* Sources */, [libMyProject.dylib:fxs] /* Frameworks */, ); buildRules = ( ); dependencies = ( ); name = "MyProject"; productName = "MyProject"; productReference = [libMyProject.dylib:product] /* libMyProject.dylib */; productType = "com.apple.product-type.library.dynamic"; }; /* End PBXNativeTarget section */ ]] end function suite.PBXNativeTarget_OnBuildCommands() prebuildcommands { "prebuildcmd" } prelinkcommands { "prelinkcmd" } postbuildcommands { "postbuildcmd" } prepare() xcode.PBXNativeTarget(tr) test.capture [[ /* Begin PBXNativeTarget section */ [MyProject:target] /* MyProject */ = { isa = PBXNativeTarget; buildConfigurationList = [MyProject:cfg] /* Build configuration list for PBXNativeTarget "MyProject" */; buildPhases = ( 9607AE1010C857E500CD1376 /* Prebuild */, [MyProject:rez] /* Resources */, [MyProject:src] /* Sources */, 9607AE3510C85E7E00CD1376 /* Prelink */, [MyProject:fxs] /* Frameworks */, 9607AE3710C85E8F00CD1376 /* Postbuild */, ); buildRules = ( ); dependencies = ( ); name = "MyProject"; productInstallPath = "$(HOME)/bin"; productName = "MyProject"; productReference = [MyProject:product] /* MyProject */; productType = "com.apple.product-type.tool"; }; /* End PBXNativeTarget section */ ]] end --------------------------------------------------------------------------- -- PBXProject tests --------------------------------------------------------------------------- function suite.PBXProject_OnProject() prepare() xcode.PBXProject(tr) test.capture [[ /* Begin PBXProject section */ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "MyProject" */; compatibilityVersion = "Xcode 3.1"; hasScannedForEncodings = 1; mainGroup = [MyProject] /* MyProject */; projectDirPath = ""; projectRoot = ""; targets = ( [MyProject:target] /* MyProject */, ); }; /* End PBXProject section */ ]] end --------------------------------------------------------------------------- -- PBXResourceBuildPhase tests --------------------------------------------------------------------------- function suite.PBXResourcesBuildPhase_OnNoResources() prepare() xcode.PBXResourcesBuildPhase(tr) test.capture [[ /* Begin PBXResourcesBuildPhase section */ [MyProject:rez] /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ ]] end function suite.PBXResourcesBuildPhase_OnResources() files { "English.lproj/MainMenu.xib", "French.lproj/MainMenu.xib", "Info.plist" } prepare() xcode.PBXResourcesBuildPhase(tr) test.capture [[ /* Begin PBXResourcesBuildPhase section */ [MyProject:rez] /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( [MainMenu.xib:build] /* MainMenu.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ ]] end --------------------------------------------------------------------------- -- PBXShellScriptBuildPhase tests --------------------------------------------------------------------------- function suite.PBXShellScriptBuildPhase_OnNoScripts() prepare() xcode.PBXShellScriptBuildPhase(tr) test.capture [[ ]] end function suite.PBXShellScriptBuildPhase_OnPrebuildScripts() prebuildcommands { 'ls src', 'cp "a" "b"' } prepare() xcode.PBXShellScriptBuildPhase(tr) test.capture [[ /* Begin PBXShellScriptBuildPhase section */ 9607AE1010C857E500CD1376 /* Prebuild */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); name = Prebuild; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "ls src\ncp \"a\" \"b\""; }; /* End PBXShellScriptBuildPhase section */ ]] end function suite.PBXShellScriptBuildPhase_OnPerConfigCmds() prebuildcommands { 'ls src' } configuration "Debug" prebuildcommands { 'cp a b' } prepare() xcode.PBXShellScriptBuildPhase(tr) test.capture [[ /* Begin PBXShellScriptBuildPhase section */ 9607AE1010C857E500CD1376 /* Prebuild */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); name = Prebuild; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "ls src\nif [ \"${CONFIGURATION}\" = \"Debug\" ]; then\ncp a b\nfi"; }; /* End PBXShellScriptBuildPhase section */ ]] end --------------------------------------------------------------------------- -- PBXSourcesBuildPhase tests --------------------------------------------------------------------------- function suite.PBXSourcesBuildPhase_OnNoSources() prepare() xcode.PBXSourcesBuildPhase(tr) test.capture [[ /* Begin PBXSourcesBuildPhase section */ [MyProject:src] /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ ]] end function suite.PBXSourcesBuildPhase_OnSources() files { "hello.cpp", "goodbye.cpp" } prepare() xcode.PBXSourcesBuildPhase(tr) test.capture [[ /* Begin PBXSourcesBuildPhase section */ [MyProject:src] /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( [goodbye.cpp:build] /* goodbye.cpp in Sources */, [hello.cpp:build] /* hello.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ ]] end --------------------------------------------------------------------------- -- PBXVariantGroup tests --------------------------------------------------------------------------- function suite.PBXVariantGroup_OnNoGroups() prepare() xcode.PBXVariantGroup(tr) test.capture [[ /* Begin PBXVariantGroup section */ /* End PBXVariantGroup section */ ]] end function suite.PBXVariantGroup_OnNoResourceGroups() files { "English.lproj/MainMenu.xib", "French.lproj/MainMenu.xib" } prepare() xcode.PBXVariantGroup(tr) test.capture [[ /* Begin PBXVariantGroup section */ [MainMenu.xib] /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( [English] /* English */, [French] /* French */, ); name = MainMenu.xib; sourceTree = ""; }; /* End PBXVariantGroup section */ ]] end --------------------------------------------------------------------------- -- XCBuildConfiguration_Target tests --------------------------------------------------------------------------- function suite.XCBuildConfigurationTarget_OnConsoleApp() prepare() xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1]) test.capture [[ [MyProject:Debug] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; INSTALL_PATH = /usr/local/bin; PRODUCT_NAME = "MyProject"; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationTarget_OnWindowedApp() kind "WindowedApp" prepare() xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1]) test.capture [[ [MyProject.app:Debug] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; INSTALL_PATH = "$(HOME)/Applications"; PRODUCT_NAME = "MyProject"; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationTarget_OnStaticLib() kind "StaticLib" prepare() xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1]) test.capture [[ [libMyProject.a:Debug] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; INSTALL_PATH = /usr/local/lib; PRODUCT_NAME = "MyProject"; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationTarget_OnSharedLib() kind "SharedLib" prepare() xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1]) test.capture [[ [libMyProject.dylib:Debug] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; EXECUTABLE_PREFIX = lib; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; INSTALL_PATH = /usr/local/lib; PRODUCT_NAME = "MyProject"; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationTarget_OnTargetPrefix() kind "SharedLib" targetprefix "xyz" prepare() xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1]) test.capture [[ [xyzMyProject.dylib:Debug] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; EXECUTABLE_PREFIX = xyz; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; INSTALL_PATH = /usr/local/lib; PRODUCT_NAME = "MyProject"; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationTarget_OnInfoPlist() files { "MyProject-Info.plist" } prepare() xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1]) test.capture [[ [MyProject:Debug] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; INFOPLIST_FILE = "MyProject-Info.plist"; INSTALL_PATH = /usr/local/bin; PRODUCT_NAME = "MyProject"; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationTarget_OnSymbols() flags { "Symbols" } prepare() xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1]) test.capture [[ [MyProject:Debug] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; INSTALL_PATH = /usr/local/bin; PRODUCT_NAME = "MyProject"; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationTarget_OnTargetSuffix() targetsuffix "-d" prepare() xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1]) test.capture [[ [MyProject-d:Debug] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; INSTALL_PATH = /usr/local/bin; PRODUCT_NAME = "MyProject-d"; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationTarget_OnSinglePlatform() platforms { "Universal32" } prepare() xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1]) test.capture [[ [MyProject:Debug] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; INSTALL_PATH = /usr/local/bin; PRODUCT_NAME = "MyProject"; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationTarget_OnMultiplePlatforms() platforms { "Universal32", "Universal64" } prepare() xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1]) test.capture [[ [MyProject:Debug] /* Debug 32-bit Universal */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; INSTALL_PATH = /usr/local/bin; PRODUCT_NAME = "MyProject"; }; name = "Debug 32-bit Universal"; }; ]] end --------------------------------------------------------------------------- -- XCBuildConfiguration_Project tests --------------------------------------------------------------------------- function suite.XCBuildConfigurationProject_OnConsoleApp() prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnOptimize() flags { "Optimize" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = s; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnOptimizeSpeed() flags { "OptimizeSpeed" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 3; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnStaticRuntime() flags { "StaticRuntime" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnTargetDir() targetdir "bin" prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_BUILD_DIR = "$(SYMROOT)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; SYMROOT = "bin"; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnDefines() defines { "_DEBUG", "DEBUG" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "_DEBUG", "DEBUG", ); GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnIncludeDirs() includedirs { "../include", "../libs" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( "../include", "../libs", ); OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnBuildOptions() buildoptions { "build option 1", "build option 2" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "build option 1", "build option 2", ); PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnLinks() links { "Cocoa.framework", "ldap" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "-lldap", ); PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnLinkOptions() linkoptions { "link option 1", "link option 2" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "link option 1", "link option 2", ); PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnExtraWarnings() flags { "ExtraWarnings" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; WARNING_CFLAGS = "-Wall"; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnFatalWarnings() flags { "FatalWarnings" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnFloatFast() flags { "FloatFast" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "-ffast-math", ); PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnFloatStrict() flags { "FloatStrict" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "-ffloat-store", ); PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnNoEditAndContinue() flags { "Symbols", "NoEditAndContinue" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnNoExceptions() flags { "NoExceptions" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_OBJC_EXCEPTIONS = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnNoFramePointer() flags { "NoFramePointer" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "-fomit-frame-pointer", ); PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnNoPCH() pchheader "MyProject_Prefix.pch" flags { "NoPCH" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnNoRTTI() flags { "NoRTTI" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_CPP_RTTI = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnSymbols() flags { "Symbols" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnLibDirs() libdirs { "mylibs1", "mylibs2" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; LIBRARY_SEARCH_PATHS = ( "mylibs1", "mylibs2", ); OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnPCH() pchheader "MyProject_Prefix.pch" prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "MyProject_Prefix.pch"; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnUniversal() platforms { "Universal" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Universal/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnUniversal32() platforms { "Universal32" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Universal32/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnUniversal64() platforms { "Universal64" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Universal64/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnNative() platforms { "Native" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnX32() platforms { "x32" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "i386"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/x32/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnX64() platforms { "x64" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "x86_64"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/x64/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; }; name = "Debug"; }; ]] end function suite.XCBuildConfigurationProject_OnMultiplePlatforms() platforms { "Universal32", "Universal64" } prepare() xcode.XCBuildConfiguration_Project(tr, tr.configs[1]) test.capture [[ [MyProject:Debug(2)] /* Debug 32-bit Universal */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OBJROOT = "obj/Universal32/Debug"; ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; }; name = "Debug 32-bit Universal"; }; ]] end --------------------------------------------------------------------------- -- XCBuildConfigurationList tests --------------------------------------------------------------------------- function suite.XCBuildConfigurationList_OnNoPlatforms() prepare() xcode.XCBuildConfigurationList(tr) test.capture [[ /* Begin XCConfigurationList section */ [MyProject:cfg] /* Build configuration list for PBXNativeTarget "MyProject" */ = { isa = XCConfigurationList; buildConfigurations = ( [MyProject:Debug] /* Debug */, [MyProject:Release] /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = "Debug"; }; 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "MyProject" */ = { isa = XCConfigurationList; buildConfigurations = ( [MyProject:Debug(2)] /* Debug */, [MyProject:Release(2)] /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = "Debug"; }; /* End XCConfigurationList section */ ]] end function suite.XCBuildConfigurationList_OnSinglePlatforms() platforms { "Universal32" } prepare() xcode.XCBuildConfigurationList(tr) test.capture [[ /* Begin XCConfigurationList section */ [MyProject:cfg] /* Build configuration list for PBXNativeTarget "MyProject" */ = { isa = XCConfigurationList; buildConfigurations = ( [MyProject:Debug] /* Debug */, [MyProject:Release] /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = "Debug"; }; 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "MyProject" */ = { isa = XCConfigurationList; buildConfigurations = ( [MyProject:Debug(2)] /* Debug */, [MyProject:Release(2)] /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = "Debug"; }; /* End XCConfigurationList section */ ]] end function suite.XCBuildConfigurationList_OnMultiplePlatforms() platforms { "Universal32", "Universal64" } prepare() xcode.XCBuildConfigurationList(tr) test.capture [[ /* Begin XCConfigurationList section */ [MyProject:cfg] /* Build configuration list for PBXNativeTarget "MyProject" */ = { isa = XCConfigurationList; buildConfigurations = ( [MyProject:Debug] /* Debug 32-bit Universal */, [MyProject:Debug(3)] /* Debug 64-bit Universal */, [MyProject:Release] /* Release 32-bit Universal */, [MyProject:Release(3)] /* Release 64-bit Universal */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = "Debug 32-bit Universal"; }; 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "MyProject" */ = { isa = XCConfigurationList; buildConfigurations = ( [MyProject:Debug(2)] /* Debug 32-bit Universal */, [MyProject:Debug(4)] /* Debug 64-bit Universal */, [MyProject:Release(2)] /* Release 32-bit Universal */, [MyProject:Release(4)] /* Release 64-bit Universal */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = "Debug 32-bit Universal"; }; /* End XCConfigurationList section */ ]] end premake-4.3-src+repack1/tests/test_vs2010_sln.lua0000644000000000000000000000610211470465410020325 0ustar rootroot T.vs2010_sln = { } local vs_magic_cpp_build_tool_id = "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942" local constant_uuid = "AE61726D-187C-E440-BD07-2556188A6565" local constant_project_name = "MyProject" -- -- Configure a solution for testing -- local sln function T.vs2010_sln.setup() _ACTION = "vs2010" sln = solution "MySolution" configurations { "Debug", "Release" } platforms {} prj = project(constant_project_name) language "C++" kind "ConsoleApp" uuid(constant_uuid) premake.buildconfigs() end local function escape_id(str) return string.gsub(str,"%-+","%%%-") end local function assert_has_project(buffer,uid,name,ext) test.string_contains(buffer,"Project(\"{"..escape_id(vs_magic_cpp_build_tool_id).."}\") = \""..name.."\", \""..name.."."..ext.."\", \"{"..escape_id(uid).."}\"") end local function assert_find_uuid(buffer,id) test.string_contains(buffer,escape_id(id)) end local function get_buffer() io.capture() premake.vs_generic_solution(sln) buffer = io.endcapture() return buffer end function T.vs2010_sln.action_formatVersionis11() local buffer = get_buffer() test.string_contains(buffer,'Format Version 11.00') end function T.vs2010_sln.action_vsIs2010() local buffer = get_buffer() test.string_contains(buffer,'# Visual Studio 2010') end function T.vs2010_sln.action_hasProjectScope() local buffer = get_buffer() test.string_contains(buffer,"Project(.*)EndProject") end function T.vs2010_sln.containsVsCppMagicId() local buffer = get_buffer() assert_find_uuid(buffer,vs_magic_cpp_build_tool_id) end function T.vs2010_sln.action_findMyProjectID() local buffer = get_buffer() test.string_contains(buffer,escape_id(constant_uuid)) end function T.vs2010_sln.action_findsExtension() local buffer = get_buffer() test.string_contains(buffer,".vcxproj") end function T.vs2010_sln.action_hasGlobalStartBlock() local buffer = get_buffer() test.string_contains(buffer,"Global") end function T.vs2010_sln.action_hasGlobalEndBlock() local buffer = get_buffer() test.string_contains(buffer,"EndGlobal") end function T.vs2010_sln.BasicLayout() io.capture() premake.vs_generic_solution(sln) test.capture ('\239\187\191' .. [[ Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyProject", "MyProject.vcxproj", "{AE61726D-187C-E440-BD07-2556188A6565}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.ActiveCfg = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.Build.0 = Debug|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.ActiveCfg = Release|Win32 {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal ]]) end premake-4.3-src+repack1/tests/testfx.lua0000644000000000000000000001153411470465410017001 0ustar rootroot-- -- tests/testfx.lua -- Automated test framework for Premake. -- Copyright (c) 2008-2009 Jason Perkins and the Premake project -- -- -- Define a namespace for the testing functions -- test = { } -- -- Assertion functions -- function test.string_contains(buffer, expected) if not string.find(buffer,expected) then test.fail("\n==Fail==: Expected to find :\n%s\nyet it was not found in buffer:\n%s\n", expected,buffer) end end function test.string_does_not_contain(buffer, expected) if string.find(buffer,expected) then test.fail("\n==Fail==: Did not expected to find :\n%s\nyet it was found in buffer:\n%s\n", expected,buffer) end end function test.capture(expected) local actual = io.endcapture() local ait = actual:gfind("(.-)" .. io.eol) local eit = expected:gfind("(.-)\n") local linenum = 1 local atxt = ait() local etxt = eit() while etxt do if (etxt ~= atxt) then test.fail("(%d) expected:\n%s\n...but was:\n%s", linenum, etxt, atxt) end linenum = linenum + 1 atxt = ait() etxt = eit() end end function test.closedfile(expected) if expected and not test.value_closedfile then test.fail("expected file to be closed") elseif not expected and test.value_closedfile then test.fail("expected file to remain open") end end function test.contains(value, expected) if not table.contains(value, expected) then test.fail("expected value %s not found", expected) end end function test.fail(format, ...) -- convert nils into something more usefuls for i = 1, arg.n do if (arg[i] == nil) then arg[i] = "(nil)" elseif (type(arg[i]) == "table") then arg[i] = "{" .. table.concat(arg[i], ", ") .. "}" end end error(string.format(format, unpack(arg)), 3) end function test.filecontains(expected, fn) local f = io.open(fn) local actual = f:read("*a") f:close() if (expected ~= actual) then test.fail("expected %s but was %s", expected, actual) end end function test.isequal(expected, actual) if (type(expected) == "table") then for k,v in pairs(expected) do if not (test.isequal(expected[k], actual[k])) then test.fail("expected %s but was %s", expected, actual) end end else if (expected ~= actual) then test.fail("expected %s but was %s", expected, actual) end end return true end function test.isfalse(value) if (value) then test.fail("expected false but was true") end end function test.isnil(value) if (value ~= nil) then test.fail("expected nil but was " .. tostring(value)) end end function test.isnotnil(value) if (value == nil) then test.fail("expected not nil") end end function test.istrue(value) if (not value) then test.fail("expected true but was false") end end function test.openedfile(fname) if fname ~= test.value_openedfilename then local msg = "expected to open file '" .. fname .. "'" if test.value_openedfilename then msg = msg .. ", got '" .. test.value_openedfilename .. "'" end test.fail(msg) end end function test.success(fn, ...) local ok, err = pcall(fn, unpack(arg)) if not ok then test.fail("call failed: " .. err) end end -- -- Test stubs -- local function stub_io_open(fname, mode) test.value_openedfilename = fname test.value_openedfilemode = mode return { close = function() test.value_closedfile = true end } end local function stub_io_output(f) end local function stub_print(s) end -- -- Define a collection for the test suites -- T = { } -- -- Test execution function -- local function test_setup(suite, fn) -- clear out some important globals _ACTION = "test" _ARGS = { } _OPTIONS = { } premake.solution.list = { } -- reset captured I/O values test.value_openedfilename = nil test.value_openedfilemode = nil test.value_closedfile = false if suite.setup then return pcall(suite.setup) else return true end end local function test_run(suite, fn) return pcall(fn) end local function test_teardown(suite, fn) if suite.teardown then return pcall(suite.teardown) else return true end end function test.runall() test.print = print print = stub_print io.open = stub_io_open io.output = stub_io_output local numpassed = 0 local numfailed = 0 for suitename, suitetests in pairs(T) do for testname, testfunc in pairs(suitetests) do local ok, err = test_setup(suitetests, testfunc) if ok then ok, err = test_run(suitetests, testfunc) end local tok, terr = test_teardown(suitetests, testfunc) ok = ok and tok err = err or tok if (not ok) then test.print(string.format("%s.%s: %s", suitename, testname, err)) numfailed = numfailed + 1 else numpassed = numpassed + 1 end end end print = test.print return numpassed, numfailed end premake-4.3-src+repack1/tests/base/0000755000000000000000000000000011470465410015667 5ustar rootrootpremake-4.3-src+repack1/tests/base/test_action.lua0000644000000000000000000000252111470465410020706 0ustar rootroot-- -- tests/base/test_action.lua -- Automated test suite for the action list. -- Copyright (c) 2009 Jason Perkins and the Premake project -- T.action = { } -- -- Setup/teardown -- local fake = { trigger = "fake", description = "Fake action used for testing", } function T.action.setup() premake.action.list["fake"] = fake solution "MySolution" configurations "Debug" project "MyProject" premake.buildconfigs() end function T.action.teardown() premake.action.list["fake"] = nil end -- -- Tests for call() -- function T.action.CallCallsExecuteIfPresent() local called = false fake.execute = function () called = true end premake.action.call("fake") test.istrue(called) end function T.action.CallCallsOnSolutionIfPresent() local called = false fake.onsolution = function () called = true end premake.action.call("fake") test.istrue(called) end function T.action.CallCallsOnProjectIfPresent() local called = false fake.onproject = function () called = true end premake.action.call("fake") test.istrue(called) end function T.action.CallSkipsCallbacksIfNotPresent() test.success(premake.action.call, "fake") end -- -- Tests for set() -- function T.action.set_SetsActionOS() local oldos = _OS _OS = "linux" premake.action.set("vs2008") test.isequal(_OS, "windows") _OS = oldos end premake-4.3-src+repack1/tests/base/test_os.lua0000644000000000000000000000556411470465410020064 0ustar rootroot-- -- tests/base/test_os.lua -- Automated test suite for the new OS functions. -- Copyright (c) 2008-2010 Jason Perkins and the Premake project -- T.os = { } local suite = T.os -- -- os.findlib() tests -- function suite.findlib_FindSystemLib() local libname = iif(os.is("windows"), "user32", "m") test.istrue(os.findlib(libname)) end function suite.findlib_FailsOnBadLibName() test.isfalse(os.findlib("NoSuchLibraryAsThisOneHere")) end -- -- os.isfile() tests -- function suite.isfile_ReturnsTrue_OnExistingFile() test.istrue(os.isfile("premake4.lua")) end function suite.isfile_ReturnsFalse_OnNonexistantFile() test.isfalse(os.isfile("no_such_file.lua")) end -- -- os.matchfiles() tests -- function suite.matchfiles_OnNonRecursive() local result = os.matchfiles("*.lua") test.istrue(table.contains(result, "testfx.lua")) test.isfalse(table.contains(result, "folder/ok.lua")) end function suite.matchfiles_Recursive() local result = os.matchfiles("**.lua") test.istrue(table.contains(result, "folder/ok.lua")) end function suite.matchfiles_SkipsDotDirs_OnRecursive() local result = os.matchfiles("**.lua") test.isfalse(table.contains(result, ".svn/text-base/testfx.lua.svn-base")) end function suite.matchfiles_OnSubfolderMatch() local result = os.matchfiles("**/xcode/*") test.istrue(table.contains(result, "actions/xcode/test_xcode_project.lua")) test.isfalse(table.contains(result, "premake4.lua")) end function suite.matchfiles_OnDotSlashPrefix() local result = os.matchfiles("./**.lua") test.istrue(table.contains(result, "folder/ok.lua")) end function suite.matchfiles_OnImplicitEndOfString() local result = os.matchfiles("folder/*.lua") test.istrue(table.contains(result, "folder/ok.lua")) test.isfalse(table.contains(result, "folder/ok.lua.2")) end function suite.matchfiles_OnLeadingDotSlashWithPath() local result = os.matchfiles("./folder/*.lua") test.istrue(table.contains(result, "folder/ok.lua")) end -- -- os.pathsearch() tests -- function suite.pathsearch_ReturnsNil_OnNotFound() test.istrue( os.pathsearch("nosuchfile", "aaa;bbb;ccc") == nil ) end function suite.pathsearch_ReturnsPath_OnFound() test.isequal(os.getcwd(), os.pathsearch("premake4.lua", os.getcwd())) end function suite.pathsearch_FindsFile_OnComplexPath() test.isequal(os.getcwd(), os.pathsearch("premake4.lua", "aaa;"..os.getcwd()..";bbb")) end function suite.pathsearch_NilPathsAllowed() test.isequal(os.getcwd(), os.pathsearch("premake4.lua", nil, os.getcwd(), nil)) end -- -- os.uuid() tests -- function suite.guid_ReturnsValidUUID() local g = os.uuid() test.istrue(#g == 36) for i=1,36 do local ch = g:sub(i,i) test.istrue(ch:find("[ABCDEF0123456789-]")) end test.isequal("-", g:sub(9,9)) test.isequal("-", g:sub(14,14)) test.isequal("-", g:sub(19,19)) test.isequal("-", g:sub(24,24)) end premake-4.3-src+repack1/tests/base/test_api.lua0000644000000000000000000002220511470465410020203 0ustar rootroot-- -- tests/base/test_api.lua -- Automated test suite for the project API support functions. -- Copyright (c) 2008-2010 Jason Perkins and the Premake project -- T.api = { } local suite = T.api local sln function suite.setup() sln = solution "MySolution" end -- -- premake.getobject() tests -- function suite.getobject_RaisesError_OnNoContainer() premake.CurrentContainer = nil c, err = premake.getobject("container") test.istrue(c == nil) test.isequal("no active solution or project", err) end function suite.getobject_RaisesError_OnNoActiveSolution() premake.CurrentContainer = { } c, err = premake.getobject("solution") test.istrue(c == nil) test.isequal("no active solution", err) end function suite.getobject_RaisesError_OnNoActiveConfig() premake.CurrentConfiguration = nil c, err = premake.getobject("config") test.istrue(c == nil) test.isequal("no active solution, project, or configuration", err) end -- -- premake.setarray() tests -- function suite.setarray_Inserts_OnStringValue() premake.CurrentConfiguration = { } premake.CurrentConfiguration.myfield = { } premake.setarray("config", "myfield", "hello") test.isequal("hello", premake.CurrentConfiguration.myfield[1]) end function suite.setarray_Inserts_OnTableValue() premake.CurrentConfiguration = { } premake.CurrentConfiguration.myfield = { } premake.setarray("config", "myfield", { "hello", "goodbye" }) test.isequal("hello", premake.CurrentConfiguration.myfield[1]) test.isequal("goodbye", premake.CurrentConfiguration.myfield[2]) end function suite.setarray_Appends_OnNewValues() premake.CurrentConfiguration = { } premake.CurrentConfiguration.myfield = { "hello" } premake.setarray("config", "myfield", "goodbye") test.isequal("hello", premake.CurrentConfiguration.myfield[1]) test.isequal("goodbye", premake.CurrentConfiguration.myfield[2]) end function suite.setarray_FlattensTables() premake.CurrentConfiguration = { } premake.CurrentConfiguration.myfield = { } premake.setarray("config", "myfield", { {"hello"}, {"goodbye"} }) test.isequal("hello", premake.CurrentConfiguration.myfield[1]) test.isequal("goodbye", premake.CurrentConfiguration.myfield[2]) end function suite.setarray_RaisesError_OnInvalidValue() premake.CurrentConfiguration = { } premake.CurrentConfiguration.myfield = { } ok, err = pcall(function () premake.setarray("config", "myfield", "bad", { "Good", "Better", "Best" }) end) test.isfalse(ok) end function suite.setarray_CorrectsCase_OnConstrainedValue() premake.CurrentConfiguration = { } premake.CurrentConfiguration.myfield = { } premake.setarray("config", "myfield", "better", { "Good", "Better", "Best" }) test.isequal("Better", premake.CurrentConfiguration.myfield[1]) end -- -- premake.setstring() tests -- function suite.setstring_Sets_OnNewProperty() premake.CurrentConfiguration = { } premake.setstring("config", "myfield", "hello") test.isequal("hello", premake.CurrentConfiguration.myfield) end function suite.setstring_Overwrites_OnExistingProperty() premake.CurrentConfiguration = { } premake.CurrentConfiguration.myfield = "hello" premake.setstring("config", "myfield", "goodbye") test.isequal("goodbye", premake.CurrentConfiguration.myfield) end function suite.setstring_RaisesError_OnInvalidValue() premake.CurrentConfiguration = { } ok, err = pcall(function () premake.setstring("config", "myfield", "bad", { "Good", "Better", "Best" }) end) test.isfalse(ok) end function suite.setstring_CorrectsCase_OnConstrainedValue() premake.CurrentConfiguration = { } premake.setstring("config", "myfield", "better", { "Good", "Better", "Best" }) test.isequal("Better", premake.CurrentConfiguration.myfield) end -- -- accessor tests -- function suite.accessor_CanRetrieveString() sln.blocks[1].kind = "ConsoleApp" test.isequal("ConsoleApp", kind()) end -- -- solution() tests -- function suite.solution_SetsCurrentContainer_OnName() test.istrue(sln == premake.CurrentContainer) end function suite.solution_CreatesNewObject_OnNewName() solution "MySolution2" test.isfalse(sln == premake.CurrentContainer) end function suite.solution_ReturnsPrevious_OnExistingName() solution "MySolution2" local sln2 = solution "MySolution" test.istrue(sln == sln2) end function suite.solution_SetsCurrentContainer_OnExistingName() solution "MySolution2" solution "MySolution" test.istrue(sln == premake.CurrentContainer) end function suite.solution_ReturnsNil_OnNoActiveSolutionAndNoName() premake.CurrentContainer = nil test.isnil(solution()) end function suite.solution_ReturnsCurrentSolution_OnActiveSolutionAndNoName() test.istrue(sln == solution()) end function suite.solution_ReturnsCurrentSolution_OnActiveProjectAndNoName() project "MyProject" test.istrue(sln == solution()) end function suite.solution_LeavesProjectActive_OnActiveProjectAndNoName() local prj = project "MyProject" solution() test.istrue(prj == premake.CurrentContainer) end function suite.solution_LeavesConfigActive_OnActiveSolutionAndNoName() local cfg = configuration "windows" solution() test.istrue(cfg == premake.CurrentConfiguration) end function suite.solution_LeavesConfigActive_OnActiveProjectAndNoName() project "MyProject" local cfg = configuration "windows" solution() test.istrue(cfg == premake.CurrentConfiguration) end function suite.solution_SetsName_OnNewName() test.isequal("MySolution", sln.name) end function suite.solution_AddsNewConfig_OnNewName() test.istrue(#sln.blocks == 1) end function suite.solution_AddsNewConfig_OnName() local num = #sln.blocks solution "MySolution" test.istrue(#sln.blocks == num + 1) end -- -- configuration() tests -- function suite.configuration_RaisesError_OnNoContainer() premake.CurrentContainer = nil local fn = function() configuration{"Debug"} end ok, err = pcall(fn) test.isfalse(ok) end function suite.configuration_SetsCurrentConfiguration_OnKeywords() local cfg = configuration {"Debug"} test.istrue(premake.CurrentConfiguration == cfg) end function suite.configuration_AddsToContainer_OnKeywords() local cfg = configuration {"Debug"} test.istrue(cfg == sln.blocks[#sln.blocks]) end function suite.configuration_ReturnsCurrent_OnNoKeywords() local cfg = configuration() test.istrue(cfg == sln.blocks[1]) end function suite.configuration_SetsTerms() local cfg = configuration {"aa", "bb"} test.isequal({"aa", "bb"}, cfg.terms) end function suite.configuration_SetsTermsWithNestedTables() local cfg = configuration { {"aa", "bb"}, "cc" } test.isequal({"aa", "bb", "cc"}, cfg.terms) end function suite.configuration_CanReuseTerms() local cfg = configuration { "aa", "bb" } local cfg2 = configuration { cfg.terms, "cc" } test.isequal({"aa", "bb", "cc"}, cfg2.terms) end -- -- project() tests -- function suite.project_RaisesError_OnNoSolution() premake.CurrentContainer = nil local fn = function() project("MyProject") end ok, err = pcall(fn) test.isfalse(ok) end function suite.project_SetsCurrentContainer_OnName() local prj = project "MyProject" test.istrue(prj == premake.CurrentContainer) end function suite.project_CreatesNewObject_OnNewName() local prj = project "MyProject" local pr2 = project "MyProject2" test.isfalse(prj == premake.CurrentContainer) end function suite.project_AddsToSolution_OnNewName() local prj = project "MyProject" test.istrue(prj == sln.projects[1]) end function suite.project_ReturnsPrevious_OnExistingName() local prj = project "MyProject" local pr2 = project "MyProject2" local pr3 = project "MyProject" test.istrue(prj == pr3) end function suite.project_SetsCurrentContainer_OnExistingName() local prj = project "MyProject" local pr2 = project "MyProject2" local pr3 = project "MyProject" test.istrue(prj == premake.CurrentContainer) end function suite.project_ReturnsNil_OnNoActiveProjectAndNoName() test.isnil(project()) end function suite.project_ReturnsCurrentProject_OnActiveProjectAndNoName() local prj = project "MyProject" test.istrue(prj == project()) end function suite.project_LeavesProjectActive_OnActiveProjectAndNoName() local prj = project "MyProject" project() test.istrue(prj == premake.CurrentContainer) end function suite.project_LeavesConfigActive_OnActiveProjectAndNoName() local prj = project "MyProject" local cfg = configuration "Windows" project() test.istrue(cfg == premake.CurrentConfiguration) end function suite.project_SetsName_OnNewName() prj = project("MyProject") test.isequal("MyProject", prj.name) end function suite.project_SetsSolution_OnNewName() prj = project("MyProject") test.istrue(sln == prj.solution) end function suite.project_SetsConfiguration() prj = project("MyProject") test.istrue(premake.CurrentConfiguration == prj.blocks[1]) end function suite.project_SetsUUID() local prj = project "MyProject" test.istrue(prj.uuid) end -- -- uuid() tests -- function suite.uuid_makes_uppercase() premake.CurrentContainer = {} uuid "7CBB5FC2-7449-497f-947F-129C5129B1FB" test.isequal(premake.CurrentContainer.uuid, "7CBB5FC2-7449-497F-947F-129C5129B1FB") end premake-4.3-src+repack1/tests/base/test_config.lua0000644000000000000000000000225511470465410020702 0ustar rootroot-- -- tests/test_config.lua -- Automated test suite for the configuration handling functions. -- Copyright (c) 2010 Jason Perkins and the Premake project -- T.config = { } local suite = T.config -- -- Setup/Teardown -- function suite.setup() sln = test.createsolution() end local cfg local function prepare() io.capture() premake.buildconfigs() cfg = premake.solution.getproject(sln, 1) end -- -- Debug/Release build testing -- function suite.IsDebug_ReturnsFalse_OnOptimizeFlag() flags { "Optimize" } prepare() return test.isfalse(premake.config.isdebugbuild(cfg)) end function suite.IsDebug_ReturnsFalse_OnOptimizeSizeFlag() flags { "OptimizeSize" } prepare() return test.isfalse(premake.config.isdebugbuild(cfg)) end function suite.IsDebug_ReturnsFalse_OnOptimizeSpeedFlag() flags { "OptimizeSpeed" } prepare() return test.isfalse(premake.config.isdebugbuild(cfg)) end function suite.IsDebug_ReturnsFalse_OnNoSymbolsFlag() prepare() return test.isfalse(premake.config.isdebugbuild(cfg)) end function suite.IsDebug_ReturnsTrue_OnSymbolsFlag() flags { "Symbols" } prepare() return test.istrue(premake.config.isdebugbuild(cfg)) end premake-4.3-src+repack1/tests/base/test_path.lua0000644000000000000000000001232011470465410020363 0ustar rootroot-- -- tests/base/test_path.lua -- Automated test suite for the action list. -- Copyright (c) 2008-2010 Jason Perkins and the Premake project -- T.path = { } local suite = T.path -- -- path.getabsolute() tests -- function suite.getabsolute_ReturnsCorrectPath_OnMissingSubdir() local expected = path.translate(os.getcwd(), "/") .. "/a/b/c" test.isequal(expected, path.getabsolute("a/b/c")) end function suite.getabsolute_RemovesDotDots_OnWindowsAbsolute() test.isequal("c:/ProjectB/bin", path.getabsolute("c:/ProjectA/../ProjectB/bin")) end function suite.getabsolute_RemovesDotDots_OnPosixAbsolute() test.isequal("/ProjectB/bin", path.getabsolute("/ProjectA/../ProjectB/bin")) end function suite.getabsolute_OnTrailingSlash() local expected = path.translate(os.getcwd(), "/") .. "/a/b/c" test.isequal(expected, path.getabsolute("a/b/c/")) end -- -- path.getbasename() tests -- function suite.getbasename_ReturnsCorrectName_OnDirAndExtension() test.isequal("filename", path.getbasename("folder/filename.ext")) end -- -- path.getdirectory() tests -- function suite.getdirectory_ReturnsEmptyString_OnNoDirectory() test.isequal(".", path.getdirectory("filename.ext")) end function suite.getdirectory_ReturnsDirectory_OnSingleLevelPath() test.isequal("dir0", path.getdirectory("dir0/filename.ext")) end function suite.getdirectory_ReturnsDirectory_OnMultiLeveLPath() test.isequal("dir0/dir1/dir2", path.getdirectory("dir0/dir1/dir2/filename.ext")) end function suite.getdirectory_ReturnsRootPath_OnRootPathOnly() test.isequal("/", path.getdirectory("/filename.ext")) end -- -- path.getdrive() tests -- function suite.getdrive_ReturnsNil_OnNotWindows() test.isnil(path.getdrive("/hello")) end function suite.getdrive_ReturnsLetter_OnWindowsAbsolute() test.isequal("x", path.getdrive("x:/hello")) end -- -- path.getextension() tests -- function suite.getextension_ReturnsEmptyString_OnNoExtension() test.isequal("", path.getextension("filename")) end function suite.getextension_ReturnsExtension() test.isequal(".txt", path.getextension("filename.txt")) end function suite.getextension_OnMultipleDots() test.isequal(".txt", path.getextension("filename.mod.txt")) end -- -- path.getrelative() tests -- function suite.getrelative_ReturnsDot_OnMatchingPaths() test.isequal(".", path.getrelative("/a/b/c", "/a/b/c")) end function suite.getrelative_ReturnsDoubleDot_OnChildToParent() test.isequal("..", path.getrelative("/a/b/c", "/a/b")) end function suite.getrelative_ReturnsDoubleDot_OnSiblingToSibling() test.isequal("../d", path.getrelative("/a/b/c", "/a/b/d")) end function suite.getrelative_ReturnsChildPath_OnParentToChild() test.isequal("d", path.getrelative("/a/b/c", "/a/b/c/d")) end function suite.getrelative_ReturnsChildPath_OnWindowsAbsolute() test.isequal("obj/debug", path.getrelative("C:/Code/Premake4", "C:/Code/Premake4/obj/debug")) end function suite.getrelative_ReturnsAbsPath_OnDifferentDriveLetters() test.isequal("D:/Files", path.getrelative("C:/Code/Premake4", "D:/Files")) end function suite.getrelative_ReturnsAbsPath_OnDollarMacro() test.isequal("$(SDK_HOME)/include", path.getrelative("C:/Code/Premake4", "$(SDK_HOME)/include")) end function suite.getrelative_ReturnsAbsPath_OnRootedPath() test.isequal("/opt/include", path.getrelative("/home/me/src/project", "/opt/include")) end -- -- path.isabsolute() tests -- function suite.isabsolute_ReturnsTrue_OnAbsolutePosixPath() test.istrue(path.isabsolute("/a/b/c")) end function suite.isabsolute_ReturnsTrue_OnAbsoluteWindowsPathWithDrive() test.istrue(path.isabsolute("C:/a/b/c")) end function suite.isabsolute_ReturnsFalse_OnRelativePath() test.isfalse(path.isabsolute("a/b/c")) end function suite.isabsolute_ReturnsTrue_OnDollarSign() test.istrue(path.isabsolute("$(SDK_HOME)/include")) end -- -- path.join() tests -- function suite.join_OnValidParts() test.isequal("leading/trailing", path.join("leading", "trailing")) end function suite.join_OnAbsoluteUnixPath() test.isequal("/trailing", path.join("leading", "/trailing")) end function suite.join_OnAbsoluteWindowsPath() test.isequal("C:/trailing", path.join("leading", "C:/trailing")) end function suite.join_OnCurrentDirectory() test.isequal("trailing", path.join(".", "trailing")) end -- -- path.rebase() tests -- function suite.rebase_WithEndingSlashOnPath() local cwd = os.getcwd() test.isequal("src", path.rebase("../src/", cwd, path.getdirectory(cwd))) end -- -- path.translate() tests -- function suite.translate_ReturnsTranslatedPath_OnValidPath() test.isequal("dir/dir/file", path.translate("dir\\dir\\file", "/")) end function suite.translate_ReturnsCorrectSeparator_OnMixedPath() local actual = path.translate("dir\\dir/file") if (os.is("windows")) then test.isequal("dir\\dir\\file", actual) else test.isequal("dir/dir/file", actual) end end -- -- path.wildcards tests -- function suite.wildcards_MatchesTrailingStar() local p = path.wildcards("**/xcode/*") test.isequal(".*/xcode/[^/]*", p) end function suite.wildcards_MatchPlusSign() local patt = path.wildcards("file+name.*") local name = "file+name.c" test.isequal(name, name:match(patt)) end premake-4.3-src+repack1/tests/base/test_tree.lua0000644000000000000000000000534211470465410020374 0ustar rootroot-- -- tests/base/test_tree.lua -- Automated test suite source code tree handling. -- Copyright (c) 2009 Jason Perkins and the Premake project -- T.tree = { } local suite = T.tree local tree = premake.tree -- -- Setup/teardown -- local tr, nodes function suite.setup() tr = tree.new() nodes = { } end local function getresult() tree.traverse(tr, { onnode = function(node, depth) table.insert(nodes, string.rep(">", depth) .. node.name) end }) return table.concat(nodes) end -- -- Tests for tree.new() -- function suite.NewReturnsObject() test.isnotnil(tr) end -- -- Tests for tree.add() -- function suite.CanAddAtRoot() tree.add(tr, "Root") test.isequal("Root", getresult()) end function suite.CanAddAtChild() tree.add(tr, "Root/Child") test.isequal("Root>Child", getresult()) end function suite.CanAddAtGrandchild() tree.add(tr, "Root/Child/Grandchild") test.isequal("Root>Child>>Grandchild", getresult()) end function suite.SkipsLeadingDotDots() tree.add(tr, "../MyProject/hello") test.isequal("MyProject>hello", getresult()) end function suite.SkipsInlineDotDots() tree.add(tr, "MyProject/../hello") test.isequal("MyProject>hello", getresult()) end function suite.AddsNodes_OnDifferentParentLevel() tree.add(tr, "../Common") tree.add(tr, "../../Common") test.isequal(2, #tr.children) test.isequal("Common", tr.children[1].name) test.isequal("Common", tr.children[2].name) test.isequal("../Common", tr.children[1].path) test.isequal("../../Common", tr.children[2].path) end -- -- Tests for tree.getlocalpath() -- function suite.GetLocalPath_ReturnsPath_OnNoParentPath() local c = tree.add(tr, "Root/Child") c.parent.path = nil test.isequal("Root/Child", tree.getlocalpath(c)) end function suite.GetLocalPath_ReturnsName_OnParentPathSet() local c = tree.add(tr, "Root/Child") test.isequal("Child", tree.getlocalpath(c)) end -- -- Tests for tree.remove() -- function suite.Remove_RemovesNodes() local n1 = tree.add(tr, "1") local n2 = tree.add(tr, "2") local n3 = tree.add(tr, "3") tree.remove(n2) local r = "" for _, n in ipairs(tr.children) do r = r .. n.name end test.isequal("13", r) end function suite.Remove_WorksInTraversal() tree.add(tr, "Root/1") tree.add(tr, "Root/2") tree.add(tr, "Root/3") local r = "" tree.traverse(tr, { onleaf = function(node) r = r .. node.name tree.remove(node) end }) test.isequal("123", r) test.isequal(0, #tr.children[1]) end -- -- Tests for tree.sort() -- function suite.Sort_SortsAllLevels() tree.add(tr, "B/3") tree.add(tr, "B/1") tree.add(tr, "A/2") tree.add(tr, "A/1") tree.add(tr, "B/2") tree.sort(tr) test.isequal("A>1>2B>1>2>3", getresult(tr)) end premake-4.3-src+repack1/tests/base/test_table.lua0000644000000000000000000000201311470465410020514 0ustar rootroot-- -- tests/base/test_table.lua -- Automated test suite for the new table functions. -- Copyright (c) 2008-2010 Jason Perkins and the Premake project -- T.table = { } local suite = T.table -- -- table.contains() tests -- function suite.contains_OnContained() t = { "one", "two", "three" } test.istrue( table.contains(t, "two") ) end function suite.contains_OnNotContained() t = { "one", "two", "three" } test.isfalse( table.contains(t, "four") ) end -- -- table.flatten() tests -- function suite.flatten_OnMixedValues() t = { "a", { "b", "c" }, "d" } test.isequal({ "a", "b", "c", "d" }, table.flatten(t)) end -- -- table.implode() tests -- function suite.implode() t = { "one", "two", "three", "four" } test.isequal("[one], [two], [three], [four]", table.implode(t, "[", "]", ", ")) end -- -- table.isempty() tests -- function suite.isempty_ReturnsTrueOnEmpty() test.istrue(table.isempty({})) end function suite.isempty_ReturnsFalseOnNotEmpty() test.isfalse(table.isempty({ 1 })) end premake-4.3-src+repack1/tests/base/test_baking.lua0000644000000000000000000000652111470465410020670 0ustar rootroot-- -- tests/test_baking.lua -- Automated test suite for the configuration baking functions. -- Copyright (c) 2009, 2010 Jason Perkins and the Premake project -- T.baking = { } local suite = T.baking -- -- Setup code -- local prj, cfg function suite.setup() _ACTION = "gmake" solution "MySolution" configurations { "Debug", "Release" } platforms { "x32", "ps3" } defines "SOLUTION" configuration "Debug" defines "SOLUTION_DEBUG" prj = project "MyProject" language "C" kind "SharedLib" targetdir "../bin" defines "PROJECT" configuration "Debug" defines "DEBUG" configuration "Release" defines "RELEASE" configuration "native" defines "NATIVE" configuration "x32" defines "X86_32" configuration "x64" defines "X86_64" end local function prepare() premake.buildconfigs() prj = premake.getconfig(prj) cfg = premake.getconfig(prj, "Debug") end -- -- Tests -- function suite.SolutionFields() prepare() test.isequal("Debug:Release", table.concat(cfg.configurations,":")) end function suite.ProjectFields() prepare() test.isequal("C", cfg.language) end function suite.ProjectWideSettings() prepare() test.isequal("SOLUTION:PROJECT:NATIVE", table.concat(prj.defines,":")) end function suite.BuildCfgSettings() prepare() test.isequal("SOLUTION:SOLUTION_DEBUG:PROJECT:DEBUG:NATIVE", table.concat(cfg.defines,":")) end function suite.PlatformSettings() prepare() local cfg = premake.getconfig(prj, "Debug", "x32") test.isequal("SOLUTION:SOLUTION_DEBUG:PROJECT:DEBUG:X86_32", table.concat(cfg.defines,":")) end function suite.SetsConfigName() prepare() local cfg = premake.getconfig(prj, "Debug", "x32") test.isequal("Debug", cfg.name) end function suite.SetsPlatformName() prepare() local cfg = premake.getconfig(prj, "Debug", "x32") test.isequal("x32", cfg.platform) end function suite.SetsPlatformNativeName() test.isequal("Native", cfg.platform) end function suite.SetsShortName() prepare() local cfg = premake.getconfig(prj, "Debug", "x32") test.isequal("debug32", cfg.shortname) end function suite.SetsNativeShortName() prepare() test.isequal("debug", cfg.shortname) end function suite.SetsLongName() prepare() local cfg = premake.getconfig(prj, "Debug", "x32") test.isequal("Debug|x32", cfg.longname) end function suite.SetsNativeLongName() prepare() test.isequal("Debug", cfg.longname) end function suite.SetsProject() prepare() local cfg = premake.getconfig(prj, "Debug", "x32") test.istrue(prj.project == cfg.project) end -- -- Target system testing -- function suite.SetsTargetSystem_OnNative() prepare() test.isequal(os.get(), cfg.system) end function suite.SetTargetSystem_OnCrossCompiler() prepare() local cfg = premake.getconfig(prj, "Debug", "PS3") test.isequal("PS3", cfg.system) end -- -- Configuration-specific kinds -- function suite.SetsConfigSpecificKind() configuration "Debug" kind "ConsoleApp" prepare() test.isequal("ConsoleApp", cfg.kind) end -- -- Platform kind translation -- function suite.SetsTargetKind_OnSupportedKind() prepare() test.isequal("SharedLib", cfg.kind) end function suite.SetsTargetKind_OnUnsupportedKind() prepare() local cfg = premake.getconfig(prj, "Debug", "PS3") test.isequal("StaticLib", cfg.kind) end premake-4.3-src+repack1/BUILD.txt0000644000000000000000000000625211470465410015220 0ustar rootrootPREMAKE BUILD INSTRUCTIONS As of version 4.0, Premake is written in a mix of C and Lua. This mix enables many new features, but it makes building Premake a bit more complicated. If you downloaded a source code package from SourceForge, you will find project files for all of the currently supported toolsets in the build/ directory. Build the release configuration (the default for the makefiles) and you will find the executable in bin/release ready to go. If you want to use a debug build instead, or if you downloaded the source code from Subversion instead of a SourceForge release, read the next section for more information on working with the scripts. If you find all of this very confusing and need some help, see the end of this document for contact information. I'll be glad to help. GENERATING THE PROJECT FILES If you downloaded a source code package from SourceForge, the project files are already included (in build/) and you can skip ahead to the next section. If you downloaded the sources from Subversion, you'll need to generate new projects files before you can build. In order to generate the project files, you need to have a working version of Premake 4.x installed on your system. You can get it as a source code (with project files ready to build) or a prebuilt binary from the SourceForge download page. Once you have a working Premake 4.x installed, use it to generate the project files. Type a command like: premake4 gmake -- for GNU makefiles using GCC premake4 vs2005 -- for a Visual Studio 2005 solution Use the "--help" option to see all of the available targets. RELEASE AND DEBUG BUILDS Premake can be built in either "release" or "debug" modes. You can choose which configuration to build with the "config" argument: make config=debug -- build in debug mode make config=release -- build in release mode (IDEs like Visual Studio provide their own mechanism for switching build configurations). In release mode (the default) you can build and run Premake like any other C application. In debug mode, Premake reads the Lua scripts from the disk at runtime, enabling compile-less code/test iterations. But it needs some help to find the scripts. You can specify the location of the scripts in one of two ways: using the /scripts command line argument, like so: premake4 /scripts=~/Code/premake4/src gmake Or by setting a PREMAKE_PATH environment variable. PREMAKE_PATH=~/Code/premake4/src As you can see, you need to specify the location of the Premake "src" directory, the one containing "_premake_main.lua". EMBEDDING SCRIPTS If you make changes to the core Lua scripts, you can integrate them into the release build using the "embed" command: premake4 embed This command embeds all of the scripts listed in _manifest.lua into src/host/scripts.c as static strings. The next release build will include the updated scripts. CONFUSED? I'll be glad to help you out. Stop by the main project website where you can leave a note in the forums (the preferred approach), join the mailing list, or contact me directly. http://industriousone.com/premake Enjoy! premake-4.3-src+repack1/LICENSE.txt0000644000000000000000000000300711470465410015436 0ustar rootrootCopyright (c) 2003-2010 Jason Perkins and individual contributors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the Premake nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. premake-4.3-src+repack1/doxyfile0000644000000000000000000002256011470465410015366 0ustar rootroot# Doxyfile 1.5.1-p1 #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = "Premake Internals" PROJECT_NUMBER = OUTPUT_DIRECTORY = doc CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES ABBREVIATE_BRIEF = "The $name class" \ "The $name widget" \ "The $name file" \ is \ provides \ specifies \ contains \ represents \ a \ an \ the ALWAYS_DETAILED_SEC = YES INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = NO STRIP_FROM_PATH = "" STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO DETAILS_AT_TOP = NO INHERIT_DOCS = YES SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 4 ALIASES = OPTIMIZE_OUTPUT_FOR_C = YES OPTIMIZE_OUTPUT_JAVA = NO BUILTIN_STL_SUPPORT = NO DISTRIBUTE_GROUP_DOC = NO SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- EXTRACT_ALL = NO EXTRACT_PRIVATE = NO EXTRACT_STATIC = NO EXTRACT_LOCAL_CLASSES = YES EXTRACT_LOCAL_METHODS = NO HIDE_UNDOC_MEMBERS = YES HIDE_UNDOC_CLASSES = YES HIDE_FRIEND_COMPOUNDS = NO HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO CASE_SENSE_NAMES = NO HIDE_SCOPE_NAMES = NO SHOW_INCLUDE_FILES = YES INLINE_INFO = YES SORT_MEMBER_DOCS = YES SORT_BRIEF_DOCS = NO SORT_BY_SCOPE_NAME = NO GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES GENERATE_DEPRECATEDLIST= YES ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = YES SHOW_DIRECTORIES = NO FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = YES WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = src FILE_PATTERNS = *.c \ *.cc \ *.cxx \ *.cpp \ *.c++ \ *.d \ *.java \ *.ii \ *.ixx \ *.ipp \ *.i++ \ *.inl \ *.h \ *.hh \ *.hxx \ *.hpp \ *.h++ \ *.idl \ *.odl \ *.cs \ *.php \ *.php3 \ *.inc \ *.m \ *.mm \ *.dox \ *.py RECURSIVE = YES EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = */UnitTest++/* */lua-5.1.1/* EXAMPLE_PATH = EXAMPLE_PATTERNS = * EXAMPLE_RECURSIVE = NO IMAGE_PATH = INPUT_FILTER = FILTER_PATTERNS = FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = NO INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = NO REFERENCES_RELATION = NO REFERENCES_LINK_SOURCE = YES USE_HTAGS = NO VERBATIM_HEADERS = NO #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = NO COLS_IN_ALPHA_INDEX = 5 IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = html HTML_FILE_EXTENSION = .html HTML_HEADER = HTML_FOOTER = HTML_STYLESHEET = HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO CHM_FILE = HHC_LOCATION = GENERATE_CHI = NO BINARY_TOC = NO TOC_EXPAND = NO DISABLE_INDEX = NO ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = NO TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = NO LATEX_OUTPUT = latex LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex COMPACT_LATEX = NO PAPER_TYPE = a4wide EXTRA_PACKAGES = LATEX_HEADER = PDF_HYPERLINKS = NO USE_PDFLATEX = NO LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf COMPACT_RTF = NO RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml XML_SCHEMA = XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO PERLMOD_PRETTY = YES PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES INCLUDE_PATH = INCLUDE_FILE_PATTERNS = PREDEFINED = EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = NO HIDE_UNDOC_RELATIONS = YES HAVE_DOT = NO CLASS_GRAPH = YES COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES UML_LOOK = NO TEMPLATE_RELATIONS = NO INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES CALL_GRAPH = NO CALLER_GRAPH = NO GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = png DOT_PATH = DOTFILE_DIRS = MAX_DOT_GRAPH_DEPTH = 1000 DOT_TRANSPARENT = NO DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = NO premake-4.3-src+repack1/CHANGES.txt0000644000000000000000000004155011470465410015431 0ustar rootroot------- 4.3 ------- * CHANGED LICENSE FROM GPLv2 TO BSD * Added Visual Studio 2010 C/C++ support (Liam Devine) * Added Solaris support (Dean Ross-Smith) * Added deployment and image options for Xbox360 (dvoid) * Patch 2963313: Enable setting .NET framework version (Justen Hyde) * Patch 2965229: Fix handling of '+' symbol in file patterns (Rachel Blum) * Patch 2997449: Print configuration with target (ergosys) * Patch 2997452: Suppress gmake's "nothing to be done" message (ergosys) * Patch 3011940: Add support for MFC (JTAnderson) * Patch 3053959: kind() crashes when called with no arguments (rjmyst3) * Bug 2997728: Project dependencies should be case-sensitive * Bug 3056381: Xcode project breaks on special chars * Bug 3007101: Generating PDB in Release builds is not supported * Bug 2971841: Gmake escaping of shell variable $(...) is broken * Fixed handling of icons in Xcode (bitshifter) * Added imagepath to set Xbox360 image file name (Jarod) * Patch 3063804: Set CompileAs flag for VS200x C projects (rjmyst3) * Implemented StaticRuntime flag for Xcode (William Burnson) * Improved portability of Mac OS X binaries (William Burnson) * Bug 3035545: The pattern { "./folder/*.c" } matches no files * Bug 3034222: StaticLib projects ignore linkoptions * Bug 3020382: GCC PCH not working * Bug 3016050: {"../Dir/file1.c","../../Dir/file2.c"} breaks Xcode (Stephane) * Bug 3015312: Makefiles are not quoted correctly * Bug 3097868: Removes relative paths from vs2010 filters (Robert Konrad) * Bug 3095274: Pre-compiled header support missing for VS2010 target * Bug 3100062: vs2010 Runtime library selection ------- 4.2.1 ------- * Feature 2944697: Add flag to disable Minimal Rebuild in Visual Studio * Patch 2928029: Add EnableSSE, EnableSSE2 flags * Patch 2936443: Expose configuration terms to scripts (Laurent Humbertclaude) * Bug 2928775: Error loading external Lua module with require() * Bug 2942438: Wrong runtime library linked * Bug 2931722: pchheader handling not consistent between tools * Bug 2958829: Files pattern matching including too many files * Bug 2953594: includedirs / libdirs converting absolute paths to relative * Bug 2936188: Improve handling for invalid values in lists ----- 4.2 ----- - Feature 1526976: Add support for Apple Xcode 3 - Feature 2900623: Add targetsuffix and implibsuffix properties - Added project kind to list of configuration filters - Feature 2839002: Add gcc switch to improve header dependency generation (Johannes Spohr) - Feature 2832906: Global variable (_SCRIPT) for current script path - Feature 2905303: Enable better folder matching in file lists - Feature 2919629: Add help target for makefiles - Feature 2820644: Add Xbox360 deployment and image options - Bug 2909463: Fix Xcode handling of Obj-C++ .mm files - Bug 2903430: Using relative instead of absolute paths with $() macro - Bug 2910691: Duplicate build options - Bug 2910639: Nil reference on dylib project dependency - Bug 2872066: Two test failures in 4.1.2 - Bug 2912756: dylibs missing lib prefix - Bug 2910202: Code::Blocks building C files as C++ - Bug 2926917: Use target name for Visual Studio PDB file - Bug 2927604: Unable to build Premake with Visual Studio - Clean action now removes MonoDevelop .pidb files correctly - Added os.executef() ------- 4.1.2 ------- - Fixed ManagedExtension setting for Visual Studio - Fixed os.match() bug for large result sets (David Raulo) - Patch 2840052: Order problem of static link - Patch 2802722: Floating Point Model Flags (Suigintou) - Patch 2865333: Support for ObjC and ObjC++ sources (Johannes Spohr) - Patch 2832852: Fix descriptions in cmd help (Sebastian Schuberth) - Patch 2832848: Show default script name in help (Sebastian Schuberth) ------- 4.1.1 ------- - Use libtool instead of ar for Mac OS X Universal static libraries - Fixed Xbox 360 linker settings in Visual Studio - Remove platform-specific intermediate objects on clean - Bug 2819232: Buildoptions not used when creating Makefile for C# - Bug 2813297: OS X universal config should be "univ" (William Burnson) - Bug 2814179: Xbox 360 precompiled headers not working ----- 4.1 ----- - Added support for cross-compiling target platforms - Added Xbox 360 support to Visual Studio 2005/2008 - Added Mac OS X universal binary support - Added Playstation 3 support - Added precompiled header support for GCC - Support links and libdirs for Visual Studio static libraries - Fail gracefully when list is assigned to string field - Changed GCC flags to -fno-exceptions and -fno-rtti - Improved performance of configuration building step - Fixed crash when configuration is missing a kind - Patch 2031626: Support for additional manifest files (Colin Graf) - Patch 2558089: workaround for --as-needed/correct link order (idl0r) - Patch 2609028: verbose linking in makefile (kaidokert) - Bug 2564404: FatalWarnings has no effect with gmake target - Bug 2550759: pchheader option has wrong type - Bug 1900333: Parentheses in build path - Bug 2790865: SharedLib on OSX fixes (Ash Berlin) - Bug 2790882: Trailing slash in path.getabsolute (Ash Berlin) RC2 -> RC3 - Bug 2805763: GCC PCH breaks on path - Bug 2709641: Location field does not propagate to projects - Bug 2675518: Dependencies wrong on config links - Bug 2152526: Code::Blocks doesn't build PCH correctly on GCC RC1 -> RC2 - Removed additional MonoDevelop files in clean action - Fixed naming of system libraries in Visual Studio link step - Set OS to Windows when generating for Visual Studio - Bug 2801257: Linker error LNK1112 when cross-compiling for x64 ----- 4.0 ----- This version is a complete rewrite of Premake. - A new, more readable and extensible syntax for projects - More robust syntax validation - A new command-line format, with better argument validation - Improved path handling across all project settings - Upgraded to Lua 5.1.4 - Many, many bug fixes RC4 -> Final - Set Mac OS X linker flags for Code::Blocks - Bug 2533504: Files above project root not added to project RC3 -> RC4 - Embed scripts instead of bytecodes to avoid portability issues - solution() and project() now only set the active object when called with a name; remains unchanged otherwise RC2 -> RC3 - Bug: GCC Windows release builds of Premake4 crash on script errors - Patched Lua to load precompiled bytecodes on PPC architectures. - Display paths of generated files RC1 -> RC2 - Enabled use of absolute Windows paths to different drive letter - Bug: Post-build commands run before build on Code::Blocks - Removed FatalWarnings build flag - Fixed GCC 4.2 warnings (Ryan Pusztai) - Enable Windows linking to shared libraries even with NoImportLib flag set (just in case) - Fixed handling of paths in links - Added "ToolsVersion" attribute to VS2005 and VS2008 C# projects - Fixed separator between library dependencies in C++ makefiles - Added missing os.copyfile() function - Bug: Sometimes takes a long time to complete on Linux - Enabled Lua popen support on Linux and Mac OS X ----- 3.7 ----- - Updated Lua to 5.1.3 - Added new CodeLite support target (Ryan Pusztai) - Added new cb-ow (Code::Blocks Open Watcom) target (Tim Channon) - Place OSX winexe's into Content/MacOS folder (William Burnson) - Sibling executables may now be listed in package.links - Bug 1520012: Improper Makefiles when filenames have spaces (Diaa Sami) - Bug 2045506: "no-exceptions" flag ignored for VS200x (Benoit Miller) - Bug 2034470: Error in cmd line error handler - Bug 2114152: package or config table isn't generated automatically ----- 3.6 ----- - Patch 1946122: Add support for VS2008 (Ryan Pusztai) - Patch 1913448: Win32 crash when using '--clean --usetargetpath' (David Walters) - Patch 1771168: luaL_getn speed optimization (Richard O'Grady) - Bug 1939089: Premake segfault on Linux/PPC (Fabio Till) - Fixed "bad argument #2 to 'chdir'" error - Disable -MMD on multiple -arch flags (poor man's Universal binary support) ----- 3.5 ----- - Prevent creation of import libraries on OS X - Improved handling of dylibs on OS X - Patch 1771977: Ability to compile C source as C++ in Code::Blocks (Ryan Pusztai) - Bug 1804810: out-implib not present in linux gnu compler toolchain - Bug 1806949: .Net reference paths are broken when bindir is specified - Bug 1806960: Make clean does not remove .mdb files - Bug 1831389: Makefiles stored in subdirs contain no targets on first run ----- 3.4 ----- - Added `no-pch` flag to suppress precompiled headers - Added App.config support to GNU makefiles - Add os.mkdir() to script environment - Makefile now creates target directory before copying .NET references - Feature 1520182: Enhanced file-handling functions - Bug 531878: Problems with relative paths - Bug 1723867: Config-specific post-build on GNU target (Benoit Miller) - Bug 1596826: XML targets doesn't escape xml entities - Bug 1600155: Core dump due to newpackage() and matchfiles() - Bug 1608895: resgen command shown - Bug 1639730: Output filename is not set - Bug 1729227: non-portable executable with relative library path - Bug 1559951: default clean rule removes package dir - Patch 1733674: PCH support for Code::Block targets (Ryan Pusztai) - Patch 1746563: Ability to specify GUID for VS targets (Ryan Pusztai) - Patch 1754867: Creating import lib of different name (Ryan Pusztai) ----- 3.3 ----- - Added support for prebuild, prelink, and postbuild commands - Added `target` global variable to script environment - Added build flag `no-edit-and-continue` - Added build flags `native-wchar` and `no-native-wchar` - Added build flag `no-manifest` - Added build flag `seh-exceptions` (VS2005 only) - Added `resdefines`, `respaths`, and `resoptions` - Added `prebuildcommands`, `prelinkcommands`, and `postbuildcommands` - Added `pchheader` and `pchsource` (Visual Studio only) - Feature 1337547: Package-level bindir and libdir - Bug 1565755: Generated makefiles do not work with MSYS - Bug 1587955: Target path ignored for libs - Bug 1574725: Static library extension for "gnu" target - Bug 1522861: Fixed by using "ar -rcs" instead of "ar -cr && ranlib" - Bug 1656816: Mkdir set wrong directory rights - Bug 1655595: Compile/build problem on FreeBSD - Bug: "gnu" clean rule doesn't work in cmd.exe - Improved behavior of Linux findlib() - Updated Code::Blocks support to latest project version (major="1" minor="6") - Patch 1681666: GNU targets always show the console if kind = 'winexe' ----- 3.2 ----- - Added support for Code::Blocks - Updated MonoDevelop support - Upgraded Lua to 5.0.3 - Added new matchdirs() to Lua script environment - Expose list of packages as _PACKAGES global in Lua - Turn off edit-and-continue in release builds with symbols - Bug 1559873: libpaths inserts extra space after -L ----- 3.1 ----- - Added support for Visual Studio 2005 - Added support for Windows resources to GNU make target - Added path handling functions to Lua environment - Added matchrecursive() for recursive file searches - Added os.fileexists() function to Lua environment - Added os.appendfile() function to Lua environment - Changed `monoresgen` to `resgen` to keep up with Mono project - Added `mono2` .NET compiler set for Mono .NET 2.0 support - Feature 1096677: exclude files from matchfiles (package.excludes) - Bug 1439463: VS2003 RTTI problem - Bug 1439446: GNU Makefile problem under Mingw32 - Bug 1422068: package.path="." causes bad makefiles - Bug 1431530: makefile target fails when project path specified ----- 3.0 ----- - Upgraded Lua interpreter to version 5.0.1 - The options table now stores simple values, rather than tables - Completed MonoDevelop support - Improved .NET resource handling for GNU generator - Added unit test suite - Merged Scott Graham unicode build flag patch - Removed package.warninglevel in favor of extra-warnings flag - Added package.targetprefix - Overhauled structure of generated GNU makefiles - Added --os command line option - Fixed bug 1268588: Use gcc to link C packages - Fixed bug 1363306: GNU C# should copy referenced DLLs ----- 2.4 ----- - Added chdir() to Lua script environment - Merged Thomas Harning's patch for .NET resources on GNU - Fixed bug 1194702: Can't put multiple packages in same directory - Fixed bug in GNU shared library builds (doh!) - Added target 'vs2002' to replace 'vs7' ----- 2.3 ----- - Added 'project.config[]' with 'bindir' and 'libdir' - Merged Scott Graham's "warninglevel" patch. - Fixed bug 1153484: Import lib in wrong directory. - Fixed bug 1013352: Stack overflow with large projects. - Fixed bug 945406: package.files, bad value = crash ----- 2.2 ----- - Worked around VS.NET bug for .NET assemblies > 64K. - Added --very-verbose flag to GNU generator. - GNU generator now supports assembly sources. ----- 2.1 ----- - File extension of generated binaries can now be set with config.targetextension. - Windows targets now handle .def files for DLLs. ----- 2.0 ----- - Can now specify build actions per file - Include paths are now passed to VC7 resource compiler - Removed _WIN32 define from Cygwin makefiles - Added package.objdir to set intermediates directory - Added rmdir() to Lua script environment - A big bag of bug fixes ----- 1.9 ----- - Made verbose mode even more verbose. - posix.c now builds properly as C. - Fixed package dependency generation for GNU and VS2003. - Display Lua version number in usage text. - Fixed VS link between *.aspx and *.aspx.cs files. - Fixed VS link between *.resx and *.cs files. - Fixed *.d file generation for gcc 2.9x. - Unified various help options under '--help'. - Bin and Lib paths can now be arbitrarily long. - linkoptions are now applied in VC6 and VC7 projects. ----- 1.8 ----- - Added support for ASP.NET projects. - Fixed a bug in VC6 support for static libraries. - matchfiles() now uses package path instead of script path. - Added --verbose option. - No longer apply no-rtti and no-exceptions to *.c files. ----- 1.7 ----- - Location of generated project files can now be specified with the project.path variable. - Inter-package dependencies are fixed for GNU makefiles. - No longer need to execute in same directory as project script. - Added "c" language specifier. - Added support for .resx and .config files to C# projects. - Added support for full assembly names in .NET references. - Fixed handling of paths in package.target variable. - Improved support for SharpDevelop. - Started support for OS X. - Added support for Digital Mars compiler. ------- 1.6.1 ------- - VS7 generator crashed if a package was built before one of its dependencies. Now immediately assigns UUID before processing. ----- 1.6 ----- - Added support for Visual Studio 2003 and SharpDevelop. - Added binaries directory as a reference path for VS7. ----- 1.5 ----- - Added initial support for building static libraries. - Added "no-main" flag, prevents overriding WinMain() on Windows builds. - Added "--no-rtti" and "no-exceptions" build flags to disable those C++ features. - Display error message when project has no packages. - Moved VC7 *.pdb files into intermediates directory. ----- 1.4 ----- - Bug fixes to the path manipulation routines. - GNU makefiles are regenerated when premake scripts change. ----- 1.3 ----- - Added support for the Cygwin environment. - Added "static-runtime" build flag to statically link against C/C++ standard runtime libraries. - Bug fixes to Visual Studio 6 and 7 generators and path reversing algorithm. ----- 1.2 ----- - Standardized format of command-line options. - Can now handle custom command-line options in script. - Added new function findlib(). - Added new C++ build flag "managed" for writing C++ .NET code. - Can now use open-source C# compilers in VS6 generator. - Several bug fixes to the VS7 generator. ----- 1.1 ----- - Added support for custom build configurations. Added "optimize", "optimize-size", "optimize-speed", and "no-symbols" flags to control build settings. - Added matchfiles() to select files using wildcards. - Added "unsafe" flag for C# projects. - Added newpackage() function for creating new package objects inline, instead of creating separate scripts. - Changed include() to dopackage() and option() to addoption(). The old versions have been kept for compatibility, but will be deprecated eventually. - Major cleanup of the source code. ----- 1.0 ----- - Fixed a bug related to the reference paths in VS7 C# projects. - Display a warning message if a reference path can't be found. - Automatically create bin and lib directories if they do not exist. - GNU C# projects will now properly use the configured library paths. ------- 0.9.2 ------- - Added --with-mono and --with-pnet options. - VS7 C# projects will now properly use the configured library paths. ------- 0.9.1 ------- - Switched to Lua (http://www.lua.org/) for project script parsing. - Add support for custom project options. - Changed 'type' to 'kind' to avoid conflict with Lua function of the same name. - Changed 'conexe' to 'exe' because I liked it better. - Changed 'library' to 'dll' for C# projects to keep things consistent. ------- 0.9.0 ------- - Initial public release. premake-4.3-src+repack1/README.txt0000644000000000000000000000065211470465410015314 0ustar rootrootPREMAKE A build configuration tool Copyright (C) 2002-2010 by Jason Perkins Distributed under the terms of the BSD License, see LICENSE.txt The Lua language and runtime library is (C) TeCGraf, PUC-Rio. See their website at http://www.lua.org/ See the file BUILD.txt for instructions on building Premake. For questions, comments, or more information, visit the project website at http://industriousone.com/premake premake-4.3-src+repack1/scripts/0000755000000000000000000000000011470465410015302 5ustar rootrootpremake-4.3-src+repack1/scripts/embed.lua0000644000000000000000000000436411470465410017070 0ustar rootroot-- -- Embed the Lua scripts into src/host/scripts.c as static data buffers. -- I embed the actual scripts, rather than Lua bytecodes, because the -- bytecodes are not portable to different architectures, which causes -- issues in Mac OS X Universal builds. -- local function stripfile(fname) local f = io.open(fname) local s = f:read("*a") f:close() -- strip tabs s = s:gsub("[\t]", "") -- strip any CRs s = s:gsub("[\r]", "") -- strip out comments s = s:gsub("\n%-%-[^\n]*", "") -- escape backslashes s = s:gsub("\\", "\\\\") -- strip duplicate line feeds s = s:gsub("\n+", "\n") -- strip out leading comments s = s:gsub("^%-%-\n", "") -- escape line feeds s = s:gsub("\n", "\\n") -- escape double quote marks s = s:gsub("\"", "\\\"") return s end local function writeline(out, s, continues) out:write("\t\"") out:write(s) out:write(iif(continues, "\"\n", "\",\n")) end local function writefile(out, fname, contents) local max = 1024 out:write("\t/* " .. fname .. " */\n") -- break up large strings to fit in Visual Studio's string length limit local start = 1 local len = contents:len() while start <= len do local n = len - start if n > max then n = max end local finish = start + n -- make sure I don't cut an escape sequence while contents:sub(finish, finish) == "\\" do finish = finish - 1 end writeline(out, contents:sub(start, finish), finish < len) start = finish + 1 end out:write("\n") end function doembed() -- load the manifest of script files scripts = dofile("src/_manifest.lua") -- main script always goes at the end table.insert(scripts, "_premake_main.lua") -- open scripts.c and write the file header local out = io.open("src/host/scripts.c", "w+b") out:write("/* Premake's Lua scripts, as static data buffers for release mode builds */\n") out:write("/* DO NOT EDIT - this file is autogenerated - see BUILD.txt */\n") out:write("/* To regenerate this file, run: premake4 embed */ \n\n") out:write("const char* builtin_scripts[] = {\n") for i,fn in ipairs(scripts) do print(fn) local s = stripfile("src/" .. fn) writefile(out, fn, s) end out:write("\t0\n};\n"); out:close() end premake-4.3-src+repack1/scripts/RELEASE.txt0000644000000000000000000000053311470465410017124 0ustar rootrootPREMAKE RELEASE CHECKLIST ------------------------- VERSION NUMBERS 4.0 4.0-beta1 4.0-rc1 4.0.1 PREP * Make sure all tests pass on Windows and POSIX * Update CHANGELOG.txt as needed * Prep release announcement for forums * Run `premake4 embed` * Commit all changes to premake-stable * Tag premake-stable with the version number premake-4.3-src+repack1/scripts/release.lua0000644000000000000000000001326111470465410017430 0ustar rootroot-- -- Prepare a new Premake release. This is still incomplete and some manual -- work is needed to get everything packaged up. -- -- BEFORE RUNNING THIS SCRIPT: -- * Make sure all tests pass on Windows AND Posix systems -- * Update CHANGELOG.txt -- * Run `premake4 embed` -- * Commit all changes to premake-stable -- * Tag premake-stable with the version number -- * Prepare release news item -- -- RUN THE SCRIPT: -- On each platform, run `premake4 release x.x binary` -- (and copy binary to /usr/local/bin if desired) -- On one platform, run `premake4 release x.x source` -- -- AFTER RUNNING THIS SCRIPT: -- * Upload release files to SourceForge -- * On SourceForge, set file platforms and release changelog -- * Update the download page on Industrious One -- * Post the news item to the forums -- * Update the Premake project page on Industrious One -- * Post to Twitter -- * Send to email list -- * Add release to Freshmeat (http://freshmeat.net/projects/premake) -- * Push changes to repositories on BitBucket -- -- Info on using Mercurial to manage releases: -- http://hgbook.red-bean.com/read/managing-releases-and-branchy-development.html -- http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/ -- function dorelease() local z local hgroot = "https://bitbucket.org/premake/premake-stable" -- -- Helper function: runs a command (formatted, with optional arguments) and -- suppresses any output. Works on both Windows and POSIX. Might be a good -- candidate for a core function. -- local function exec(cmd, ...) cmd = string.format(cmd, unpack(arg)) local z = os.execute(cmd .. " > output.log 2> error.log") os.remove("output.log") os.remove("error.log") return z end -- -- Make sure a version was specified -- if #_ARGS ~= 2 then error("** Usage: release [version] [source | binary]", 0) end local version = _ARGS[1] local kind = _ARGS[2] local pkgname = "premake-" .. version -- -- Look for required utilities -- local required = { "hg", "zip", "tar", "make", "gcc" } for _, value in ipairs(required) do z = exec("%s --version", value) if z ~= 0 then error("** '" .. value .. "' not found", 0) end end -- -- Pre-release checklist -- print( "") print( "BEFORE RUNNING THIS SCRIPT you should..." ) print( "* Pass all tests on Windows AND Posix systems" ) print( "* Update CHANGELOG.txt") print( "* Run `premake4 embed`") print( "* Commit all changes to premake-stable" ) print( "* Tag premake-stable with the version number" ) print( "* Prepare release news item") print( "") print( "Press [Enter] to begin.") io .read() --------------------------------------------------------------------------- -- -- Everything below this needs to be reworked for Mercurial -- --------------------------------------------------------------------------- -- -- Check out the release tagged sources to releases/ -- print("Downloading release tag...") os.mkdir("release") os.chdir("release") os.rmdir(pkgname) z = exec( "hg clone -r %s %s %s", version, hgroot, pkgname) if z ~= 0 then error("** Failed to download tagged sources", 0) end os.chdir(pkgname) -- -- Update the version number in premake.c -- print("Updating version number...") io.input("src/host/premake.c") local text = io.read("*a") text = text:gsub("HEAD", version) io.output("src/host/premake.c") io.write(text) io.close() -- -- Make absolutely sure the embedded scripts have been updated -- print("Updating embedded scripts...") z = exec("premake4 embed") if z ~= 0 then error("** Failed to update the embedded scripts", 0) end -- -- Generate source packaging -- if kind == "source" then -- -- Remove extra directories -- print("Cleaning up the source tree...") os.rmdir("samples") os.rmdir("packages") os.rmdir(".hg") os.rmdir(".hgignore") os.rmdir(".hgtags") -- -- Generate project files to the build directory -- print("Generating project files...") exec("premake4 /to=build/vs2005 vs2005") exec("premake4 /to=build/vs2008 vs2008") exec("premake4 /to=build/vs2010 vs2010") exec("premake4 /to=build/gmake.windows /os=windows gmake") exec("premake4 /to=build/gmake.unix /os=linux gmake") exec("premake4 /to=build/gmake.macosx /os=macosx /platform=universal32 gmake") exec("premake4 /to=build/codeblocks.windows /os=windows codeblocks") exec("premake4 /to=build/codeblocks.unix /os=linux codeblocks") exec("premake4 /to=build/codeblocks.macosx /os=macosx /platform=universal32 codeblocks") exec("premake4 /to=build/codelite.windows /os=windows codelite") exec("premake4 /to=build/codelite.unix /os=linux codelite") exec("premake4 /to=build/codelite.macosx /os=macosx /platform=universal32 codelite") exec("premake4 /to=build/xcode3 /platform=universal32 xcode3") -- -- Create source package -- print("Creating source code package...") os.chdir("..") exec("zip -r9 %s-src.zip %s/*", pkgname, pkgname) -- -- Create a binary package for this platform. This step requires a working -- GNU/Make/GCC environment. I use MinGW on Windows. -- else print("Building platform binary release...") exec("premake4 /platform=universal32 gmake") exec("make config=%s", iif(os.is("macosx"), "releaseuniv32", "release")) local fname os.chdir("bin/release") if os.is("windows") then fname = string.format("%s-windows.zip", pkgname) exec("zip -9 %s premake4.exe", fname) else fname = string.format("%s-%s.tar.gz", pkgname, os.get()) exec("tar czvf %s premake4", fname) end os.copyfile(fname, "../../../" .. fname) os.chdir("../../..") end -- -- Upload files to SourceForge -- -- -- Clean up -- -- -- Remind me of required next steps -- print("") print( "Finished.") end