Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bluecannonball/polybuild
A simple Makefile generator.
https://github.com/bluecannonball/polybuild
Last synced: 9 days ago
JSON representation
A simple Makefile generator.
- Host: GitHub
- URL: https://github.com/bluecannonball/polybuild
- Owner: BlueCannonBall
- License: mpl-2.0
- Created: 2024-01-29T01:41:04.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-08-25T04:32:58.000Z (3 months ago)
- Last Synced: 2024-08-25T05:32:10.479Z (3 months ago)
- Language: C++
- Size: 929 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Polybuild
A simple Makefile generator designed for humans.## Usage
First, make a `Polybuild.toml` at your project's root:
```toml
[paths]
output = "polybuild" # Where to put the final result (no default)
source = ["."] # Where to find .c/.cpp files (no default)
include = ["include"] # Equivalent to the -I option of a compiler (default: empty)
library = ["lib"] # Equivalent to the -L option of a compiler (default: your system default C++ library paths)
artifact = "obj" # Where to put .o files (no default)
install = "/usr/local/bin" # Where to put the output binary when `make install` is executed (default: empty)[options]
compiler = "g++" # The compiler to use (default: your system default C++ compiler)
compilation-flags = "-Wall -std=c++17 -O3" # Options passed to the compiler (default: your system default C++ compiler flags)
libraries = ["ssl"] # Equivalent to the -l option of a compiler (default: empty)
pkg-config-libraries = ["gstreamer-1.0"] # A list of libraries added to `compilation-flags` and `libraries` with `pkg-config`
preludes = ["echo this is an arbitrary command that always runs"] # (default: empty)
clean-preludes = ["echo this is an arbitrary command that runs with the clean target"] # (default: empty)
shared = false # Equivalent to the -shared and -fPIC options of a compiler (default: false)
static = false # Equivalent to the -static option of a compiler (default: false)# Environment variables can be used to change Makefile behavior at runtime
[env.OS.Windows_NT]
paths.library = ["winlib"]
options.compiler = "clang++"
options.compilation-flags = "-Wall -std=c++17 -O2"
options.libraries = ["ssl", "ws2_32"]
options.pkg-config-libraries = ["gstreamer-1.0", "glew"]
options.static = true
```
Then, run Polybuild in the root directory. This generates a Makefile in the same directory. This file should only be regenerated (by running Polybuild again) when you add new files to your project or when you add new includes. The generated Makefile is safe to push to GitHub repositories, as it is the same regardless of the environment in which it was generated. It does not divulge any sensitive information.## Installation One-Liner
```sh
git clone https://github.com/BlueCannonBall/Polybuild.git && cd Polybuild && make && sudo make install
```