我用的机子上ubuntu 12.04LTS server。把premake4加入ubuntu的软件源,这样可以方便下载附带内容比如lua,也可以方便升级:
vi etc/apt/sources.list
加入deb http://us.archive.ubuntu.com/ubuntu saucy main universe
执行sudo apt-get update(这一步时间久,安心等待结束)
执行sudo apt-get install premake4
然后premakee --version测试是否成功。
premake4 (Premake Build Script Generator) 4.3 表示已经成功。
创建myconfig.lua:
-- A solution contains projects, and defines the available configurations
solution "App"
configurations { "Debug", "Release" }
-- A project defines one build target
project "App1"
kind "ConsoleApp"
language "C++"
files { "**.h", "**.cpp" }
configuration "Debug"
defines { "DEBUG" }
flags { "Symbols" }
configuration "Release"
defines { "NDEBUG" }
flags { "Optimize" }
暂时先把所以.h,.cpp文件放在.lua目录下。然后执行:
premake4 --file=config.lua --os=linux --platform=x64 gmake
就生成了make文件,接着直接make就生成app1了,./app1就了。
下午接着学习更加复杂的配置方法。
参考:http://blog.csdn.net/csfreebird/article/details/10987295
http://www.installion.co.uk/ubuntu/saucy/universe/p/premake4/cn/install.html