From: Eric Bollengier Date: Thu, 11 Mar 2021 08:48:17 +0000 (+0100) Subject: win32: Fill the version information as CFLAGS X-Git-Tag: Release-11.0.2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48484d5b6a4165af6849a03f81826ce03d491d4f;p=thirdparty%2Fbacula.git win32: Fill the version information as CFLAGS --- diff --git a/bacula/src/win32/Makefile.inc.in b/bacula/src/win32/Makefile.inc.in index 8b6c2a956..fca81ba16 100644 --- a/bacula/src/win32/Makefile.inc.in +++ b/bacula/src/win32/Makefile.inc.in @@ -92,6 +92,13 @@ else LDFLAGS += -mno-cygwin -Wl,--disable-auto-import endif +# Assign the version inside the binaries +VER_MAJOR=$(shell $(BUILDDIR)/scripts/get_version $(MAINDIR)/src/version.h 1) +VER_MINOR=$(shell $(BUILDDIR)/scripts/get_version $(MAINDIR)/src/version.h 2) +VER_BUILD=$(shell $(BUILDDIR)/scripts/get_version $(MAINDIR)/src/version.h 3) + +WINDRESFLAGS += -DVER_MAJOR=$(VER_MAJOR) -DVER_MINOR=$(VER_MINOR) -DVER_BUILD=$(VER_BUILD) -DVER_REVISION=0 + bat=@BAT@ ifeq ($(bat),no) diff --git a/bacula/src/win32/dird/Makefile b/bacula/src/win32/dird/Makefile index 51d7951dd..efcb241e9 100644 --- a/bacula/src/win32/dird/Makefile +++ b/bacula/src/win32/dird/Makefile @@ -116,7 +116,4 @@ clean: $(BINDIR)/bacula-dir.exe: $(DIRD_OBJS) $(LIBS_CATS) $(LIBS_BACULA) $(call link_winapp,$(DIRD_LIBS)) -$(OBJDIR)/winres.res: winres.rc - $(WINDRES) $(INCLUDE_ICONS) -O coff $< -o $@ - include ../Makefile.rules diff --git a/bacula/src/win32/filed/Makefile b/bacula/src/win32/filed/Makefile index 8f6c2a0ca..0c716c2e8 100644 --- a/bacula/src/win32/filed/Makefile +++ b/bacula/src/win32/filed/Makefile @@ -125,9 +125,4 @@ clean: $(BINDIR)/bacula-fd.exe: $(FILED_OBJS) $(LIBS_BACULA) $(call link_winapp,$(FILED_LIBS)) -$(OBJDIR)/winres.res: $(BUILDDIR)/libwin32/winres.rc - @echo "Compiling $@" - $(call checkdir,$@) - $(ECHO_CMD)$(WINDRES) $(INCLUDE_ICONS) -DMINGW64 -O coff $< -o $@ - include $(BUILDDIR)/Makefile.rules diff --git a/bacula/src/win32/scripts/get_version b/bacula/src/win32/scripts/get_version new file mode 100755 index 000000000..910e7ba2a --- /dev/null +++ b/bacula/src/win32/scripts/get_version @@ -0,0 +1,14 @@ +#!/bin/sh +# Copyright (C) 2000-2021 Kern Sibbald +# License: BSD 2-Clause; see file LICENSE-FOSS + +V=$1 +P=$2 + +if [ ! -f "$V" -o "$P" = "" ]; then + echo "ERROR: Usage $0: ../version.h part" + exit 1 +fi + +# #define VERSION "12.6.1" => 12.6.1 => 12 / 6 / 1 +awk -F '"' '/#define VERSION / { print $2 }' $V | cut -d . -f $P diff --git a/bacula/src/win32/stored/Makefile b/bacula/src/win32/stored/Makefile index 2d64eee08..3d1f6c5cf 100644 --- a/bacula/src/win32/stored/Makefile +++ b/bacula/src/win32/stored/Makefile @@ -184,9 +184,4 @@ $(OBJDIR)/mtops.o: mtops.cpp $(call checkdir,$@) $(ECHO_CMD)$(CXX) $(CFLAGS) $(INCLUDE_DDK) -I../../stored -c $< -o $@ -$(OBJDIR)/winres.res: baculasd/winres.rc - @echo "Compiling $@" - $(call checkdir,$@) - $(ECHO_CMD)$(WINDRES) $(INCLUDE_ICONS) -I baculasd -O coff $< -o $@ - include ../Makefile.rules