aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md38
1 files changed, 25 insertions, 13 deletions
diff --git a/README.md b/README.md
index 3bc8150..92f8f1e 100644
--- a/README.md
+++ b/README.md
@@ -20,29 +20,41 @@ On ubuntu, you can install the dependencies by running the following command wit
# apt install libncurses-dev
-Installation
-------------
+Building and Installation
+-------------------------
+
+Currently, this program is not available in any package manager, so you have to build it from source. The build uses CMake, which works in two steps — configure, then build:
+
+ $ cmake -B build
+ $ cmake --build build
+
+The first command inspects your system and generates the build files under `build/`; the second compiles the program. After the first configure, you only need to re-run `cmake --build build` to pick up source changes.
+
+Once built, the executable is at `build/maze`, and you can run it without installing:
+
+ $ ./build/maze
-Currently, this program is not available in any package manager, so you have to build it from source. You can run this command that will build and install the program on your system:
+To install it on your system, run a third command:
- # make install
+ # cmake --install build
-By default, maze is installed using the prefix "/usr/local", so the full path of the executable will be "/usr/local/bin/maze".
+By default, maze is installed using the prefix "/usr/local", so the full path of the executable will be "/usr/local/bin/maze" and the man page will be installed under "/usr/local/share/man/man1". Installing there requires root privileges.
-You can install maze into a directory of your choice by changing the second command to:
+You can install maze into a directory of your choice by setting the prefix at configure time:
- # make PREFIX="/your/dir" install
+ $ cmake -B build -DCMAKE_INSTALL_PREFIX="/your/dir"
+ $ cmake --build build
+ $ cmake --install build
-In order to remove the program from your system, run the following command:
+On Termux this is handled for you: the prefix defaults to $PREFIX (Termux's own install root), so a plain `cmake --install build` installs to $PREFIX/bin with no root and no extra flags.
- # make uninstall
+To remove the program from your system, delete the files recorded in the install manifest that CMake writes during installation (drop the leading `#`/root on Termux):
-Please note that these commands require root privileges.
+ # xargs rm < build/install_manifest.txt
-If you don't want to install, just run it, you can do it in this way:
+If you ever want a clean rebuild from scratch, remove the build directory and configure again:
- $ make
- $ ./bin/maze
+ $ rm -rf build
Usage
-----