https://github.com/csaintos/premake-init
My personal Premake build setup snippet for C++ projects.
https://github.com/csaintos/premake-init
premake5
Last synced: 2 months ago
JSON representation
My personal Premake build setup snippet for C++ projects.
- Host: GitHub
- URL: https://github.com/csaintos/premake-init
- Owner: CSaintos
- Created: 2023-08-01T20:23:18.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-21T01:38:29.000Z (about 1 year ago)
- Last Synced: 2025-01-23T15:29:16.203Z (4 months ago)
- Topics: premake5
- Language: Lua
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Premake-Init
## What is it?
Premake-Init is my personal [Premake](https://github.com/premake/premake-core) 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](https://premake.github.io/download/)
- 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](#how-to-install), 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](#default-project-structure).
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](https://premake.github.io/docs/).
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`[//]: # (## Extras)