cnping

Minimal Graphical Ping Tool
git clone https://git.sinitax.com/cnlohr/cnping
Log | Files | Refs | Submodules | README | LICENSE | sfeed.txt

commit 16ee54ac8a6630a778aa1d1354c4303a70ca56eb
parent 3d886a77f7de441dbf3894ebdb1d7bd936cb6dc9
Author: David Auer <dreua@posteo.de>
Date:   Thu, 26 Jan 2023 14:32:16 +0100

Get version string from git

Closes: https://github.com/cntools/cnping/issues/66

Diffstat:
MMakefile | 24++++++++++++++----------
Mcnping.c | 2--
2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,14 +1,14 @@ -CFLAGS?=-s -Os -I/opt/X11/include -Wall -LDFLAGS?=-s -L/opt/X11/lib/ -CC?=gcc +CFLAGS ?= -s -Os -I/opt/X11/include -Wall +LDFLAGS ?= -s -L/opt/X11/lib/ +CC? = gcc -ICONSPATH=freedesktop/icons/hicolor/ -APPNAME=com.github.cntools.cnping +ICONSPATH = freedesktop/icons/hicolor/ +APPNAME = com.github.cntools.cnping all : cnping -#CFLAGS:=$(CFLAGS) -DCNFGOGL -#LDFLAGS:=$(LDFLAGS) -lGL +#CFLAGS := $(CFLAGS) -DCNFGOGL +#LDFLAGS := $(LDFLAGS) -lGL clean : rm -rf *.o *~ cnping cnping.exe cnping_mac searchnet @@ -17,11 +17,15 @@ clean : # Windows -#MINGW32:=/usr/bin/i686-w64-mingw32- -MINGW32?=i686-w64-mingw32- +#MINGW32 := /usr/bin/i686-w64-mingw32- +MINGW32 ?= i686-w64-mingw32- # If you don't need admin privileges -ADMINFLAGS:= $(ADMINFLAGS) -DWIN_USE_NO_ADMIN_PING +ADMINFLAGS := $(ADMINFLAGS) -DWIN_USE_NO_ADMIN_PING + +# Add git version to CFLAGS +GIT_VERSION := "$(shell git describe --abbrev=4 --dirty --always --tags)" +CFLAGS += -DVERSION=\"$(GIT_VERSION)\" cnping-wingdi.exe : cnping.c ping.c httping.c resources.o $(MINGW32)gcc -g -fno-ident -mwindows -m32 $(CFLAGS) -o $@ $^ -lgdi32 -lws2_32 -s -D_WIN32_WINNT=0x0600 -DWIN32 -liphlpapi -DMINGW_BUILD $(ADMINFLAGS) diff --git a/cnping.c b/cnping.c @@ -1,7 +1,5 @@ //Copyright (c) 2011-2019 <>< Charles Lohr - Under the MIT/x11 or NewBSD License you choose. -#define VERSION "1.0.0" - #include <stdio.h> #include <stdlib.h> #include <math.h>