]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/win32/Makefile
Fix some trivial errors and implemented the restore of IRIX xattrs.
[bacula/bacula] / bacula / src / win32 / Makefile
1 #
2 #  Makefile for Win32/Win64 Bacula File daemon
3 #
4 #  If called make win64=yes the Win64 version will be built
5 #     otherwise the Win32 version will be built.
6 #
7 #  If called with bat=no, bat will not be built, otherwise it will be
8 #     built.
9 #
10
11 ECHO_CMD=@
12
13 WIN32_DIRS=lib filed filed/plugins console scripts
14
15 WIN64_DIRS=lib filed filed/plugins console scripts
16
17 ifeq ($(win64),yes)
18          DIRS=$(WIN64_DIRS)
19          INSTALLER=win64_installer
20          SPECIAL=bsmtp
21 else
22          DIRS=$(WIN32_DIRS)
23          INSTALLER=win32_installer
24          SPECIAL=bat bsmtp
25 endif
26
27 ifeq ($(bat),no)
28          SPECIAL=bsmtp
29 endif        
30
31 .PHONY: $(DIRS) clean all Makefile.inc win32_installer full_win32_installer \
32          win64_installer bsmtp
33
34 all: Makefile.inc $(DIRS) $(SPECIAL) $(INSTALLER)
35
36 clean: $(DIRS) win32_installer win64_installer
37         $(MAKE) -C tools clean
38         $(ECHO_CMD)-rm -rf release32 release64
39
40 bat:
41         (cd ../qt-console; ./make-win32)
42
43 full_win32_installer:
44         @if test -f Makefile.inc; then \
45            if $(MAKE) -C $@ $(MAKECMDGOALS); then \
46                 echo "\n===== Make of $@ succeeded =====\n\n" ; \
47            else  \
48                 echo "\n!!!!! Make of $@ failed !!!!!\n\n" ; exit 1; \
49            fi ; \
50         fi
51
52 win32_installer:
53         @if test -f Makefile.inc; then \
54            if $(MAKE) -C $@ $(MAKECMDGOALS); then \
55                 echo "\n===== Make of $@ succeeded =====\n\n" ; \
56            else  \
57                 echo "\n!!!!! Make of $@ failed !!!!!\n\n" ; exit 1; \
58            fi ; \
59         fi
60
61 win64_installer:
62         @if test -f Makefile.inc; then \
63            if $(MAKE) -C $@ $(MAKECMDGOALS); then \
64                 echo "\n===== Make of $@ succeeded =====\n\n" ; \
65            else  \
66                 echo "\n!!!!! Make of $@ failed !!!!!\n\n" ; exit 1; \
67            fi ; \
68         fi
69
70
71 $(DIRS):
72         @if test -f Makefile.inc; then \
73            if $(MAKE) -C $@ $(MAKECMDGOALS); then \
74                 echo "\n===== Make of $@ succeeded =====\n\n" ; \
75            else  \
76                 echo "\n!!!!! Make of $@ failed !!!!!\n\n" ; exit 1; \
77            fi ; \
78         fi
79
80 bsmtp:
81         @if test -f Makefile.inc; then \
82            if $(MAKE) -C tools bsmtp $(MAKECMDGOALS); then \
83                 echo "\n===== Make of tools/bsmtp succeeded =====\n\n" ; \
84            else  \
85                 echo "\n!!!!! Make of tools/bsmtp failed !!!!!\n\n" ; exit 1; \
86            fi ; \
87         fi
88
89
90
91 Makefile.inc:
92         @echo Creating $@
93         $(ECHO_CMD)TOPDIR=`(cd ../../..;pwd)`; \
94         TOPDIR=$${DEPKGS:-$${TOPDIR}}; \
95         if test "$(win64)" = yes -a -e $${TOPDIR}/cross-tools/mingw-w64/bin/x86_64-pc-mingw32-gcc; then \
96                 BINDIR=$${TOPDIR}/cross-tools/mingw-w64/bin; \
97                 INCDIR=$${TOPDIR}/cross-tools/mingw-w64/x86_64-pc-mingw32/include; \
98                 DLLDIR=$${TOPDIR}/cross-tools/mingw-w64/x86_64-pc-mingw32/bin; \
99                 DEPKGSDIR=depkgs-mingw-w64; \
100                 DEPKGSDIR32=depkgs-mingw32; \
101         elif test -e $${TOPDIR}/cross-tools/mingw32/bin/mingw32-gcc; then \
102                 BINDIR=$${TOPDIR}/cross-tools/mingw32/bin; \
103                 INCDIR=$${TOPDIR}/cross-tools/mingw32/mingw32/include; \
104                 DLLDIR=$${TOPDIR}/cross-tools/mingw32/mingw32/bin; \
105                 DEPKGSDIR=depkgs-mingw32; \
106                 DEPKGSDIR32=depkgs-mingw32; \
107         else \
108                 echo "\nThe GCC cross compiler isn't installed."; \
109                 echo "You must run build-win32-cross-tools and build-dependencies first.\n"; \
110                 exit 1; \
111         fi ; \
112         BUILDDIR=`(pwd)`; \
113         MAINDIR=`(cd ../..;pwd)`; \
114         sed \
115                 -e "s^@WIN64@^$${win64}^" \
116                 -e "s^@BAT@^$${bat}^" \
117                 -e "s^@WIN32DEPKGS@^$${DEPKGSDIR}^" \
118                 -e "s^@WIN32DEPKGS32@^$${DEPKGSDIR32}^" \
119                 -e "s^@WIN32BUILDDIR@^$${BUILDDIR}^" \
120                 -e "s^@WIN32MAINDIR@^$${MAINDIR}^" \
121                 -e "s^@WIN32TOPDIR@^$${TOPDIR}^" \
122                 -e "s^@WIN32BINDIR@^$${BINDIR}^" \
123                 -e "s^@WIN32INCDIR@^$${INCDIR}^" \
124                 -e "s^@WIN32DLLDIR@^$${DLLDIR}^" < Makefile.inc.in > $@