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