commit 8fc171098d49a47e586b9038a31cde0f1ffd12fd
parent ec7f7da9eade84b947810e336e6381be9d8c338a
Author: Louis Burda <quent.burda@gmail.com>
Date: Sun, 12 Feb 2023 20:40:09 +0100
Added install target and minor fixups
Diffstat:
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git 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
@@ -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;