+#
+# Makefile for Win32/Win64 Bacula File daemon
+#
+# If called make win64=yes the Win64 version will be built
+# otherwise the Win32 version will be built.
+#
+# If called with bat=no, bat will not be built, otherwise it will be
+# built.
+#
+
ECHO_CMD=@
WIN32_DIRS=lib filed filed/plugins console scripts
WIN64_DIRS=lib filed filed/plugins console scripts
-ifeq ($(WIN64),yes)
+ifeq ($(win64),yes)
DIRS=$(WIN64_DIRS)
INSTALLER=win64_installer
SPECIAL=bsmtp
SPECIAL=bat bsmtp
endif
+ifeq ($(bat),no)
+ SPECIAL=bsmtp
+endif
+
.PHONY: $(DIRS) clean all Makefile.inc win32_installer full_win32_installer \
win64_installer bsmtp
BUILDDIR=`(pwd)`; \
MAINDIR=`(cd ../..;pwd)`; \
sed \
- -e "s^@WIN64@^$${WIN64}^" \
+ -e "s^@WIN64@^$${win64}^" \
+ -e "s^@BAT@^$${bat}^" \
-e "s^@WIN32DEPKGS@^$${DEPKGSDIR}^" \
-e "s^@WIN32DEPKGS32@^$${DEPKGSDIR32}^" \
-e "s^@WIN32BUILDDIR@^$${BUILDDIR}^" \
OBJDIR := obj32
endif
+bat=@BAT@
+
+ifeq ($(bat),no)
+ BUILD_BAT=no
+else
+ BUILD_BAT=yes
+endif
+
OBJDIRS := obj32 obj64
LDFLAGS := -g -Wall -mno-cygwin -Wl,--disable-auto-import
INCLUDE_MYSQL := -I$(DEPKGS)/include/mysql
LIBS_DB := \
- $(DEPKGS)/lib/libdb.a
+ $(DEPKGS)/lib/libdb.a
LIBS_PTHREADS := \
- $(DEPKGS)/lib/libpthreadGCE.a
+ $(DEPKGS)/lib/libpthreadGCE.a
LIBS_ZLIB := \
- $(DEPKGS)/lib/libz.a
+ $(DEPKGS)/lib/libz.a
LIBS_MYSQL := \
- $(DEPKGS)/lib/libmysql.a
+ $(DEPKGS)/lib/libmysql.a
LIBS_POSTGRESQL := \
- $(DEPKGS)/lib/libpq.a
+ $(DEPKGS)/lib/libpq.a
LIBS_SQLITE := \
- $(DEPKGS)/lib/libsqlite3.a
+ $(DEPKGS)/lib/libsqlite3.a
LIBS_SSL := \
- $(DEPKGS)/lib/libssl.dll.a
+ $(DEPKGS)/lib/libssl.dll.a
LIBS_CRYPTO := \
- $(DEPKGS)/lib/libcrypto.dll.a
+ $(DEPKGS)/lib/libcrypto.dll.a
LIBS_WX := \
- $(DEPKGS)/lib/wx_dll/libwxmsw28_core.a \
- $(DEPKGS)/lib/wx_dll/libwxbase28.a
+ $(DEPKGS)/lib/wx_dll/libwxmsw28_core.a \
+ $(DEPKGS)/lib/wx_dll/libwxbase28.a
LIBS_CATS := \
- $(LIBDIR)/libcats.a
+ $(LIBDIR)/libcats.a
LIBS_BACULA := \
- $(LIBDIR)/libbacula.a
+ $(LIBDIR)/libbacula.a
HAVES := \
- -DHAVE_WIN32 \
- -DHAVE_MINGW \
- -DHAVE_ZLIB_H \
- -DHAVE_LIBZ \
- -DHAVE_CRYPTO \
- -DHAVE_OPENSSL \
- -DHAVE_TLS
+ -DHAVE_WIN32 \
+ -DHAVE_MINGW \
+ -DHAVE_ZLIB_H \
+ -DHAVE_LIBZ \
+ -DHAVE_CRYPTO \
+ -DHAVE_OPENSSL \
+ -DHAVE_TLS
make
#
# Build win64 Bacula
-make WIN64=yes
+make win64=yes
-DOUT_DIR=..\\release32 \
-DSRC_DIR=release32 \
-DBUILD_TOOLS=MinGW32 \
- -DWINVER=32
+ -DWINVER=32 \
+ -DBUILD_BAT=$(BUILD_BAT)
INSTALL_EXE := $(BUILDDIR)/release32/winbacula-$(VERSION).exe
-BACULA_BINARIES := \
+BACULABINARIES := \
bacula.dll \
exchange-fd.dll \
bacula-fd.exe \
bconsole.exe \
bsleep.exe \
bsmtp.exe \
- bat.exe
+
+ifeq ($(bat),no)
+ BACULA_BINARIES=$(BACULABINARIES)
+ HELP=
+else
+ BACULA_BINARIES=$(BACULABINARIES) bat.exe
+ HELP=help
+endif
DEPKGS_BINARIES := \
libeay32.dll \
docs/manuals/en/problems/problems.pdf \
docs/manuals/en/utility/utility.pdf
-HELP_FILES := help/*
-
##########################################################################
# Targets
.PHONY: all clean installer
-all: $(INSTALL_EXE)
+all: $(HELP) $(INSTALL_EXE)
-installer: $(INSTALL_EXE)
+installer: $(HELP) $(INSTALL_EXE)
clean:
@echo "Cleaning `pwd`"
$(CMD_ECHO)-rm -f $(INSTALL_EXE)
$(CMD_ECHO)-rm -rf release32
+help:
+ rm -rf release32/help
+ mkdir release32/help
+ cp -f $(BINDIR)/help/* release32/help/
+
+
#
# Rules
#
$(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))
- rm -rf release32/help
- mkdir release32/help
- cp -f $(BINDIR)/$(HELP_FILES) release32/help/
NSISDIR=$(NSIS_DIR) \
+ echo "$(NSIS_DIR)/makensis -V3 $(DEFINES) winbacula.nsi"
$(NSIS_DIR)/makensis -V3 $(DEFINES) winbacula.nsi
include $(BUILDDIR)/Makefile.rules
SetOutPath "$INSTDIR"
+!if "${BUILD_BAT}" == "yes"
Call InstallCommonFiles
File "${SRC_DIR}\QtCore4.dll"
File "${SRC_DIR}\QtGui4.dll"
; Create Start Menu entry
CreateShortCut "$SMPROGRAMS\Bacula\Bat.lnk" "$INSTDIR\bat.exe" '-c "$INSTDIR\bat.conf"' "$INSTDIR\bat.exe" 0
CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Bat Configuration.lnk" "write.exe" '"$INSTDIR\bat.conf"'
+!endif
+
SectionEnd