From 94bcef20165a64904a099372ffe9333268b6a792 Mon Sep 17 00:00:00 2001 From: Dmitry Isaenko Date: Sun, 9 Feb 2025 21:46:47 +0300 Subject: [PATCH] quite better makefile --- Makefile | 15 +++++++++------ src/argb-colors.h | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 4da8622..7c22f08 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,21 @@ -CC = gcc +MKDIR_P = mkdir -p +CFLAGS += -std=c17 -I/usr/include/ -O2 -Wno-unused-result MKDIR_P = mkdir -p APP_NAME = argb-colors +INSTALL_DIR = /usr/bin/ all: $(APP_NAME) -argb-colors: ./src/$(APP_NAME).c +$(APP_NAME): ./src/$(APP_NAME).c $(MKDIR_P) ./bin - $(CC) -std=c17 -I/usr/include/ ./src/$(APP_NAME).c -lusb-1.0 -o ./bin/$(APP_NAME) + $(CC) $(CFLAGS) ./src/$(APP_NAME).c -lusb-1.0 -o ./bin/$(APP_NAME) clean: - rm -rf ./bin/*.o \ + rm -f ./bin/*.o \ ./bin/$(APP_NAME) + install: - install ./bin/$(APP_NAME) /usr/bin + install ./bin/$(APP_NAME) $(INSTALL_DIR) uninstall: - rm /usr/bin/$(APP_NAME) + rm $(INSTALL_DIR)$(APP_NAME) \ No newline at end of file diff --git a/src/argb-colors.h b/src/argb-colors.h index 17dd1e3..898e5b1 100644 --- a/src/argb-colors.h +++ b/src/argb-colors.h @@ -8,7 +8,7 @@ enum separate_options { B1, B2, B3, B4, B5, B6 }; -const char *argp_program_version = "argb-color 0.1\n\n\ +const char *argp_program_version = "argb-color 0.2\n\n\ License: GPLv3+: GNU GPL version 3 or newer .\n\ Dmitry Isaenko, 2025, Russia.\n\ https://redrise.ru, https://github.com/developersu";