make install and uninstall, under PREFIX (~/.local) raz and lib/ go to PREFIX/lib/raz with a link in PREFIX/bin.
| @@ -15,6 +15,7 @@ | ||
| 15 | 15 | make gdb # gdb stops at a line of a test and names it |
| 16 | 16 | make stress # 40,000 native threads; make check runs a small version |
| 17 | 17 | make fmt # lib/, examples/ and tools/ are formatted |
| 18 | + make install # raz on PATH via ~/.local (PREFIX=...); make uninstall | |
| 18 | 19 | |
| 19 | 20 | `make check` also runs `tools/Doc.raz` and `tools/Pretty.raz`, the |
| 20 | 21 | report's whole examples, each library module's own `main` (its test), |
| @@ -72,4 +72,17 @@ | ||
| 72 | 72 | loc: |
| 73 | 73 | @python3 test/loc.py src/*.pas |
| 74 | 74 | |
| 75 | -.PHONY: units tests check gdb bench stress fmt loc clean | |
| 75 | +# raz and its library go together under $(PREFIX)/lib/raz; the link | |
| 76 | +# on PATH works since raz finds lib/ beside its real path. | |
| 77 | +PREFIX = $(HOME)/.local | |
| 78 | + | |
| 79 | +install: raz | |
| 80 | + rm -rf $(PREFIX)/lib/raz | |
| 81 | + mkdir -p $(PREFIX)/lib/raz $(PREFIX)/bin | |
| 82 | + cp -r raz lib $(PREFIX)/lib/raz | |
| 83 | + ln -sf $(PREFIX)/lib/raz/raz $(PREFIX)/bin/raz | |
| 84 | + | |
| 85 | +uninstall: | |
| 86 | + rm -rf $(PREFIX)/lib/raz $(PREFIX)/bin/raz | |
| 87 | + | |
| 88 | +.PHONY: units tests check gdb bench stress fmt loc clean install uninstall |
| @@ -50,6 +50,10 @@ | ||
| 50 | 50 | and builds into the repository's root: |
| 51 | 51 | |
| 52 | 52 | make # ./raz |
| 53 | + make install # ~/.local/bin/raz, its library in ~/.local/lib/raz | |
| 54 | + make uninstall # removes them again | |
| 55 | + | |
| 56 | +Both take `PREFIX=/usr/local` (or another place) instead of `~/.local`. | |
| 53 | 57 | |
| 54 | 58 | The tests need a shell and Python 3; the editor checks run if vim or |
| 55 | 59 | emacs is installed. |