//-------------------------------------------------------------
Premake is a builder used to automatically create solutions and project files.
Cross-platform solutions and project settings are supported.
Quick project setting, macro definition, and target modification between projects are also solved.
Currently, premake is used for FlatFour, ODE, CEGUI, yake, NFS, and other projects.
//-------------------------------------------------------------
Premake 4.1.2, a build script generator
Copyright (C) 2002-2009 Jason Perkins and the Premake Project
Lua 5.1 Copyright (C) 1994-2008 Lua.org, PUC-Rio
Usage: premake4 [options] action [arguments]
Option Switch table:
-- Cc = [VALUE]: select one of the following specified C/C ++ compilers: <br/> gcc gnu gcc (gcc/g ++) <br/> ow OpenWatcom </p> <p> -- dotnet = [VALUE]: select the following. NET Compiler: <br/> msnet: Microsoft. NET (csc) <br/> mono: Novell Mono (mcs) <br/> pnet: Portable. NET (cscc) </p> <p> -- file = [FILE]: loads the specified premake script file. The default script FILE is "premake4.lua ". </P> <p> -- help: displays help information </p> <p> -- OS = [VALUE]: generates one of the following specified operating system files. The default VALUE is Microsoft Windows: <br/> bsd: OpenBSD, NetBSD, or FreeBSD <br/> linux: Linux <br/> macosx: Apple Mac OS X <br/> windows: microsoft Windows </p> <p> -- platform = [VALUE]: The system is generated to the following target system platform systems. The default VALUE is x32: <br/> x32 32-bit Operating System <br/> x64 64-bit Operating System <br/> universal Mac OS X Universal (32 or 64-bit) <br/> universal32 Mac OS x Universal (32-bit only) <br/> universal64 Mac OS X Universal (64-bit only) <br/> ps3 Playstation 3 (under test) <br/> xbox360 Xbox 360 (under test) </p> <p> -- scripts = [PATH]: extra search for the script file in the specified directory </p> <p> -- version: Display version Information </p> <p>
Action table:
Clean: delete all target files and generated files (the generated files include *. obj/*. ilk and other generated files)
Codeblocks: generate Code: Blocks project and solution file
Codelite: generate a CodeLite project and solution file
Gmake: Generate makefiles of GNU for POSIX/MinGW/Cygwin
Vs2002: generate a Microsoft Visual Studio 2002 project and solution file
Vs2003: generate a Microsoft Visual Studio 2003 project and solution file
Vs2005: generate a Microsoft Visual Studio 2005 project and solution file
Vs2008: generate a Microsoft Visual Studio 2008 project and solution file
For more information, see http://industriousone.com/premake
//-------------------------------------------------------------
The following is an example of an application:
Preparation: place the main. cpp file in the directory. The content should be a code file that can be edited.
Put premake4.exe in this directory (Premake 4.1.2 is used in this article)
Create two empty batch files, make. bat and clear. bat.
Create a main script file mysln. lua (premake uses the lua script, so you can use the features and functions of lua)
Fill in the make. bat file:
Premake4 -- file = mysln. lua -- OS = windows -- platform = x32 vs2005
Fill in the clear. bat file:
Premake4 -- file = mysln. lua clean
Fill in the mysln. lua file:
Solution "MySolution" <br/> basedir "work" <br/> deployments {"Debug ", "Release"} <br/> language "C ++" <br/> uuid "415890bf-272f-4cff-ba17-3d21c3d1380f" <br/> includedirs "inc" </p> <p> project "MyLib "<br/> kind" StaticLib "<br/> includedirs" inc "<br/> files {"*. cpp ","*. h "} </p> <p> configuration" Debug "<br/> defines {" DEBUG "} </p> <p> configuration" Release "<br/> defines {"NDEBUG"} </p> <p> project "MyApp" <br/> kind "StaticLib" <br/> includedirs "inc" <br/> files {"*. cpp ","*. h "} </p> <p> configuration" Debug "<br/> defines {" DEBUG "} </p> <p> configuration" Release "<br/> defines {"NDEBUG"} </p> <p>
//-------------------------------------------------------------