]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
win32: Fill the version information as CFLAGS
authorEric Bollengier <eric@baculasystems.com>
Thu, 11 Mar 2021 08:48:17 +0000 (09:48 +0100)
committerEric Bollengier <eric@baculasystems.com>
Fri, 26 Mar 2021 13:57:58 +0000 (14:57 +0100)
bacula/src/win32/Makefile.inc.in
bacula/src/win32/dird/Makefile
bacula/src/win32/filed/Makefile
bacula/src/win32/scripts/get_version [new file with mode: 0755]
bacula/src/win32/stored/Makefile

index 8b6c2a9568800dccf11ecbf4b6d7b088cc6bd9ca..fca81ba1660efbbfa8b495d6194ff70eae2c82b6 100644 (file)
@@ -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)
index 51d7951dd9c9df974eb5074dcd2e68560366d365..efcb241e916149a40aae2be09174ecc23b912195 100644 (file)
@@ -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
index 8f6c2a0ca61256eec19658b628885277fcb65054..0c716c2e8147d049d4d848980c342ec4d3cff44c 100644 (file)
@@ -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 (executable)
index 0000000..910e7ba
--- /dev/null
@@ -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
index 2d64eee08f70dd6bb558d24eebefee37b639e0d0..3d1f6c5cf4a8224b043b6adcc1a2fd439c844241 100644 (file)
@@ -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