Skip to content

Commit

Permalink
FEATURE: some Makefile rules to make compilation easier (#23)
Browse files Browse the repository at this point in the history
i thought adding very simple `Makefile` rules to compile, run the
application and clean the repo could be helpful 😌

i never remember the `cmake` commands and copy-pasting them from the
`README` is not the best to me 🤔

this PR adds
- `make build` to compile the source
- `make run` to run the compiled application => it takes care of the `cd
bin`
- `make clean` to clean the compilation files

there is also a little note in the `README` to link users to the
`Makefile` 👍

> **Note**
> see the
[`README`](https://github.com/amtoine/wiresmash/tree/feature/little-makefile-wrapper-to-compile#building-with-cmake)
and the
[`rules`](https://github.com/amtoine/wiresmash/blob/feature/little-makefile-wrapper-to-compile/Makefile)
  • Loading branch information
amtoine authored Mar 27, 2023
1 parent 12d57e3 commit 1a0cd22
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
BUILD_DIR = "./build/"
BIN_DIR = "./bin/"
APP = "app"

build:
cmake -S ./ -B ${BUILD_DIR}
cmake --build ${BUILD_DIR}

run:
( \
cd ${BIN_DIR}; \
./${APP}; \
)

clean:
rm -rf ${BIN_DIR}
rm -rf ${BUILD_DIR}
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ cmake --build ./build/

to build the executable. You will find the build executable in the `./bin` folder.

> **Note**
> you can directly use the `build`, `run` and `clean` rules for `make` instead
> ```bash
> make build run
> ```
> to run the application and
> ```bash
> make clean
> ```
> to clean all compilation files
## Future Plans
- A simple combat prototype with attacks and HP bars
Expand Down

0 comments on commit 1a0cd22

Please sign in to comment.