aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Burda <dev@sinitax.com>2026-01-23 02:19:21 +0100
committerLouis Burda <dev@sinitax.com>2026-01-23 02:19:21 +0100
commit4779981ac8af91788106d8c98f1148bf0d24c582 (patch)
tree529fdb03686c36ab27e8345b974de7d5becdd9ca
parenta16ade437116642ddcc05c02ddb4db64d8b514bd (diff)
downloadjgrep-main.tar.gz
jgrep-main.zip
Add Makefile for installHEADmain
-rw-r--r--Makefile15
-rw-r--r--README.md13
2 files changed, 22 insertions, 6 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..25ade59
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,15 @@
+PREFIX ?= /usr/local
+BINDIR ?= $(PREFIX)/bin
+MANDIR ?= $(PREFIX)/share/man/man1
+
+.PHONY: install uninstall
+
+install:
+ install -d "$(DESTDIR)$(BINDIR)"
+ install -m 755 jgrep "$(DESTDIR)$(BINDIR)/jgrep"
+ install -d "$(DESTDIR)$(MANDIR)"
+ install -m 644 jgrep.1 "$(DESTDIR)$(MANDIR)/jgrep.1"
+
+uninstall:
+ rm -f "$(DESTDIR)$(BINDIR)/jgrep"
+ rm -f "$(DESTDIR)$(MANDIR)/jgrep.1"
diff --git a/README.md b/README.md
index 62d5354..0ce20cf 100644
--- a/README.md
+++ b/README.md
@@ -5,13 +5,14 @@ A grep-like tool for searching JSON files by matching values against patterns.
## Installation
```bash
-# Copy to a directory in your PATH
-sudo cp jgrep /usr/local/bin/
-sudo cp jgrep.1 /usr/local/share/man/man1/
+# Install system-wide
+sudo make install
-# Or use locally
-chmod +x jgrep
-./jgrep --help
+# Or specify prefix
+make install PREFIX=~/.local
+
+# Uninstall
+sudo make uninstall
```
## Usage