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