1 # New makefile for win32 bacula executables
2 # Using MinGW cross-compiler on GNU/Linux
7 # Version for cross-tools-3.4.2
8 INCLUDE_MINGW = -I/data/cross-tools/mingw32/mingw32/include
9 INCLUDE_GCC = -I/data/cross-tools/mingw32/include
11 # For cross-tools-2.95.3
12 #INCLUDE_MINGW = -I/data/cross-tools/include
13 #INCLUDE_GCC = -I/data/cross-tools/i386-mingw32msvc/include
15 INCLUDE_BACULA = -I../compat -I../.. -I../../win32/zlib
16 INCLUDE_PTHREAD = -I/data/cross-tools-pthread/include
17 INCLUDE_VSS = -I/data/Master/backup/vss-sdk/inc
18 INCLUDE_ICONS = -I../../filed/win32
47 -DHAVE_SYS_BITYPES_H \
48 -DSIZEOF_LONG_LONG_INT=8
58 CC = mingw32-g++ $(DEFINES) $(INCLUDES)
59 CXX = mingw32-g++ $(DEFINES) $(INCLUDES) 2>&1
60 WINDRES = mingw32-windres
62 #CC = i386-mingw32msvc-g++ $(DEFINES) $(INCLUDES)
63 #CXX = i386-mingw32msvc-g++ $(DEFINES) $(INCLUDES)
64 #WINDRES = i386-mingw32msvc-windres
66 # first: all bacula-fd.exe
71 ##########################################################################
73 # Files in src/win32/filed/
77 $(INTDIR)/authenticate.o \
80 $(INTDIR)/estimate.o \
82 $(INTDIR)/filed_conf.o \
83 $(INTDIR)/heartbeat.o \
88 $(INTDIR)/verify_vol.o \
92 authenticate.o: ../filed/authenticate.cpp
93 $(CXX) -c ../filed/authenticate.cpp -o authenticate.o
95 backup.o: ../filed/backup.cpp
96 $(CXX) -c ../filed/backup.cpp -o backup.o
98 chksum.o: ../filed/chksum.cpp
99 $(CXX) -c ../filed/chksum.cpp -o chksum.o
101 estimate.o: ../filed/estimate.cpp
102 $(CXX) -c ../filed/estimate.cpp -o estimate.o
104 filed.o: ../filed/filed.cpp
105 $(CXX) -c ../filed/filed.cpp -o filed.o
107 filed_conf.o: ../filed/filed_conf.cpp
108 $(CXX) -c ../filed/filed_conf.cpp -o filed_conf.o
110 heartbeat.o: ../filed/heartbeat.cpp
111 $(CXX) -c ../filed/heartbeat.cpp -o heartbeat.o
113 job.o: ../filed/job.cpp
114 $(CXX) -c ../filed/job.cpp -o job.o
116 restore.o: ../filed/restore.cpp
117 $(CXX) -c ../filed/restore.cpp -o restore.o
119 status.o: ../filed/status.cpp
120 $(CXX) -c ../filed/status.cpp -o status.o
122 verify.o: ../filed/verify.cpp
123 $(CXX) -c ../filed/verify.cpp -o verify.o
125 verify_vol.o: ../filed/verify_vol.cpp
126 $(CXX) -c ../filed/verify_vol.cpp -o verify_vol.o
128 ######################################################################
130 # Files in src/compat
131 OBJS_COMPAT_FAILED = \
132 $(INTDIR)/vss_w2k3.o \
140 $(OBJS_COMPAT_FAILED)
142 compat.o: ../compat/compat.cpp
143 $(CXX) -c ../compat/compat.cpp -o compat.o
146 getopt.o: ../compat/getopt.c
147 $(CXX) -c ../compat/getopt.c -o getopt.o
149 print.o: ../compat/print.cpp
150 $(CXX) -c ../compat/print.cpp -o print.o
152 vss.o: ../compat/vss.cpp
153 $(CXX) -c ../compat/vss.cpp -o vss.o
156 vss_xp.o: ../compat/vss_xp.cpp
157 $(CXX) -c ../compat/vss_xp.cpp -o vss_xp.o
160 vss_w2k3.o: ../compat/vss_w2k3.cpp
161 $(CXX) -c ../compat/vss_w2k3.cpp -o vss_w2k3.o
166 ######################################################################
168 # Files in src/filed/win32
170 $(INTDIR)/winabout.o \
171 $(INTDIR)/winevents.o \
172 $(INTDIR)/winservice.o \
173 $(INTDIR)/winstat.o \
174 $(INTDIR)/wintray.o \
175 $(INTDIR)/winmain.o \
178 winabout.o: ../../filed/win32/winabout.cpp
179 $(CXX) -c ../../filed/win32/winabout.cpp -o winabout.o
181 winevents.o: ../../filed/win32/winevents.cpp
182 $(CXX) -c ../../filed/win32/winevents.cpp -o winevents.o
184 winmain.o: ../../filed/win32/winmain.cpp
185 $(CXX) -c ../../filed/win32/winmain.cpp -o winmain.o
188 winservice.o: ../../filed/win32/winservice.cpp
189 $(CXX) -c ../../filed/win32/winservice.cpp -o winservice.o
191 winstat.o: ../../filed/win32/winstat.cpp
192 $(CXX) -c ../../filed/win32/winstat.cpp -o winstat.o
194 wintray.o: ../../filed/win32/wintray.cpp
195 $(CXX) -c ../../filed/win32/wintray.cpp -o wintray.o
197 winres.res: ../../filed/win32/winres.rc
198 $(WINDRES) $(INCLUDE_ICONS) -O coff ../../filed/win32/winres.rc -o winres.res
200 # mingw32-nm winres.res
202 ######################################################################
204 # Files in ??? Needed ???
208 ######################################################################
210 # Files in src/findlib
212 $(INTDIR)/attribs.o \
214 $(INTDIR)/create_file.o \
215 $(INTDIR)/enable_priv.o \
217 $(INTDIR)/find_one.o \
219 $(INTDIR)/makepath.o \
223 attribs.o: ../../findlib/attribs.c
224 $(CXX) -c ../../findlib/attribs.c -o attribs.o
226 bfile.o: ../../findlib/bfile.c
227 $(CXX) -c ../../findlib/bfile.c -o bfile.o
229 create_file.o: ../../findlib/create_file.c
230 $(CXX) -c ../../findlib/create_file.c -o create_file.o
232 enable_priv.o: ../../findlib/enable_priv.c
233 $(CXX) -c ../../findlib/enable_priv.c -o enable_priv.o
235 find.o: ../../findlib/find.c
236 $(CXX) -c ../../findlib/find.c -o find.o
238 find_one.o: ../../findlib/find_one.c
239 $(CXX) -c ../../findlib/find_one.c -o find_one.o
241 fstype.o: ../../findlib/fstype.c
242 $(CXX) -c ../../findlib/fstype.c -o fstype.o
244 makepath.o: ../../findlib/makepath.c
245 $(CXX) -c ../../findlib/makepath.c -o makepath.o
247 match.o: ../../findlib/match.c
248 $(CXX) -c ../../findlib/match.c -o match.o
250 save-cwd.o: ../../findlib/save-cwd.c
251 $(CXX) -c ../../findlib/save-cwd.c -o save-cwd.o
254 ######################################################################
256 # Files in src/win32/lib, based on files in src/lib
261 $(INTDIR)/address_conf.o \
267 $(INTDIR)/bget_msg.o \
269 $(INTDIR)/bnet_server.o \
273 $(INTDIR)/btimers.o \
274 $(INTDIR)/cram-md5.o \
279 $(INTDIR)/fnmatch.o \
282 $(INTDIR)/idcache.o \
286 $(INTDIR)/mem_pool.o \
287 $(INTDIR)/message.o \
288 $(INTDIR)/parse_conf.o \
289 $(INTDIR)/pythonlib.o \
294 $(INTDIR)/semlock.o \
298 $(INTDIR)/smartall.o \
301 $(INTDIR)/watchdog.o \
309 OBJS = $(LIB_OBJS) $(OBJS_COMPAT) $(OBJS_WIN) $(OBJS_FINDLIB) $(OBJS_FILED)
312 -L/data/cross-tools/mingw32/mingw32/lib \
313 /data/cross-tools/mingw32/mingw32/lib/libole32.a \
314 /data/cross-tools/mingw32/mingw32/lib/liboleaut32.a \
315 /data/cross-tools/mingw32/mingw32/lib/libuser32.a \
316 /data/cross-tools/mingw32/mingw32/lib/libadvapi32.a \
317 /data/cross-tools/mingw32/mingw32/lib/libgdi32.a \
318 /data/cross-tools/mingw32/mingw32/lib/libwsock32.a \
319 /data/cross-tools/mingw32/mingw32/lib/libshell32.a \
320 /data/cross-tools/mingw32/mingw32/lib/libnetapi32.a \
321 /data/cross-tools/mingw32/mingw32/lib/libuuid.a \
322 /data/cross-tools-pthread/lib/libpthreadGCE2.a \
323 /data/Master/backup/bacula/bacula/src/win32/zlib/libz.a \
326 # -L/data/cross-tools/mingw32/mingw32/lib \
329 # /data/cross-tools/mingw32/mingw32/lib/libuser32.a \
330 # /data/cross-tools/mingw32/mingw32/lib/libadvapi32.a \
331 # /data/cross-tools/mingw32/mingw32/lib/libgdi32.a \
332 # /data/cross-tools/mingw32/mingw32/lib/libwsock32.a \
333 # /data/cross-tools/mingw32/mingw32/lib/libshell32.a \
339 # Rules for generating from ../lib
342 address_conf.o: ../lib/address_conf.cpp
343 $(CXX) -c ../lib/address_conf.cpp -o address_conf.o
345 alist.o: ../lib/alist.cpp
346 $(CXX) -c ../lib/alist.cpp -o alist.o
348 alloc.o: ../lib/alloc.cpp
349 $(CXX) -c ../lib/alloc.cpp -o alloc.o
351 attr.o: ../lib/attr.cpp
352 $(CXX) -c ../lib/attr.cpp -o attr.o
354 base64.o: ../lib/base64.cpp
355 $(CXX) -c ../lib/base64.cpp -o base64.o
357 berrno.o: ../lib/berrno.cpp
358 $(CXX) -c ../lib/berrno.cpp -o berrno.o
360 bget_msg.o: ../lib/bget_msg.cpp
361 $(CXX) -c ../lib/bget_msg.cpp -o bget_msg.o
363 bnet.o: ../lib/bnet.cpp
364 $(CXX) -c ../lib/bnet.cpp -o bnet.o
366 bnet_server.o: ../lib/bnet_server.cpp
367 $(CXX) -c ../lib/bnet_server.cpp -o bnet_server.o
369 bpipe.o: ../lib/bpipe.cpp
370 $(CXX) -c ../lib/bpipe.cpp -o bpipe.o
372 bshm.o: ../lib/bshm.cpp
373 $(CXX) -c ../lib/bshm.cpp -o bshm.o
375 bsys.o: ../lib/bsys.cpp
376 $(CXX) -c ../lib/bsys.cpp -o bsys.o
378 btime.o: ../lib/btime.cpp
379 $(CXX) -c ../lib/btime.cpp -o btime.o
381 btimers.o: ../lib/btimers.cpp
382 $(CXX) -c ../lib/btimers.cpp -o btimers.o
384 cram-md5.o: ../lib/cram-md5.cpp
385 $(CXX) -c ../lib/cram-md5.cpp -o cram-md5.o
387 crc32.o: ../lib/crc32.cpp
388 $(CXX) -c ../lib/crc32.cpp -o crc32.o
390 daemon.o: ../lib/daemon.cpp
391 $(CXX) -c ../lib/daemon.cpp -o daemon.o
393 dlist.o: ../lib/dlist.cpp
394 $(CXX) -c ../lib/dlist.cpp -o dlist.o
396 edit.o: ../lib/edit.cpp
397 $(CXX) -c ../lib/edit.cpp -o edit.o
399 fnmatch.o: ../lib/fnmatch.cpp
400 $(CXX) -c ../lib/fnmatch.cpp -o fnmatch.o
402 hmac.o: ../lib/hmac.cpp
403 $(CXX) -c ../lib/hmac.cpp -o hmac.o
405 htable.o: ../lib/htable.cpp
406 $(CXX) -c ../lib/htable.cpp -o htable.o
408 idcache.o: ../lib/idcache.cpp
409 $(CXX) -c ../lib/idcache.cpp -o idcache.o
411 jcr.o: ../lib/jcr.cpp
412 $(CXX) -c ../lib/jcr.cpp -o jcr.o
414 lex.o: ../lib/lex.cpp
415 $(CXX) -c ../lib/lex.cpp -o lex.o
417 md5.o: ../lib/md5.cpp
418 $(CXX) -c ../lib/md5.cpp -o md5.o
420 mem_pool.o: ../lib/mem_pool.cpp
421 $(CXX) -c ../lib/mem_pool.cpp -o mem_pool.o
423 message.o: ../lib/message.cpp
424 $(CXX) -c ../lib/message.cpp -o message.o
426 parse_conf.o: ../lib/parse_conf.cpp
427 $(CXX) -c ../lib/parse_conf.cpp -o parse_conf.o
429 pythonlib.o: ../lib/pythonlib.cpp
430 $(CXX) -c ../lib/pythonlib.cpp -o pythonlib.o
432 queue.o: ../lib/queue.cpp
433 $(CXX) -c ../lib/queue.cpp -o queue.o
435 regex.o: ../lib/regex.cpp
436 $(CXX) -c ../lib/regex.cpp -o regex.o
438 res.o: ../lib/res.cpp
439 $(CXX) -c ../lib/res.cpp -o res.o
441 rwlock.o: ../lib/rwlock.cpp
442 $(CXX) -c ../lib/rwlock.cpp -o rwlock.o
444 scan.o: ../lib/scan.cpp
445 $(CXX) -c ../lib/scan.cpp -o scan.o
447 semlock.o: ../lib/semlock.cpp
448 $(CXX) -c ../lib/semlock.cpp -o semlock.o
450 serial.o: ../lib/serial.cpp
451 $(CXX) -c ../lib/serial.cpp -o serial.o
453 sha1.o: ../lib/sha1.cpp
454 $(CXX) -c ../lib/sha1.cpp -o sha1.o
456 signal.o: ../lib/signal.cpp
457 $(CXX) -c ../lib/signal.cpp -o signal.o
459 smartall.o: ../lib/smartall.cpp
460 $(CXX) -c ../lib/smartall.cpp -o smartall.o
462 tls.o: ../lib/tls.cpp
463 $(CXX) -c ../lib/tls.cpp -o tls.o
465 tree.o: ../lib/tree.cpp
466 $(CXX) -c ../lib/tree.cpp -o tree.o
468 util.o: ../lib/util.cpp
469 $(CXX) -c ../lib/util.cpp -o util.o
471 var.o: ../lib/var.cpp
472 $(CXX) -c ../lib/var.cpp -o var.o
474 watchdog.o: ../lib/watchdog.cpp
475 $(CXX) -c ../lib/watchdog.cpp -o watchdog.o
477 winapi.o: ../lib/winapi.cpp
478 $(CXX) -c ../lib/winapi.cpp -o winapi.o
480 workq.o: ../lib/workq.cpp
481 $(CXX) -c ../lib/workq.cpp -o workq.o
488 # all: $(LIB_OBJS) $(OBJS_FILED) $(OBJS_COMPAT) $(OBJS_WIN) $(OBJS_FINDLIB)
489 # all: $(LIB_OBJS) $(OBJS_FILED) $(OBJS_WIN) $(OBJS_FINDLIB)
491 # all: $(OBJS_FILED) # OK
492 # all: $(OBJS_COMPAT) # TODO vss...
493 # all: $(OBJS_WIN) # OK
494 # all: $(OBJS_FINDLIB) # OK
495 # all: $(LIB_OBJS) # OK
497 # Link the executable ...
498 bacula-fd.exe: $(OBJS)
499 $(CXX) $(OBJS) $(LIBS) -o bacula-fd.exe
502 # Fix vss files: check for consistent levels of pointer indirection
503 # bpipe.c: WTERMSIG undefined
504 # getopt.c: alloca redefined warning