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=..\\release \
18 -DBUILD_TOOLS=MinGW64 \
20 INSTALL_EXE := $(BUILDDIR)/release/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
93 manual/bacula/*.html \
97 ##########################################################################
101 .PHONY: all clean installer
105 installer: $(INSTALL_EXE)
108 @echo "Cleaning `pwd`"
109 $(CMD_ECHO)-rm -f $(INSTALL_EXE)
110 $(CMD_ECHO)-rm -rf release
116 define Convert_Binary
117 release/$$(notdir $(1)): $(1)
118 $$(call checkdir,$$@)
119 $(ECHO_CMD)cp -f $$^ $$@ ; \
124 release/$$(notdir $(1)): $(1)
125 $$(call checkdir,$$@)
126 $(ECHO_CMD)cp -f $$^ $$@
130 release/$(1): $(DOCDIR)/$(1)
131 $$(call checkdir,$$@)
132 $(ECHO_CMD)cp -f $$^ $$(dir $$@)
135 $(foreach file,$(addprefix $(DEPKGS32)/bin/, $(DEPKGS32_BINARIES)),$(eval $(call Convert_Binary,$(file))))
137 $(foreach file,$(addprefix $(DEPKGS)/bin/, $(DEPKGS_BINARIES)),$(eval $(call Convert_Binary,$(file))))
139 #$(foreach file,$(addprefix $(DEPKGS)/bin/, $(NONGCC_BINARIES)),$(eval $(call Copy_Binary,$(file))))
141 #$(foreach file,$(addprefix $(DEPKGS)/lib/, $(NONGCC_LIBRARIES)),$(eval $(call Copy_Binary,$(file))))
143 $(foreach file,$(addprefix $(BINDIR)/, $(BACULA_BINARIES)),$(eval $(call Convert_Binary,$(file))))
145 #$(foreach file,$(addprefix $(MINGW_DLLDIR)/, $(MINGW_BINARIES)),$(eval $(call Copy_Binary,$(file))))
147 $(foreach file,$(addprefix $(DEPKGS32)/ssl/, $(SSL_FILES)),$(eval $(call Copy_Binary,$(file))))
149 #$(foreach file,$(addprefix ../scripts/, $(SCRIPT_FILES)),$(eval $(call Copy_Binary,$(file))))
151 #$(foreach file,$(addprefix ../cats/, $(CAT_FILES)),$(eval $(call Copy_Binary,$(file))))
153 #$(foreach file,$(addprefix ../../dird/, $(DIRD_FILES)),$(eval $(call Copy_Binary,$(file))))
155 #$(foreach file,$(DOC_FILES),$(eval $(call Copy_Docs,$(file))))
157 $(INSTALL_EXE): winbacula.nsi $(addprefix release/,$(BACULA_BINARIES) $(DEPKGS_BINARIES) $(DEPKGS32_BINARIES) $(SSL_FILES) )
158 NSISDIR=$(NSIS_DIR) \
159 $(NSIS_DIR)/makensis -V3 $(DEFINES) winbacula.nsi
161 include $(BUILDDIR)/Makefile.rules