]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/win32/Makefile
ebl update makefiles to support win64 build
[bacula/bacula] / bacula / src / win32 / Makefile
1 ECHO_CMD=@
2
3 ifeq ($(WIN64),yes)
4  DIRS=  lib \
5         filed \
6         filed/plugins \
7         scripts
8 else
9  DIRS=  lib \
10         cats \
11         filed \
12         filed/plugins \
13         dird \
14         stored \
15         console \
16         wx-console \
17         tools \
18         scripts 
19 endif
20
21 .PHONY: $(DIRS) clean all Makefile.inc installer newinstaller
22
23 all: Makefile.inc $(DIRS) installer newinstaller
24
25
26 clean: $(DIRS) installer newinstaller
27         $(ECHO_CMD)-rm -rf release
28
29 newinstaller:
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" ; \
35            fi ; \
36         fi
37
38 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" ; \
44            fi ; \
45         fi
46
47 $(DIRS):
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 Makefile.inc:
57         @echo Creating $@
58         $(ECHO_CMD)TOPDIR=`(cd ../../..;pwd)`; \
59         if test "$(WIN64)" = yes -a -e ../../../cross-tools/mingw-w64/bin/x86_64-pc-mingw32-gcc; then \
60                 BINDIR=$${TOPDIR}/cross-tools/mingw-w64/bin; \
61                 INCDIR=$${TOPDIR}/cross-tools/mingw-w64/x86_64-pc-mingw32/include; \
62                 DLLDIR=$${TOPDIR}/cross-tools/mingw-w64/x86_64-pc-mingw32/bin; \
63                 DEPKGSDIR=depkgs-mingw-w64; \
64                 DEPKGSDIR32=depkgs-mingw32; \
65         elif test -e ../../../cross-tools/mingw32/bin/mingw32-gcc; then \
66                 BINDIR=$${TOPDIR}/cross-tools/mingw32/bin; \
67                 INCDIR=$${TOPDIR}/cross-tools/mingw32/mingw32/include; \
68                 DLLDIR=$${TOPDIR}/cross-tools/mingw32/mingw32/bin; \
69                 DEPKGSDIR=depkgs-mingw32; \
70                 DEPKGSDIR32=depkgs-mingw32; \
71         else \
72                 echo "\nThe GCC cross compiler isn't installed."; \
73                 echo "You must run build-win32-cross-tools and build-dependencies first.\n"; \
74                 exit 1; \
75         fi ; \
76         BUILDDIR=`(pwd)`; \
77         MAINDIR=`(cd ../..;pwd)`; \
78         sed \
79                 -e "s^@WIN64@^$${WIN64}^" \
80                 -e "s^@WIN32DEPKGS@^$${DEPKGSDIR}^" \
81                 -e "s^@WIN32DEPKGS32@^$${DEPKGSDIR32}^" \
82                 -e "s^@WIN32BUILDDIR@^$${BUILDDIR}^" \
83                 -e "s^@WIN32MAINDIR@^$${MAINDIR}^" \
84                 -e "s^@WIN32TOPDIR@^$${TOPDIR}^" \
85                 -e "s^@WIN32BINDIR@^$${BINDIR}^" \
86                 -e "s^@WIN32INCDIR@^$${INCDIR}^" \
87                 -e "s^@WIN32DLLDIR@^$${DLLDIR}^" < Makefile.inc.in > $@