diff --git a/Makefile b/Makefile index e328c0d..368ad06 100644 --- a/Makefile +++ b/Makefile @@ -26,19 +26,23 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. + +PRGM_NAME = convbin +VERSION_STRING = $(shell git describe --abbrev=8 --dirty --always --tags) + CC = gcc -CFLAGS = -Wall -Wextra -Wshadow -O3 -std=c89 -DNDEBUG -DLOG_BUILD_LEVEL=3 -flto +CFLAGS = -Wall -Wextra -Wshadow -O3 -std=c89 -DNDEBUG -DLOG_BUILD_LEVEL=3 -DPRGM_NAME="\"$(PRGM_NAME)\"" -DVERSION_STRING="\"$(VERSION_STRING)\"" -flto LDFLAGS = -flto ifeq ($(OS),Windows_NT) - TARGET ?= convbin.exe + TARGET ?= $(PRGM_NAME).exe SHELL = cmd.exe NATIVEPATH = $(subst /,\,$1) RMDIR = ( rmdir /s /q $1 2>nul || call ) MKDIR = ( mkdir $1 2>nul || call ) STRIP = strip --strip-all "$1" else - TARGET ?= convbin + TARGET ?= $(PRGM_NAME) NATIVEPATH = $(subst \,/,$1) MKDIR = mkdir -p $1 RMDIR = rm -rf $1 diff --git a/src/options.c b/src/options.c index 2257631..caaf753 100644 --- a/src/options.c +++ b/src/options.c @@ -31,7 +31,6 @@ #include "options.h" #include "output.h" #include "input.h" -#include "version.h" #include "log.h" #include @@ -499,7 +498,7 @@ int options_get(int argc, char *argv[], struct options *options) break; case 'v': - LOG_PRINT("%s v%s by mateoconlechuga\n", PRGM_NAME, VERSION_STRING); + LOG_PRINT(VERSION_STRING "\n"); return OPTIONS_IGNORE; case 'l': diff --git a/src/version.h b/src/version.h deleted file mode 100644 index ff443c7..0000000 --- a/src/version.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2017-2024 Matt "MateoConLechuga" Waltz - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef VERSION_H -#define VERSION_H - -#define PRGM_NAME "convbin" -#define VERSION_STRING "4.0.3" - -#endif