2 # Makefile for win32 bacula executables
3 # Using MinGW cross-compiler on GNU/Linux
5 # Written by Eric Bollengier, March 2009
6 # based on work by Robert Nelson
9 include ../Makefile.inc
11 VERSION := $(shell sed -ne 's/.*[ \t]VERSION[ \t][ \t]*"\(.*\)"/\1/p' < ../../version.h)
14 -DVERSION=$(VERSION) \
15 -DOUT_DIR=..\\release64 \
18 -DBUILD_TOOLS=MinGW64 \
20 INSTALL_EXE := $(BUILDDIR)/release64/winbacula-$(VERSION).exe
30 DEPKGS32_BINARIES := \
37 cryptoeay32-0.9.8.dll \
57 create_mysql_database.cmd \
58 drop_mysql_database.cmd \
59 make_mysql_tables.cmd \
60 make_mysql_tables.sql \
61 drop_mysql_tables.cmd \
62 drop_mysql_tables.sql \
63 grant_mysql_privileges.cmd \
64 grant_mysql_privileges.sql \
65 make_mysql_catalog_backup.cmd \
66 create_postgresql_database.cmd \
67 create_postgresql_database.sql \
68 drop_postgresql_database.cmd \
69 make_postgresql_tables.cmd \
70 make_postgresql_tables.sql \
71 drop_postgresql_tables.cmd \
72 drop_postgresql_tables.sql \
73 grant_postgresql_privileges.cmd \
74 grant_postgresql_privileges.sql \
75 make_postgresql_catalog_backup.cmd \
76 create_sqlite3_database.cmd \
77 drop_sqlite3_database.cmd \
78 make_sqlite3_tables.cmd \
79 make_sqlite3_tables.sql \
80 drop_sqlite3_tables.cmd \
81 grant_sqlite3_privileges.cmd \
82 make_sqlite3_catalog_backup.cmd \
83 delete_catalog_backup.cmd
92 docs/manuals/en/console/console.pdf \
93 docs/manuals/en/main/main.pdf \
94 docs/manuals/en/misc/misc.pdf \
95 docs/manuals/en/problems/problems.pdf \
96 docs/manuals/en/utility/utility.pdf
98 ##########################################################################
102 .PHONY: all clean installer
106 installer: $(INSTALL_EXE)
109 @echo "Cleaning `pwd`"
110 $(CMD_ECHO)-rm -f $(INSTALL_EXE)
111 $(CMD_ECHO)-rm -rf release64
117 define Convert_Binary
118 release64/$$(notdir $(1)): $(1)
119 $$(call checkdir,$$@)
120 $(ECHO_CMD)cp -f $$^ $$@ ; \
125 release64/$$(notdir $(1)): $(1)
126 $$(call checkdir,$$@)
127 $(ECHO_CMD)cp -f $$^ $$@
131 release64/$(1): $(DOCDIR)/$(1)
132 $$(call checkdir,$$@)
133 $(ECHO_CMD)cp -f $$^ $$(dir $$@)
136 $(foreach file,$(addprefix $(DEPKGS32)/bin/, $(DEPKGS32_BINARIES)),$(eval $(call Convert_Binary,$(file))))
138 $(foreach file,$(addprefix $(DEPKGS)/bin/, $(DEPKGS_BINARIES)),$(eval $(call Convert_Binary,$(file))))
140 #$(foreach file,$(addprefix $(DEPKGS)/bin/, $(NONGCC_BINARIES)),$(eval $(call Copy_Binary,$(file))))
142 #$(foreach file,$(addprefix $(DEPKGS)/lib/, $(NONGCC_LIBRARIES)),$(eval $(call Copy_Binary,$(file))))
144 $(foreach file,$(addprefix $(BINDIR)/, $(BACULA_BINARIES)),$(eval $(call Convert_Binary,$(file))))
146 #$(foreach file,$(addprefix $(MINGW_DLLDIR)/, $(MINGW_BINARIES)),$(eval $(call Copy_Binary,$(file))))
148 $(foreach file,$(addprefix $(DEPKGS32)/ssl/, $(SSL_FILES)),$(eval $(call Copy_Binary,$(file))))
150 #$(foreach file,$(addprefix ../scripts/, $(SCRIPT_FILES)),$(eval $(call Copy_Binary,$(file))))
152 #$(foreach file,$(addprefix ../cats/, $(CAT_FILES)),$(eval $(call Copy_Binary,$(file))))
154 #$(foreach file,$(addprefix ../../dird/, $(DIRD_FILES)),$(eval $(call Copy_Binary,$(file))))
156 #$(foreach file,$(DOC_FILES),$(eval $(call Copy_Docs,$(file))))
158 $(INSTALL_EXE): winbacula.nsi $(addprefix release64/,$(BACULA_BINARIES) $(DEPKGS_BINARIES) $(DEPKGS32_BINARIES) $(SSL_FILES) )
159 cp -f ../release32/bat.exe release64
160 cp -f ../release32/bacula-tray-monitor.exe release64
161 cp -f ../win32_installer/release32/QtCore4.dll release64
162 cp -f ../win32_installer/release32/QtGui4.dll release64
163 cp -f ../win32_installer/release32/libgcc_s_dw2-1.dll release64
164 cp -f ../win32_installer/release32/mingwm10.dll release64
165 cp -f ../win32_installer/release32/ssleay32.dll release64
166 cp -f ../win32_installer/release32/libeay32.dll release64
167 cp -f ../win32_installer/release32/zlib1.dll release64/zlib132.dll
168 cp -f ../release32/bacula.dll release64/bacula32.dll
169 cp -f ../win32_installer/release32/pthreadGCE.dll release64/pthreadGCE32.dll
170 rm -rf release64/help
171 mkdir -p release64/help
172 cp -f ../win32_installer/release32/help/* release64/help/
173 NSISDIR=$(NSIS_DIR) \
174 $(NSIS_DIR)/makensis -V3 $(DEFINES) winbacula.nsi
176 include $(BUILDDIR)/Makefile.rules