conmon: add new option --version

Print the version and exit immediately.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2018-02-22 20:04:12 +01:00
parent 96a9afedf6
commit 6a23a293d7
No known key found for this signature in database
GPG key ID: 263D6DF2E163E1EA
2 changed files with 12 additions and 1 deletions

View file

@ -1,8 +1,13 @@
include ../Makefile.inc
src = $(wildcard *.c)
obj = $(src:.c=.o)
override LIBS += $(shell pkg-config --libs glib-2.0)
override CFLAGS += -std=c99 -Os -Wall -Wextra $(shell pkg-config --cflags glib-2.0)
VERSION = $(shell sed -n -e 's/^const Version = "\([^"]*\)"/\1/p' ../version/version.go)
override CFLAGS += -std=c99 -Os -Wall -Wextra $(shell pkg-config --cflags glib-2.0) -DVERSION=\"$(VERSION)\" -DGIT_COMMIT=\"$(GIT_COMMIT)\"
conmon: $(obj)
$(CC) -o ../bin/$@ $^ $(CFLAGS) $(LIBS)