]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/win32/Makefile.in
- Integrate the majority of the Mingw cross-tools submission
[bacula/bacula] / bacula / src / win32 / Makefile.in
1 #
2 # Makefile for win32 bacula executables
3 # Using MinGW cross-compiler on GNU/Linux
4
5
6 # Configuration
7
8 # Version for cross-tools-3.4.2
9 TOPDIR = @TOP_DIR@
10 CROSSTOOLS = $(TOPDIR)/cross-tools
11 MINGW = $(CROSSTOOLS)/mingw32
12 INCLUDE_MINGW = -I $(MINGW)/mingw32/include
13 INCLUDE_GCC = -I $(MINGW)/lib/gcc/mingw32/3.4.5/include
14
15 DEPKGS = $(TOPDIR)/depkgs-win32
16
17 INCLUDE_BACULA = -I .. -I ./compat
18 INCLUDE_PTHREADS = -I$(DEPKGS)/pthreads
19 INCLUDE_ZLIB = -I$(DEPKGS)/zlib
20 INCLUDE_ATL = -I$(CROSSTOOLS)/atlmfc/include
21 INCLUDE_VSS = -I$(CROSSTOOLS)
22 INCLUDE_ICONS = -I ../filed/win32
23 INCLUDE_OPENSSL = -I$(CROSSTOOLS)/openssl/include
24
25 LIB_MINGW = $(MINGW)/mingw32/lib
26 LIB_PTHREADS = $(DEPKGS)/pthreads/libpthreadGCE.a
27 #LIB_ZLIB = $(DEPKGS)/libz.a
28 #LIB_SSL = $(DEPKGS)/openssl/libssl.a
29 #LIB_CRYPTO = $(DEPKGS)/openssl/libcrypto.a
30
31 BIN_DIR = $(MINGW)/bin
32
33 INCLUDES = \
34         $(INCLUDE_GCC) \
35         $(INCLUDE_MINGW) \
36         $(INCLUDE_PTHREADS) \
37         $(INCLUDE_BACULA) \
38         $(INCLUDE_ICONS)
39
40 #       $(INCLUDE_VSS) \
41 #       $(INCLUDE_ATL) \
42 #       $(INCLUDE_OPENSSL)
43
44 HAVES = \
45         -DHAVE_MINGW \
46         -DHAVE_WIN32
47
48 #        -DWIN32_VSS \
49 #        -DHAVE_ZLIB_H \
50 #        -DHAVE_LIBZ \
51 #        -DHAVE_OPENSSL \
52 #        -DHAVE_TLS \
53         
54 DEFINES = \
55         -DWIN32 \
56         $(HAVES) \
57         -DCOMPILING_BACULA
58
59
60
61 CC = $(BIN_DIR)/mingw32-g++ $(DEFINES) $(INCLUDES)
62 CXX = $(BIN_DIR)/mingw32-g++ $(DEFINES) $(INCLUDES) 2>&1
63 WINDRES = $(BIN_DIR)/mingw32-windres
64
65 first: all
66
67 OBJDIR = .
68
69 ##########################################################################
70
71 # Files in src/win32/filed/
72
73 OBJS_FILED = \
74         $(OBJDIR)/authenticate.o \
75         $(OBJDIR)/backup.o \
76         $(OBJDIR)/estimate.o \
77         $(OBJDIR)/filed.o \
78         $(OBJDIR)/filed_conf.o \
79         $(OBJDIR)/heartbeat.o \
80         $(OBJDIR)/job.o \
81         $(OBJDIR)/restore.o \
82         $(OBJDIR)/status.o \
83         $(OBJDIR)/verify.o \
84         $(OBJDIR)/verify_vol.o \
85
86 authenticate.o: ../filed/authenticate.c
87         $(CXX) -c ../filed/authenticate.c -o $(OBJDIR)/authenticate.o
88
89 backup.o:       ../filed/backup.c
90         $(CXX) -c ../filed/backup.c -o $(OBJDIR)/backup.o
91
92 estimate.o:     ../filed/estimate.c
93         $(CXX) -c ../filed/estimate.c -o $(OBJDIR)/estimate.o
94
95 filed.o:        ../filed/filed.c
96         $(CXX) -c ../filed/filed.c -o $(OBJDIR)/filed.o
97
98 filed_conf.o:   ../filed/filed_conf.c
99         $(CXX) -c ../filed/filed_conf.c -o $(OBJDIR)/filed_conf.o
100
101 heartbeat.o:    ../filed/heartbeat.c
102         $(CXX) -c ../filed/heartbeat.c -o $(OBJDIR)/heartbeat.o
103
104 job.o:  ../filed/job.c
105         $(CXX) -c ../filed/job.c -o $(OBJDIR)/job.o
106
107 restore.o:      ../filed/restore.c
108         $(CXX) -c ../filed/restore.c -o $(OBJDIR)/restore.o
109
110 status.o:       ../filed/status.c
111         $(CXX) -c ../filed/status.c -o $(OBJDIR)/status.o
112
113 verify.o:       ../filed/verify.c
114         $(CXX) -c ../filed/verify.c -o $(OBJDIR)/verify.o
115
116 verify_vol.o:   ../filed/verify_vol.c
117         $(CXX) -c ../filed/verify_vol.c -o $(OBJDIR)/verify_vol.o
118
119 ######################################################################
120
121 # Files in win32/compat
122
123 OBJS_COMPAT = \
124                 $(OBJDIR)/print.o \
125                 $(OBJDIR)/compat.o \
126                 $(OBJDIR)/getopt.o \
127                 $(OBJDIR)/vss.o \
128                 $(OBJDIR)/vss_xp.o \
129                 $(OBJDIR)/vss_w2k3.o \
130
131 compat.o:       ./compat/compat.cpp
132         $(CXX) -c ./compat/compat.cpp -o $(OBJDIR)/compat.o
133
134 getopt.o:       ./compat/getopt.c
135         $(CXX) -c ./compat/getopt.c -o $(OBJDIR)/getopt.o
136
137 print.o:        ./compat/print.cpp
138         $(CXX) -c ./compat/print.cpp -o $(OBJDIR)/print.o
139
140 vss.o:          ./compat/vss.cpp
141         $(CXX) -c ./compat/vss.cpp -o $(OBJDIR)/vss.o
142
143 vss_xp.o:       ./compat/vss_XP.cpp
144         $(CXX) -c ./compat/vss_XP.cpp -o $(OBJDIR)/vss_xp.o
145
146 vss_w2k3.o:     ./compat/vss_W2K3.cpp
147         $(CXX) -c ./compat/vss_W2K3.cpp -o $(OBJDIR)/vss_w2k3.o
148
149 ######################################################################
150
151 # Files in src/filed/win32
152 OBJS_WIN = \
153         $(OBJDIR)/winabout.o \
154         $(OBJDIR)/winevents.o \
155         $(OBJDIR)/winservice.o \
156         $(OBJDIR)/winstat.o \
157         $(OBJDIR)/wintray.o \
158         $(OBJDIR)/winmain.o \
159         $(OBJDIR)/winres.res
160
161 winabout.o:     ../filed/win32/winabout.cpp
162         $(CXX) -c ../filed/win32/winabout.cpp -o $(OBJDIR)/winabout.o
163
164 winevents.o:    ../filed/win32/winevents.cpp
165         $(CXX) -c ../filed/win32/winevents.cpp -o $(OBJDIR)/winevents.o
166
167 winmain.o:      ../filed/win32/winmain.cpp
168         $(CXX) -c ../filed/win32/winmain.cpp -o $(OBJDIR)/winmain.o
169
170 winservice.o:   ../filed/win32/winservice.cpp
171         $(CXX) -c ../filed/win32/winservice.cpp -o $(OBJDIR)/winservice.o
172
173 winstat.o:      ../filed/win32/winstat.cpp
174         $(CXX) -c ../filed/win32/winstat.cpp -o $(OBJDIR)/winstat.o
175
176 wintray.o:      ../filed/win32/wintray.cpp
177         $(CXX) -c ../filed/win32/wintray.cpp -o $(OBJDIR)/wintray.o
178
179 winres.res:     ../filed/win32/winres.rc
180         $(WINDRES) $(INCLUDE_ICONS) -o coff ../filed/win32/winres.rc -o $(OBJDIR)/winres.res
181 #       $(WINDRES) --help
182 #       mingw32-nm winres.res
183
184 ######################################################################
185
186 # Files in src/findlib
187 OBJS_FINDLIB = \
188         $(OBJDIR)/attribs.o \
189         $(OBJDIR)/bfile.o \
190         $(OBJDIR)/create_file.o \
191         $(OBJDIR)/enable_priv.o \
192         $(OBJDIR)/find.o \
193         $(OBJDIR)/find_one.o \
194         $(OBJDIR)/fstype.o \
195         $(OBJDIR)/makepath.o \
196         $(OBJDIR)/match.o \
197         $(OBJDIR)/save-cwd.o
198
199 attribs.o:      ../findlib/attribs.c
200         $(CXX) -c ../findlib/attribs.c -o $(OBJDIR)/attribs.o
201
202 bfile.o:        ../findlib/bfile.c
203         $(CXX) -c ../findlib/bfile.c -o $(OBJDIR)/bfile.o
204
205 create_file.o:  ../findlib/create_file.c
206         $(CXX) -c ../findlib/create_file.c -o $(OBJDIR)/create_file.o
207
208 enable_priv.o:  ../findlib/enable_priv.c
209         $(CXX) -c ../findlib/enable_priv.c -o $(OBJDIR)/enable_priv.o
210
211 find.o: ../findlib/find.c
212         $(CXX) -c ../findlib/find.c -o $(OBJDIR)/find.o
213
214 find_one.o:     ../findlib/find_one.c
215         $(CXX) -c ../findlib/find_one.c -o $(OBJDIR)/find_one.o
216
217 fstype.o:       ../findlib/fstype.c
218         $(CXX) -c ../findlib/fstype.c -o $(OBJDIR)/fstype.o
219
220 makepath.o:     ../findlib/makepath.c
221         $(CXX) -c ../findlib/makepath.c -o $(OBJDIR)/makepath.o
222
223 match.o:        ../findlib/match.c
224         $(CXX) -c ../findlib/match.c -o $(OBJDIR)/match.o
225
226 save-cwd.o:     ../findlib/save-cwd.c
227         $(CXX) -c ../findlib/save-cwd.c -o $(OBJDIR)/save-cwd.o
228
229
230 ######################################################################
231
232 # Files in src/win32/lib, based on files in src/lib
233
234 LIB_OBJS = \
235         $(OBJDIR)/address_conf.o \
236         $(OBJDIR)/alist.o \
237         $(OBJDIR)/alloc.o \
238         $(OBJDIR)/attr.o \
239         $(OBJDIR)/base64.o \
240         $(OBJDIR)/berrno.o \
241         $(OBJDIR)/bget_msg.o \
242         $(OBJDIR)/bnet.o \
243         $(OBJDIR)/bnet_server.o \
244         $(OBJDIR)/bpipe.o \
245         $(OBJDIR)/bregex.o \
246         $(OBJDIR)/bshm.o \
247         $(OBJDIR)/bsys.o \
248         $(OBJDIR)/btime.o \
249         $(OBJDIR)/btimers.o \
250         $(OBJDIR)/cram-md5.o \
251         $(OBJDIR)/crc32.o \
252         $(OBJDIR)/daemon.o \
253         $(OBJDIR)/dlist.o \
254         $(OBJDIR)/edit.o \
255         $(OBJDIR)/fnmatch.o \
256         $(OBJDIR)/hmac.o \
257         $(OBJDIR)/htable.o \
258         $(OBJDIR)/idcache.o \
259         $(OBJDIR)/jcr.o \
260         $(OBJDIR)/lex.o \
261         $(OBJDIR)/md5.o \
262         $(OBJDIR)/mem_pool.o \
263         $(OBJDIR)/message.o \
264         $(OBJDIR)/parse_conf.o \
265         $(OBJDIR)/pythonlib.o \
266         $(OBJDIR)/queue.o \
267         $(OBJDIR)/res.o \
268         $(OBJDIR)/rwlock.o \
269         $(OBJDIR)/semlock.o \
270         $(OBJDIR)/serial.o \
271         $(OBJDIR)/sha1.o \
272         $(OBJDIR)/signal.o \
273         $(OBJDIR)/smartall.o \
274         $(OBJDIR)/tls.o \
275         $(OBJDIR)/var.o \
276         $(OBJDIR)/watchdog.o \
277         $(OBJDIR)/winapi.o \
278         $(OBJDIR)/workq.o \
279         $(OBJDIR)/scan.o \
280         $(OBJDIR)/tree.o \
281         $(OBJDIR)/util.o \
282
283 OBJS = $(LIB_OBJS) $(OBJS_COMPAT) $(OBJS_WIN) $(OBJS_FINDLIB) $(OBJS_FILED)
284
285 LIBS = \
286         -L$(LIB_MINGW) \
287         $(LIB_PTHREADS) \
288         $(LIB_SSL) \
289         $(LIB_CRYPTO) \
290         $(LIB_ZLIB) \
291         $(LIB_MINGW)/libole32.a \
292         $(LIB_MINGW)/liboleaut32.a \
293         $(LIB_MINGW)/libuser32.a \
294         $(LIB_MINGW)/libadvapi32.a \
295         $(LIB_MINGW)/libgdi32.a \
296         $(LIB_MINGW)/libwsock32.a \
297         $(LIB_MINGW)/libshell32.a \
298         $(LIB_MINGW)/libnetapi32.a \
299         $(LIB_MINGW)/libuuid.a
300
301 #
302 # Rules for generating from ../lib
303
304
305 address_conf.o: ../lib/address_conf.c
306         $(CXX) -c ../lib/address_conf.c -o $(OBJDIR)/address_conf.o
307
308 alist.o:        ../lib/alist.c
309         $(CXX) -c ../lib/alist.c -o $(OBJDIR)/alist.o
310
311 alloc.o:        ../lib/alloc.c
312         $(CXX) -c ../lib/alloc.c -o $(OBJDIR)/alloc.o
313
314 attr.o: ../lib/attr.c
315         $(CXX) -c ../lib/attr.c -o $(OBJDIR)/attr.o
316
317 base64.o:       ../lib/base64.c
318         $(CXX) -c ../lib/base64.c -o $(OBJDIR)/base64.o
319
320 berrno.o:       ../lib/berrno.c
321         $(CXX) -c ../lib/berrno.c -o $(OBJDIR)/berrno.o
322
323 bget_msg.o:     ../lib/bget_msg.c
324         $(CXX) -c ../lib/bget_msg.c -o $(OBJDIR)/bget_msg.o
325
326 bnet.o: ../lib/bnet.c
327         $(CXX) -c ../lib/bnet.c -o $(OBJDIR)/bnet.o
328
329 bnet_server.o:  ../lib/bnet_server.c
330         $(CXX) -c ../lib/bnet_server.c -o $(OBJDIR)/bnet_server.o
331
332 bpipe.o:        ../lib/bpipe.c
333         $(CXX) -c ../lib/bpipe.c -o $(OBJDIR)/bpipe.o
334
335 bregex.o:        ../lib/bregex.c
336         $(CXX) -c ../lib/bregex.c -o $(OBJDIR)/bregex.o
337
338 bshm.o: ../lib/bshm.c
339         $(CXX) -c ../lib/bshm.c -o $(OBJDIR)/bshm.o
340
341 bsys.o: ../lib/bsys.c
342         $(CXX) -c ../lib/bsys.c -o $(OBJDIR)/bsys.o
343
344 btime.o:        ../lib/btime.c
345         $(CXX) -c ../lib/btime.c -o $(OBJDIR)/btime.o
346
347 btimers.o:      ../lib/btimers.c
348         $(CXX) -c ../lib/btimers.c -o $(OBJDIR)/btimers.o
349
350 cram-md5.o:     ../lib/cram-md5.c
351         $(CXX) -c ../lib/cram-md5.c -o $(OBJDIR)/cram-md5.o
352
353 crc32.o:        ../lib/crc32.c
354         $(CXX) -c ../lib/crc32.c -o $(OBJDIR)/crc32.o
355
356 daemon.o:       ../lib/daemon.c
357         $(CXX) -c ../lib/daemon.c -o $(OBJDIR)/daemon.o
358
359 dlist.o:        ../lib/dlist.c
360         $(CXX) -c ../lib/dlist.c -o $(OBJDIR)/dlist.o
361
362 edit.o: ../lib/edit.c
363         $(CXX) -c ../lib/edit.c -o $(OBJDIR)/edit.o
364
365 fnmatch.o:      ../lib/fnmatch.c
366         $(CXX) -c ../lib/fnmatch.c -o $(OBJDIR)/fnmatch.o
367
368 hmac.o: ../lib/hmac.c
369         $(CXX) -c ../lib/hmac.c -o $(OBJDIR)/hmac.o
370
371 htable.o:       ../lib/htable.c
372         $(CXX) -c ../lib/htable.c -o $(OBJDIR)/htable.o
373
374 idcache.o:      ../lib/idcache.c
375         $(CXX) -c ../lib/idcache.c -o $(OBJDIR)/idcache.o
376
377 jcr.o:  ../lib/jcr.c
378         $(CXX) -c ../lib/jcr.c -o $(OBJDIR)/jcr.o
379
380 lex.o:  ../lib/lex.c
381         $(CXX) -c ../lib/lex.c -o $(OBJDIR)/lex.o
382
383 md5.o:  ../lib/md5.c
384         $(CXX) -c ../lib/md5.c -o $(OBJDIR)/md5.o
385
386 mem_pool.o:     ../lib/mem_pool.c
387         $(CXX) -c ../lib/mem_pool.c -o $(OBJDIR)/mem_pool.o
388
389 message.o:      ../lib/message.c
390         $(CXX) -c ../lib/message.c -o $(OBJDIR)/message.o
391
392 parse_conf.o:   ../lib/parse_conf.c
393         $(CXX) -c ../lib/parse_conf.c -o $(OBJDIR)/parse_conf.o
394
395 pythonlib.o:    ../lib/pythonlib.c
396         $(CXX) -c ../lib/pythonlib.c -o $(OBJDIR)/pythonlib.o
397
398 queue.o:        ../lib/queue.c
399         $(CXX) -c ../lib/queue.c -o $(OBJDIR)/queue.o
400
401 res.o:  ../lib/res.c
402         $(CXX) -c ../lib/res.c -o $(OBJDIR)/res.o
403
404 rwlock.o:       ../lib/rwlock.c
405         $(CXX) -c ../lib/rwlock.c -o $(OBJDIR)/rwlock.o
406
407 scan.o: ../lib/scan.c
408         $(CXX) -c ../lib/scan.c -o $(OBJDIR)/scan.o
409
410 semlock.o:      ../lib/semlock.c
411         $(CXX) -c ../lib/semlock.c -o $(OBJDIR)/semlock.o
412
413 serial.o:       ../lib/serial.c
414         $(CXX) -c ../lib/serial.c -o $(OBJDIR)/serial.o
415
416 sha1.o: ../lib/sha1.c
417         $(CXX) -c ../lib/sha1.c -o $(OBJDIR)/sha1.o
418
419 signal.o:       ../lib/signal.c
420         $(CXX) -c ../lib/signal.c -o $(OBJDIR)/signal.o
421
422 smartall.o:     ../lib/smartall.c
423         $(CXX) -c ../lib/smartall.c -o $(OBJDIR)/smartall.o
424
425 tls.o:  ../lib/tls.c
426         $(CXX) -c ../lib/tls.c -o $(OBJDIR)/tls.o
427
428 tree.o: ../lib/tree.c
429         $(CXX) -c ../lib/tree.c -o $(OBJDIR)/tree.o
430
431 util.o: ../lib/util.c
432         $(CXX) -c ../lib/util.c -o $(OBJDIR)/util.o
433
434 var.o:  ../lib/var.c
435         $(CXX) -c ../lib/var.c -o $(OBJDIR)/var.o
436
437 watchdog.o:     ../lib/watchdog.c
438         $(CXX) -c ../lib/watchdog.c -o $(OBJDIR)/watchdog.o
439
440 winapi.o:       ../lib/winapi.c
441         $(CXX) -c ../lib/winapi.c -o $(OBJDIR)/winapi.o
442
443 workq.o:        ../lib/workq.c
444         $(CXX) -c ../lib/workq.c -o $(OBJDIR)/workq.o
445
446 # Targets
447
448 all: bacula-fd.exe
449
450 clean:
451         rm -f $(OBJDIR)/*.o $(OBJDIR)/bacula-fd.exe $(OBJDIR)/winres.res
452
453 # Link the executable ...
454 bacula-fd.exe: $(OBJS)
455         $(CXX) $(OBJS) $(LIBS) -o $(OBJDIR)/bacula-fd.exe
456
457 # TODO ...
458 # Fix vss files: check for consistent levels of pointer indirection
459 # vss_generic.c: VSS_TIMEOUT defined as empty/null
460 # bpipe.c: WTERMSIG undefined