Skip to content

Commit

Permalink
improve version info
Browse files Browse the repository at this point in the history
  • Loading branch information
mateoconlechuga committed Jan 17, 2024
1 parent 5ef4fbb commit d2d9dfc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 43 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

PRGM_NAME = convimg
VERSION_STRING = $(shell git describe --abbrev=8 --dirty --always --tags)

CC := gcc
CFLAGS = -Wall -Wextra -Wno-unused-but-set-variable -O3 -DNDEBUG -DLOG_BUILD_LEVEL=3 -flto
CFLAGS = -Wall -Wextra -Wno-unused-but-set-variable -O3 -DNDEBUG -DLOG_BUILD_LEVEL=3 -DPRGM_NAME="\"$(PRGM_NAME)\"" -DVERSION_STRING="\"$(VERSION_STRING)\"" -flto
CFLAGS_LIQ = -Wall -std=c99 -O3 -DNDEBUG -fno-math-errno -funroll-loops -fomit-frame-pointer -Wno-unknown-pragmas -Wno-attributes -flto
CFLAGS_LIBYAML = -Wall -std=gnu99 -O3 -DYAML_VERSION_MAJOR=1 -DYAML_VERSION_MINOR=0 -DYAML_VERSION_PATCH=0 -DYAML_VERSION_STRING="\"1.0.0\"" -flto
LDFLAGS = -flto
Expand Down Expand Up @@ -78,7 +81,7 @@ SOURCES = $(SRCDIR)/appvar.c \
$(DEPDIR)/libyaml/src/scanner.c

ifeq ($(OS),Windows_NT)
TARGET ?= convimg.exe
TARGET ?= $(PRGM_NAME).exe
SHELL = cmd.exe
NATIVEPATH = $(subst /,\,$1)
RMDIR = ( rmdir /s /q $1 2>nul || call )
Expand All @@ -101,7 +104,7 @@ ifeq ($(OS),Windows_NT)
CFLAGS_LIBYAML += -static
LDFLAGS += -static
else
TARGET ?= convimg
TARGET ?= $(PRGM_NAME)
NATIVEPATH = $(subst \,/,$1)
MKDIR = mkdir -p $1
RMDIR = rm -rf $1
Expand Down
3 changes: 1 addition & 2 deletions src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/

#include "options.h"
#include "version.h"
#include "clean.h"
#include "log.h"

Expand Down Expand Up @@ -597,7 +596,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':
Expand Down
1 change: 0 additions & 1 deletion src/output-c.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "image.h"
#include "log.h"
#include "clean.h"
#include "version.h"

#include <errno.h>
#include <string.h>
Expand Down
37 changes: 0 additions & 37 deletions src/version.h

This file was deleted.

0 comments on commit d2d9dfc

Please sign in to comment.