summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2023-02-12 20:40:09 +0100
committerLouis Burda <quent.burda@gmail.com>2023-02-12 20:40:09 +0100
commit8fc171098d49a47e586b9038a31cde0f1ffd12fd (patch)
tree3a7e5fb43463b1b2c08710d5dad48a562bb0953f
parentec7f7da9eade84b947810e336e6381be9d8c338a (diff)
downloadntrop-8fc171098d49a47e586b9038a31cde0f1ffd12fd.tar.gz
ntrop-8fc171098d49a47e586b9038a31cde0f1ffd12fd.zip
Added install target and minor fixups
-rw-r--r--Makefile11
-rw-r--r--ntrop.c9
2 files changed, 13 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 5e9ad59..6e731af 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,6 @@
+PREFIX ?= /usr/local
+BINDIR ?= /bin
+
CFLAGS = -Wunused-variable -Wunused-function -g
LDLIBS = -lraylib -lm
@@ -8,4 +11,10 @@ clean:
ntrop: ntrop.c
-.PHONY: all clean
+install:
+ install -m755 -t ntrop "$(DESTDIR)/$(PREFIX)/$(BINDIR)"
+
+uninstall:
+ rm "$(DESTDIR)/$(PREFIX)/$(BINDIR)/ntrop"
+
+.PHONY: all clean insatll uninstall
diff --git a/ntrop.c b/ntrop.c
index 8b238bf..138f269 100644
--- a/ntrop.c
+++ b/ntrop.c
@@ -54,7 +54,7 @@ char fmtbuf[256];
void
usage(void)
{
- printf("Usage: ntrop FILE\n");
+ printf("Usage: ntrop [-c CTX] FILE\n");
exit(0);
}
@@ -252,7 +252,7 @@ vis(void)
drag_zoom_x = zoom_x;
drag_zoom_y = zoom_y;
drag = true;
- }else if (!IsMouseButtonDown(MOUSE_BUTTON_LEFT)) {
+ } else if (!IsMouseButtonDown(MOUSE_BUTTON_LEFT)) {
drag = false;
}
@@ -275,9 +275,6 @@ vis(void)
zoom_y = drag_zoom_y - (mouse_y - drag_mouse_y) * 1.F / zoom;
}
- if (show_bar && mouse_x < bar_width) {
- }
-
mouse_move = GetMouseWheelMove();
if (mouse_move > 0 && zoom < ZOOM_MAX) {
zoom_x += (1.F * window_width / zoom / 2)
@@ -442,7 +439,7 @@ main(int argc, const char **argv)
const char **arg;
file_path = NULL;
- entropy_ctx = 1;
+ entropy_ctx = 32;
for (arg = argv + 1; *arg; arg++) {
if (!strcmp("-c", *arg)) {
arg += 1;