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