Skip to content

CSaintos/Premake-Init

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Premake-Init

What is it?

Premake-Init is my personal Premake build setup snippet for building C++ projects using premake and GNU make.

Unlike other premake build snippets that may be commonly found online, Premake-Init uses only Lua and doesn't require any other language scripts such as Batch, Powershell, Python, Bash, etc... to automate Premake.

Default Project Structure

By default or convention (personal), the typical project structure is shown as follows:

root/
| premake/
| | script/
| | | cmd/
| | | | build.lua
| | | | clean.lua
| | | workspace/
| | | | project.lua
| | | | workspace.lua
| | | global.lua
| | | libs.lua
| | LICENSE.txt
| | premake5
| | premake5.lua
| | .gitignore
| workspace/
| | inc/
| | src/

How to Install?

  • Step 1. Download Premake
  • Step 2. Clone PremakeInit (this repo) somewhere on your machine where you keep code snippets or the sort.
  • Step 3. Copy the Premake binaries you downloaded into Premake-Init/premake.
  • Step 4 (Optional). Create a terminal command that copies your local repository contents (not the repo itself) into your current working directory.
    • Make sure to delete the README.md in your repository to avoid README.md collision.
    • Make sure your copy command doesn't copy the .git directory. (You can also just delete the .git directory).
    • You are free to delete the .gitignore and modify the premake/.gitignore.

How to Use?

When you want to create a new C++ project and build it using Make, make a copy of your Premake-Init local repo contents (without .git/, .gitignore/, and README.md) into your new project directory.

  • If you followed step 4, then you can simply call the terminal command to do this for you. If you haven't done so already, create a C++ project workspace with your source code and headers in your project folder following the convention. Next, configure the Premake build scripts in the premake directory to build your workspace. For more info on Premake and writing build scripts see their documentation. Finally, open a terminal in the premake directory and execute your premake commands for building your C++ project.
  • ./premake5 gmake2
  • ./premake5 build --{workspace}={project}
  • For a list of premake commands:
    • ./premake5 --help

About

My personal Premake build setup snippet for C++ projects.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages