]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/win32/installer/Makefile
Enhance Job messages from SD when the FD->SD protocol is incorrect
[bacula/bacula] / bacula / src / win32 / installer / Makefile
1 #
2 # Makefile for win32 bacula executables
3 # Using MinGW cross-compiler on GNU/Linux
4 #
5 #  Written by Robert Nelson, June 2006
6 #
7
8 include ../Makefile.inc
9
10 VERSION := $(shell sed -ne 's/.*[ \t]VERSION[ \t][ \t]*"\(.*\)"/\1/p' < ../../version.h)
11
12 DEFINES := \
13         -DVERSION=$(VERSION) \
14         -DOUT_DIR=..\\release \
15         -DSRC_DIR=release \
16         -DBUILD_TOOLS=MinGW \
17
18 INSTALL_EXE := $(BUILDDIR)/release/winbacula-$(VERSION).exe
19
20 BACULA_BINARIES := \
21         bacula.dll \
22         cats_mysql.dll \
23         cats_postgresql.dll \
24         cats_sqlite3.dll \
25         exchange-fd.dll \
26         bacula-dir.exe \
27         bacula-fd.exe \
28         bacula-sd.exe \
29         bconsole.exe \
30         bcopy.exe \
31         bextract.exe \
32         bls.exe \
33         bscan.exe \
34         bsleep.exe \
35         bsmtp.exe \
36         btape.exe \
37         dbcheck.exe \
38         scsilist.exe \
39         bwx-console.exe
40
41 DEPKGS_BINARIES := \
42         libeay32.dll \
43         pthreadGCE.dll \
44         ssleay32.dll \
45         zlib1.dll \
46         sqlite3.exe \
47         openssl.exe \
48         loaderinfo.exe \
49         mt.exe \
50         mtx.exe \
51         scsitape.exe \
52         sed.exe \
53         tapeinfo.exe \
54         expr64.exe \
55         snooze.exe \
56         mkisofs.exe \
57         growisofs.exe \
58         dvd-ram-control.exe \
59         dvd+rw-booktype.exe \
60         dvd+rw-format.exe \
61         dvd+rw-mediainfo.exe \
62         wxbase28_gcc_bacula.dll \
63         wxmsw28_core_gcc_bacula.dll
64
65 NONGCC_BINARIES := \
66         libmysql.dll
67
68 NONGCC_LIBRARIES := \
69         libpq.dll
70
71 MINGW_BINARIES := \
72         mingwm10.dll
73
74 SCRIPT_FILES := \
75         mtx-changer.cmd \
76         disk-changer.cmd \
77         dvd-handler.cmd
78
79 CAT_FILES := \
80         create_mysql_database.cmd \
81         drop_mysql_database.cmd \
82         make_mysql_tables.cmd \
83         make_mysql_tables.sql \
84         drop_mysql_tables.cmd \
85         drop_mysql_tables.sql \
86         grant_mysql_privileges.cmd \
87         grant_mysql_privileges.sql \
88         make_mysql_catalog_backup.cmd \
89         create_postgresql_database.cmd \
90         create_postgresql_database.sql \
91         drop_postgresql_database.cmd \
92         make_postgresql_tables.cmd \
93         make_postgresql_tables.sql \
94         drop_postgresql_tables.cmd \
95         drop_postgresql_tables.sql \
96         grant_postgresql_privileges.cmd \
97         grant_postgresql_privileges.sql \
98         make_postgresql_catalog_backup.cmd \
99         create_sqlite3_database.cmd \
100         drop_sqlite3_database.cmd \
101         make_sqlite3_tables.cmd \
102         make_sqlite3_tables.sql \
103         drop_sqlite3_tables.cmd \
104         grant_sqlite3_privileges.cmd \
105         make_sqlite3_catalog_backup.cmd \
106         delete_catalog_backup.cmd
107
108 DIRD_FILES := \
109         query.sql
110
111 SSL_FILES := \
112         openssl.cnf
113
114 DOC_FILES := \
115         manual/bacula.pdf \
116         manual/bacula/*.html \
117         manual/bacula/*.png  \
118         manual/bacula/*.css
119
120 ##########################################################################
121
122 # Targets
123
124 .PHONY: all clean installer
125
126 all:            $(INSTALL_EXE)
127
128 installer:      $(INSTALL_EXE)
129
130 clean:
131         @echo "Cleaning `pwd`"
132         $(CMD_ECHO)-rm -f $(INSTALL_EXE)
133         $(CMD_ECHO)-rm -rf release
134
135 #
136 # Rules
137 #
138
139 define Convert_Binary
140 release/$$(notdir $(1)): $(1)
141         $$(call checkdir,$$@)
142         $(ECHO_CMD)cp -f $$^ $$@ ; \
143         $(STAB2CV) $$@
144 endef
145
146 define Copy_Binary
147 release/$$(notdir $(1)): $(1)
148         $$(call checkdir,$$@)
149         $(ECHO_CMD)cp -f $$^ $$@
150 endef
151
152 define Copy_Docs
153 release/$(1): $(DOCDIR)/$(1)
154         $$(call checkdir,$$@)
155         $(ECHO_CMD)cp -f $$^ $$(dir $$@)
156 endef
157
158 $(foreach file,$(addprefix $(DEPKGS)/bin/, $(DEPKGS_BINARIES)),$(eval $(call Convert_Binary,$(file))))
159
160 $(foreach file,$(addprefix $(DEPKGS)/bin/, $(NONGCC_BINARIES)),$(eval $(call Copy_Binary,$(file))))
161
162 $(foreach file,$(addprefix $(DEPKGS)/lib/, $(NONGCC_LIBRARIES)),$(eval $(call Copy_Binary,$(file))))
163
164 $(foreach file,$(addprefix $(BINDIR)/, $(BACULA_BINARIES)),$(eval $(call Convert_Binary,$(file))))
165
166 $(foreach file,$(addprefix $(MINGW_DLLDIR)/, $(MINGW_BINARIES)),$(eval $(call Copy_Binary,$(file))))
167
168 $(foreach file,$(addprefix $(DEPKGS)/ssl/, $(SSL_FILES)),$(eval $(call Copy_Binary,$(file))))
169
170 $(foreach file,$(addprefix ../scripts/, $(SCRIPT_FILES)),$(eval $(call Copy_Binary,$(file))))
171
172 $(foreach file,$(addprefix ../cats/, $(CAT_FILES)),$(eval $(call Copy_Binary,$(file))))
173
174 $(foreach file,$(addprefix ../../dird/, $(DIRD_FILES)),$(eval $(call Copy_Binary,$(file))))
175
176 $(foreach file,$(DOC_FILES),$(eval $(call Copy_Docs,$(file))))
177
178 $(INSTALL_EXE): winbacula.nsi $(addprefix release/,$(BACULA_BINARIES) $(SCRIPT_FILES) $(CAT_FILES) $(DEPKGS_BINARIES) $(NONGCC_BINARIES) $(NONGCC_LIBRARIES) $(MINGW_BINARIES) $(SSL_FILES) $(DIRD_FILES) $(DOC_FILES))
179         NSISDIR=$(NSIS_DIR) \
180         $(NSIS_DIR)/makensis -V3 $(DEFINES) winbacula.nsi
181
182 include $(BUILDDIR)/Makefile.rules