From accb6f2bf277a7136c03b06bea0dfbb8b8a6449a Mon Sep 17 00:00:00 2001 From: Luis <42945842+ldiaz94@users.noreply.github.com> Date: Sun, 11 Oct 2026 00:37:55 +0100 Subject: [PATCH] make install and uninstall, under PREFIX (~/.local) raz and lib/ go to PREFIX/lib/raz with a link in PREFIX/bin. --- diff --git a/CLAUDE.md b/CLAUDE.md index 649d928..84a9ae1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -15,6 +15,7 @@ make gdb # gdb stops at a line of a test and names it make stress # 40,000 native threads; make check runs a small version make fmt # lib/, examples/ and tools/ are formatted + make install # raz on PATH via ~/.local (PREFIX=...); make uninstall `make check` also runs `tools/Doc.raz` and `tools/Pretty.raz`, the report's whole examples, each library module's own `main` (its test), diff --git a/Makefile b/Makefile index 5c0a261..bfcd96a 100644 --- a/Makefile +++ b/Makefile @@ -72,4 +72,17 @@ loc: @python3 test/loc.py src/*.pas -.PHONY: units tests check gdb bench stress fmt loc clean +# raz and its library go together under $(PREFIX)/lib/raz; the link +# on PATH works since raz finds lib/ beside its real path. +PREFIX = $(HOME)/.local + +install: raz + rm -rf $(PREFIX)/lib/raz + mkdir -p $(PREFIX)/lib/raz $(PREFIX)/bin + cp -r raz lib $(PREFIX)/lib/raz + ln -sf $(PREFIX)/lib/raz/raz $(PREFIX)/bin/raz + +uninstall: + rm -rf $(PREFIX)/lib/raz $(PREFIX)/bin/raz + +.PHONY: units tests check gdb bench stress fmt loc clean install uninstall diff --git a/README.md b/README.md index dcceacb..995c962 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,10 @@ and builds into the repository's root: make # ./raz + make install # ~/.local/bin/raz, its library in ~/.local/lib/raz + make uninstall # removes them again + +Both take `PREFIX=/usr/local` (or another place) instead of `~/.local`. The tests need a shell and Python 3; the editor checks run if vim or emacs is installed.