From 0d1b76390355a8a43088d3826e0a48bf54c628f6 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 4 Apr 2009 13:09:49 +0000 Subject: [PATCH] Separate object/binaries in Win32 and Win64 builds. More to be done. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8685 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/win32/Makefile | 2 +- bacula/src/win32/Makefile.inc.in | 22 +++++++++++++--------- bacula/src/win32/Makefile.rules | 4 +++- bacula/src/win32/cats/Makefile | 1 + bacula/src/win32/lib/Makefile | 9 +++------ bacula/src/win32/makeall | 6 ++++++ bacula/src/win32/newinstaller/Makefile | 16 ++++++++-------- bacula/src/win32/win32_installer/Makefile | 16 ++++++++-------- bacula/src/win32/win64_installer/Makefile | 16 ++++++++-------- bacula/technotes | 1 + 10 files changed, 52 insertions(+), 41 deletions(-) create mode 100755 bacula/src/win32/makeall diff --git a/bacula/src/win32/Makefile b/bacula/src/win32/Makefile index 61ca0b5cd7..3552224f4b 100644 --- a/bacula/src/win32/Makefile +++ b/bacula/src/win32/Makefile @@ -22,7 +22,7 @@ else tools \ scripts - INSTALLER=win32_installer newinstaller + INSTALLER=win32_installer SPECIAL= endif diff --git a/bacula/src/win32/Makefile.inc.in b/bacula/src/win32/Makefile.inc.in index b335ca7ecd..3cf3d1f2ad 100644 --- a/bacula/src/win32/Makefile.inc.in +++ b/bacula/src/win32/Makefile.inc.in @@ -25,9 +25,6 @@ DEPKGS := $(TOPDIR)/@WIN32DEPKGS@ DEPKGS32 := $(TOPDIR)/@WIN32DEPKGS32@ DOCDIR := $(TOPDIR)/docs -BINDIR := $(BUILDDIR)/release -LIBDIR := $(BUILDDIR)/release -OBJDIR := . MINGW_BIN := @WIN32BINDIR@ MINGW_INCLUDE := @WIN32INCDIR@ @@ -42,16 +39,23 @@ DLLTOOL := $(MINGW_BIN)/mingw32-dlltool OBJCPY := $(MINGW_BIN)/mingw32-objcopy NSIS_DIR := $(DEPKGS32)/nsis STAB2CV := $(DEPKGS32)/tools/bin/stab2cv + WIN64=@WIN64@ ifeq ($(WIN64),yes) - CFLAGS := -g -Wall -mno-cygwin -mthreads -O3 -fno-strict-aliasing -DHAVE_VSS64 - LIBS_NETWORK := -lws2_32 - WIN_VERSION := 64 + CFLAGS := -g -Wall -mno-cygwin -mthreads -O3 -fno-strict-aliasing -DHAVE_VSS64 + LIBS_NETWORK := -lws2_32 + WIN_VERSION := 64 + BINDIR := $(BUILDDIR)/release64 + LIBDIR := $(BUILDDIR)/release64 + OBJDIR := obj64 else - CFLAGS := -g -Wall -mno-cygwin -m32 -mwin32 -mthreads -O3 -fno-strict-aliasing - LIBS_NETWORK := -lwsock32 - WIN_VERSION := 32 + CFLAGS := -g -Wall -mno-cygwin -m32 -mwin32 -mthreads -O3 -fno-strict-aliasing + LIBS_NETWORK := -lwsock32 + WIN_VERSION := 32 + BINDIR := $(BUILDDIR)/release32 + LIBDIR := $(BUILDDIR)/release32 + OBJDIR := obj32 endif LDFLAGS := -g -Wall -mno-cygwin -Wl,--disable-auto-import diff --git a/bacula/src/win32/Makefile.rules b/bacula/src/win32/Makefile.rules index 72c93c86ba..9e2adc71c5 100644 --- a/bacula/src/win32/Makefile.rules +++ b/bacula/src/win32/Makefile.rules @@ -15,7 +15,7 @@ define clean_exe endef define checkdir - @if [ ! -e $(dir $(1)) ]; then mkdir $(dir $(1)); fi + @if [ ! -e $(dir $(1)) ]; then mkdir -p $(dir $(1)); fi endef define makedep @@ -62,9 +62,11 @@ $(OBJDIR)/%.res: %.rc $(ECHO_CMD)$(WINDRES) -O coff $< -o $@ $(OBJDIR)/%.d: %.c + $(call checkdir, $@) $(makedep) $(OBJDIR)/%.d: %.cpp + $(call checkdir, $@) $(makedep) ifneq ($(ALL_OBJS),) diff --git a/bacula/src/win32/cats/Makefile b/bacula/src/win32/cats/Makefile index 1754813dd3..a713de8516 100644 --- a/bacula/src/win32/cats/Makefile +++ b/bacula/src/win32/cats/Makefile @@ -56,6 +56,7 @@ clean: $(ECHO_CMD)rm -f $(OBJDIR)/libcats.exp $(LIBDIR)/libcats.a $(LIBDIR)/libcats.a $(OBJDIR)/libcats.exp: bacula_cats.def + $(call checkdir,$@) $(DLLTOOL) --dllname bacula_cats.dll --no-export-all-symbols --input-def bacula_cats.def --output-exp $(OBJDIR)/libcats.exp --output-lib $(LIBDIR)/libcats.a $^ $(BINDIR)/cats_mysql.dll: $(addprefix $(OBJDIR)/cats_mysql/,mysql.o $(SQL_OBJS)) $(OBJDIR)/libcats.exp diff --git a/bacula/src/win32/lib/Makefile b/bacula/src/win32/lib/Makefile index 0504d82fa2..15da369e93 100644 --- a/bacula/src/win32/lib/Makefile +++ b/bacula/src/win32/lib/Makefile @@ -109,7 +109,7 @@ LIBS_DLL = \ $(LIBS_CRYPTO) \ $(LIBS_PTHREADS) \ $(LIBS_ZLIB) \ - $(LIBS_NETWORK) \ + $(LIBS_NETWORK) \ -lole32 \ -loleaut32 \ -luuid @@ -126,7 +126,7 @@ clean: @echo "Cleaning `pwd`" $(call clean_obj,$(ALL_OBJS)) $(call clean_exe,$(BINDIR)/bacula.dll) - $(ECHO_CMD)rm -f $(OBJDIR)/bacula.a $(LIBDIR)/libbacula.a bacula.def + $(ECHO_CMD)rm -f $(OBJDIR)/bacula.a $(LIBDIR)/libbacula.a # # Rules for generating from ../lib @@ -142,14 +142,11 @@ $(LIBDIR)/libbacula.a: $(BINDIR)/bacula.dll $(STATIC_OBJS) $(BINDIR)/bacula.dll: DLL_DEFINE=BUILDING_DLL -$(BINDIR)/bacula.dll: $(DLL_OBJS) bacula.def +$(BINDIR)/bacula.dll: $(DLL_OBJS) bacula$(WIN_VERSION).def @echo "Linking $@" $(call checkdir,$@) $(ECHO_CMD)$(CXX) $(LDFLAGS) -mdll -mwindows -Wl,--out-implib,$(OBJDIR)/bacula.a $^ $(LIBS_DLL) -o $@ -bacula.def: bacula$(WIN_VERSION).def - $(ECHO_CMD)cp bacula$(WIN_VERSION).def bacula.def - include ../Makefile.rules $(OBJDIR)/%.o: %.c diff --git a/bacula/src/win32/makeall b/bacula/src/win32/makeall new file mode 100755 index 0000000000..5986092c79 --- /dev/null +++ b/bacula/src/win32/makeall @@ -0,0 +1,6 @@ +#!/bin/sh +# Build win32 Bacula +make +# +# Build win64 Bacula +make WIN64=yes diff --git a/bacula/src/win32/newinstaller/Makefile b/bacula/src/win32/newinstaller/Makefile index a52659da1e..2872474ac4 100644 --- a/bacula/src/win32/newinstaller/Makefile +++ b/bacula/src/win32/newinstaller/Makefile @@ -11,11 +11,11 @@ VERSION := $(shell sed -ne 's/.*[ \t]VERSION[ \t][ \t]*"\(.*\)"/\1/p' < ../../ve DEFINES := \ -DVERSION=$(VERSION) \ - -DOUT_DIR=..\\release \ - -DSRC_DIR=release \ + -DOUT_DIR=..\\release32 \ + -DSRC_DIR=release32 \ -DBUILD_TOOLS=MinGW \ -INSTALL_EXE := $(BUILDDIR)/release/winbacula-$(VERSION).exe +INSTALL_EXE := $(BUILDDIR)/release32/winbacula-$(VERSION).exe BACULA_BINARIES := \ bacula.dll \ @@ -130,27 +130,27 @@ installer: $(INSTALL_EXE) clean: @echo "Cleaning `pwd`" $(CMD_ECHO)-rm -f $(INSTALL_EXE) - $(CMD_ECHO)-rm -rf release + $(CMD_ECHO)-rm -rf release32 # # Rules # define Convert_Binary -release/$$(notdir $(1)): $(1) +release32/$$(notdir $(1)): $(1) $$(call checkdir,$$@) $(ECHO_CMD)cp -f $$^ $$@ ; \ $(STAB2CV) $$@ endef define Copy_Binary -release/$$(notdir $(1)): $(1) +release32/$$(notdir $(1)): $(1) $$(call checkdir,$$@) $(ECHO_CMD)cp -f $$^ $$@ endef define Copy_Docs -release/$(1): $(DOCDIR)/$(1) +release32/$(1): $(DOCDIR)/$(1) $$(call checkdir,$$@) $(ECHO_CMD)cp -f $$^ $$(dir $$@) endef @@ -175,7 +175,7 @@ $(foreach file,$(addprefix ../../dird/, $(DIRD_FILES)),$(eval $(call Copy_Binary $(foreach file,$(DOC_FILES),$(eval $(call Copy_Docs,$(file)))) -$(INSTALL_EXE): winbacula.nsi $(addprefix release/,$(BACULA_BINARIES) $(SCRIPT_FILES) $(CAT_FILES) $(DEPKGS_BINARIES) $(NONGCC_BINARIES) $(NONGCC_LIBRARIES) $(MINGW_BINARIES) $(SSL_FILES) $(DIRD_FILES) $(DOC_FILES)) +$(INSTALL_EXE): winbacula.nsi $(addprefix release32/,$(BACULA_BINARIES) $(SCRIPT_FILES) $(CAT_FILES) $(DEPKGS_BINARIES) $(NONGCC_BINARIES) $(NONGCC_LIBRARIES) $(MINGW_BINARIES) $(SSL_FILES) $(DIRD_FILES) $(DOC_FILES)) NSISDIR=$(NSIS_DIR) \ $(NSIS_DIR)/makensis -V3 $(DEFINES) winbacula.nsi diff --git a/bacula/src/win32/win32_installer/Makefile b/bacula/src/win32/win32_installer/Makefile index a52659da1e..2872474ac4 100644 --- a/bacula/src/win32/win32_installer/Makefile +++ b/bacula/src/win32/win32_installer/Makefile @@ -11,11 +11,11 @@ VERSION := $(shell sed -ne 's/.*[ \t]VERSION[ \t][ \t]*"\(.*\)"/\1/p' < ../../ve DEFINES := \ -DVERSION=$(VERSION) \ - -DOUT_DIR=..\\release \ - -DSRC_DIR=release \ + -DOUT_DIR=..\\release32 \ + -DSRC_DIR=release32 \ -DBUILD_TOOLS=MinGW \ -INSTALL_EXE := $(BUILDDIR)/release/winbacula-$(VERSION).exe +INSTALL_EXE := $(BUILDDIR)/release32/winbacula-$(VERSION).exe BACULA_BINARIES := \ bacula.dll \ @@ -130,27 +130,27 @@ installer: $(INSTALL_EXE) clean: @echo "Cleaning `pwd`" $(CMD_ECHO)-rm -f $(INSTALL_EXE) - $(CMD_ECHO)-rm -rf release + $(CMD_ECHO)-rm -rf release32 # # Rules # define Convert_Binary -release/$$(notdir $(1)): $(1) +release32/$$(notdir $(1)): $(1) $$(call checkdir,$$@) $(ECHO_CMD)cp -f $$^ $$@ ; \ $(STAB2CV) $$@ endef define Copy_Binary -release/$$(notdir $(1)): $(1) +release32/$$(notdir $(1)): $(1) $$(call checkdir,$$@) $(ECHO_CMD)cp -f $$^ $$@ endef define Copy_Docs -release/$(1): $(DOCDIR)/$(1) +release32/$(1): $(DOCDIR)/$(1) $$(call checkdir,$$@) $(ECHO_CMD)cp -f $$^ $$(dir $$@) endef @@ -175,7 +175,7 @@ $(foreach file,$(addprefix ../../dird/, $(DIRD_FILES)),$(eval $(call Copy_Binary $(foreach file,$(DOC_FILES),$(eval $(call Copy_Docs,$(file)))) -$(INSTALL_EXE): winbacula.nsi $(addprefix release/,$(BACULA_BINARIES) $(SCRIPT_FILES) $(CAT_FILES) $(DEPKGS_BINARIES) $(NONGCC_BINARIES) $(NONGCC_LIBRARIES) $(MINGW_BINARIES) $(SSL_FILES) $(DIRD_FILES) $(DOC_FILES)) +$(INSTALL_EXE): winbacula.nsi $(addprefix release32/,$(BACULA_BINARIES) $(SCRIPT_FILES) $(CAT_FILES) $(DEPKGS_BINARIES) $(NONGCC_BINARIES) $(NONGCC_LIBRARIES) $(MINGW_BINARIES) $(SSL_FILES) $(DIRD_FILES) $(DOC_FILES)) NSISDIR=$(NSIS_DIR) \ $(NSIS_DIR)/makensis -V3 $(DEFINES) winbacula.nsi diff --git a/bacula/src/win32/win64_installer/Makefile b/bacula/src/win32/win64_installer/Makefile index 8ae5b1f147..40cb872441 100644 --- a/bacula/src/win32/win64_installer/Makefile +++ b/bacula/src/win32/win64_installer/Makefile @@ -12,12 +12,12 @@ VERSION := $(shell sed -ne 's/.*[ \t]VERSION[ \t][ \t]*"\(.*\)"/\1/p' < ../../ve DEFINES := \ -DVERSION=$(VERSION) \ - -DOUT_DIR=..\\release \ - -DSRC_DIR=release \ + -DOUT_DIR=..\\release64 \ + -DSRC_DIR=release64 \ -DWINVER=64 \ -DBUILD_TOOLS=MinGW64 \ -INSTALL_EXE := $(BUILDDIR)/release/winbacula-$(VERSION).exe +INSTALL_EXE := $(BUILDDIR)/release64/winbacula-$(VERSION).exe BACULA_BINARIES := \ bacula.dll \ @@ -107,27 +107,27 @@ installer: $(INSTALL_EXE) clean: @echo "Cleaning `pwd`" $(CMD_ECHO)-rm -f $(INSTALL_EXE) - $(CMD_ECHO)-rm -rf release + $(CMD_ECHO)-rm -rf release64 # # Rules # define Convert_Binary -release/$$(notdir $(1)): $(1) +release64/$$(notdir $(1)): $(1) $$(call checkdir,$$@) $(ECHO_CMD)cp -f $$^ $$@ ; \ $(STAB2CV) $$@ endef define Copy_Binary -release/$$(notdir $(1)): $(1) +release64/$$(notdir $(1)): $(1) $$(call checkdir,$$@) $(ECHO_CMD)cp -f $$^ $$@ endef define Copy_Docs -release/$(1): $(DOCDIR)/$(1) +release64/$(1): $(DOCDIR)/$(1) $$(call checkdir,$$@) $(ECHO_CMD)cp -f $$^ $$(dir $$@) endef @@ -154,7 +154,7 @@ $(foreach file,$(addprefix $(DEPKGS32)/ssl/, $(SSL_FILES)),$(eval $(call Copy_Bi #$(foreach file,$(DOC_FILES),$(eval $(call Copy_Docs,$(file)))) -$(INSTALL_EXE): winbacula.nsi $(addprefix release/,$(BACULA_BINARIES) $(DEPKGS_BINARIES) $(DEPKGS32_BINARIES) $(SSL_FILES) ) +$(INSTALL_EXE): winbacula.nsi $(addprefix release64/,$(BACULA_BINARIES) $(DEPKGS_BINARIES) $(DEPKGS32_BINARIES) $(SSL_FILES) ) NSISDIR=$(NSIS_DIR) \ $(NSIS_DIR)/makensis -V3 $(DEFINES) winbacula.nsi diff --git a/bacula/technotes b/bacula/technotes index 9e7789cf5e..8063f4fc68 100644 --- a/bacula/technotes +++ b/bacula/technotes @@ -3,6 +3,7 @@ General: 04Apr09 +kes Separate object/binaries in Win32 and Win64 builds. More to be done. kes Add bconsole to Win64 installer. 03Apr09 kes Implement more automatic build of Win64 client. Note, there are still -- 2.39.5