File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ CC ?= gcc
2
2
DEBUG := -ggdb -O0 -march=native
3
3
OUTPUT := -MMD -MP
4
4
5
+ # Version
6
+ VER ?= $(shell git describe --tags --always --dirty)
7
+
5
8
# Include Directories
6
9
INCLUDE := $(shell pkg-config --cflags libzip)
7
10
INCLUDE += -I/usr/include
@@ -10,7 +13,7 @@ INCLUDE += -I/usr/local/opt/curl/include
10
13
INCLUDE += -I/usr/local/opt/libzip/include
11
14
12
15
# Compiler Flags
13
- CFLAGS := $(CFLAGS ) $(DEBUG ) $(INCLUDE )
16
+ CFLAGS := $(CFLAGS ) $(DEBUG ) $(INCLUDE ) -DVERSION='" $( VER ) "'
14
17
CFLAGS += -W -Wall -Wextra -pedantic -ansi
15
18
CFLAGS += -Wstrict-overflow -fno-strict-aliasing
16
19
Original file line number Diff line number Diff line change 18
18
#include <pwd.h>
19
19
#include <time.h>
20
20
21
- #define VERSION_MAJOR 1
22
- #define VERSION_MINOR 1
23
- #define VERSION_PATCH 0
24
- #define VERSION_PRETTY "v1.1.0"
21
+ #ifndef VERSION
22
+ #define VERSION_PRETTY "Version Unknown"
23
+ #else
24
+ #define VERSION_PRETTY VERSION
25
+ #endif
25
26
26
27
#if defined(_WIN32 )
27
28
#define BINARY O_BINARY
You can’t perform that action at this time.
0 commit comments