From 69446b74a85df368e62274d0169c2e8a3bae21b5 Mon Sep 17 00:00:00 2001 From: "mingang.he" Date: Mon, 7 Dec 2020 22:51:46 +0800 Subject: [PATCH] Fix version --- Makefile | 4 ++-- main.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a29314c..8489f6a 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ ifneq ($(KERNEL), Linux) $(error only support Linux now.) endif -VERSION = $(shell git describe --tags) +VERSION = $(shell git describe --tags --always) debug = 0 @@ -36,7 +36,7 @@ else endif ifeq ($(shell echo $(VERSION) | head -c 1), v) - CFLAGS += -DVERSION=$(VERSION) + CFLAGS += -DVERSION=\"$(VERSION)\" endif SRC := $(wildcard *.c) diff --git a/main.c b/main.c index 2561e14..120653a 100644 --- a/main.c +++ b/main.c @@ -394,7 +394,7 @@ int main(int argc, char **argv) {0, 0, 0, 0} }; - while ((opt = getopt_long(argc, argv, "+ha:p:f:b:w:n", long_opts, + while ((opt = getopt_long(argc, argv, "+Vha:p:f:b:w:n", long_opts, &index)) != -1) { switch (opt) { case 'a':