2 # Makefile for Win32/Win64 Bacula File daemon
4 # If called make win64=yes the Win64 version will be built
5 # otherwise the Win32 version will be built.
7 # If called with bat=no, bat will not be built, otherwise it will be
13 WIN32_DIRS=lib filed filed/plugins console scripts
15 WIN64_DIRS=lib filed filed/plugins console scripts
19 INSTALLER=win64_installer
23 INSTALLER=win32_installer
31 .PHONY: $(DIRS) clean all Makefile.inc win32_installer full_win32_installer \
34 all: Makefile.inc $(DIRS) $(SPECIAL) $(INSTALLER)
36 clean: $(DIRS) win32_installer win64_installer
37 $(MAKE) -C tools clean
38 $(ECHO_CMD)-rm -rf release32 release64 ../qt-console/obj32 ../cats/obj32 ../wx-console/obj32
39 $(ECHO_CMD)-rm -rf stored/obj32 dird/obj32 cats/obj32 wx-console/obj32
40 $(ECHO_CMD)-rm -f ../qt-console/release/bat.exe ../qt-console/debug/bat.exe
41 $(ECHO_CMD)-rm -f ../qt-console/tray-monitor/release/bacula-tray-monitor.exe ../qt-console/tray-monitor/debug/bacula-tray-monitor.exe
44 (cd ../qt-console; ./make-win32)
47 @if test -f Makefile.inc; then \
48 if $(MAKE) -C $@ $(MAKECMDGOALS); then \
49 echo "\n===== Make of $@ succeeded =====\n\n" ; \
51 echo "\n!!!!! Make of $@ failed !!!!!\n\n" ; exit 1; \
56 @if test -f Makefile.inc; then \
57 if $(MAKE) -C $@ $(MAKECMDGOALS); then \
58 echo "\n===== Make of $@ succeeded =====\n\n" ; \
60 echo "\n!!!!! Make of $@ failed !!!!!\n\n" ; exit 1; \
65 @if test -f Makefile.inc; then \
66 if $(MAKE) -C $@ $(MAKECMDGOALS); then \
67 echo "\n===== Make of $@ succeeded =====\n\n" ; \
69 echo "\n!!!!! Make of $@ failed !!!!!\n\n" ; exit 1; \
75 @if test -f Makefile.inc; then \
76 if $(MAKE) -C $@ $(MAKECMDGOALS); then \
77 echo "\n===== Make of $@ succeeded =====\n\n" ; \
79 echo "\n!!!!! Make of $@ failed !!!!!\n\n" ; exit 1; \
84 @if test -f Makefile.inc; then \
85 if $(MAKE) -C tools bsmtp $(MAKECMDGOALS); then \
86 echo "\n===== Make of tools/bsmtp succeeded =====\n\n" ; \
88 echo "\n!!!!! Make of tools/bsmtp failed !!!!!\n\n" ; exit 1; \
96 $(ECHO_CMD)TOPDIR=`(cd ../../..;pwd)`; \
97 TOPDIR=$${DEPKGS:-$${TOPDIR}}; \
98 if test "$(win64)" = yes -a -e $${TOPDIR}/cross-tools/mingw-w64/bin/x86_64-pc-mingw32-gcc; then \
99 BINDIR=$${TOPDIR}/cross-tools/mingw-w64/bin; \
100 INCDIR=$${TOPDIR}/cross-tools/mingw-w64/x86_64-pc-mingw32/include; \
101 DLLDIR=$${TOPDIR}/cross-tools/mingw-w64/x86_64-pc-mingw32/bin; \
102 DEPKGSDIR=depkgs-mingw-w64; \
103 DEPKGSDIR32=depkgs-mingw32; \
104 elif test -e $${TOPDIR}/cross-tools/mingw32/bin/mingw32-gcc; then \
105 BINDIR=$${TOPDIR}/cross-tools/mingw32/bin; \
106 INCDIR=$${TOPDIR}/cross-tools/mingw32/mingw32/include; \
107 DLLDIR=$${TOPDIR}/cross-tools/mingw32/mingw32/bin; \
108 DEPKGSDIR=depkgs-mingw32; \
109 DEPKGSDIR32=depkgs-mingw32; \
111 echo "\nThe GCC cross compiler isn't installed."; \
112 echo "You must run build-win32-cross-tools and build-dependencies first.\n"; \
116 MAINDIR=`(cd ../..;pwd)`; \
118 -e "s^@WIN64@^$${win64}^" \
119 -e "s^@BAT@^$${bat}^" \
120 -e "s^@WIN32DEPKGS@^$${DEPKGSDIR}^" \
121 -e "s^@WIN32DEPKGS32@^$${DEPKGSDIR32}^" \
122 -e "s^@WIN32BUILDDIR@^$${BUILDDIR}^" \
123 -e "s^@WIN32MAINDIR@^$${MAINDIR}^" \
124 -e "s^@WIN32TOPDIR@^$${TOPDIR}^" \
125 -e "s^@WIN32BINDIR@^$${BINDIR}^" \
126 -e "s^@WIN32INCDIR@^$${INCDIR}^" \
127 -e "s^@WIN32DLLDIR@^$${DLLDIR}^" < Makefile.inc.in > $@