From 0bbbec7bb31960fca3881223f1b2c2155cad0f7b Mon Sep 17 00:00:00 2001 From: Jonathan Moallem Date: Sat, 12 Dec 2020 22:22:05 +1100 Subject: [PATCH] Added the ability to pass arguments to the executable, updated docs --- Makefile | 2 +- README.md | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index b6801fd..b7d417b 100644 --- a/Makefile +++ b/Makefile @@ -89,7 +89,7 @@ $(buildDir)/%.o: src/%.cpp Makefile # Run the executable execute: - $(target) + $(target) $(ARGS) # Clean up all relevant files clean: diff --git a/README.md b/README.md index 1ec0284..543e7a9 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,21 @@ While separate compilation works quite well in most scenarios, it's not magic, a 3. Including widely-scoped files (like the whole of `raylib-cpp.hpp`) will add all of its own includes as dependent and increase the build time 4. Placing includes in `.h` files instead of forward-declarations will also increase recursive includes and therefore the build time +### Passing Args to the Executable +For working with some projects, you may want to pass arguments to the program once it's been built. This can be achieved by assigning values to the `ARGS` flag in the Makefile like below: + +#### macOS & Linux + +```console +$ make AGRS="--somearg" +``` + +#### Windows + +```console +> mingw32-make ARGS="--somearg" +``` + ### Specifying a Non-Default Compiler If you want to use a compiler for your platform that isn't the default for your system (or potentially you would like to explicitly state it), you can make use of the system-implicit `CXX` variable like so: @@ -91,10 +106,6 @@ $ make CXX=g++ > mingw32-make CXX=g++ ``` -### Locking the Raylib Version - -*this functionality is currently in testing* - ## Contributing ### How do I contribute?