]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/filed/Makefile.mingw
Make win32 build - Add missing change to Makefile.in
[bacula/bacula] / bacula / src / filed / Makefile.mingw
1 #
2 # Bacula Makefile for the File daemon
3 #
4 #  Version $Id$
5 #
6
7
8 # autoconf/Make.common.in        -*- Makefile -*-
9 # release date (man), LSM date, version number/name, current maintainer
10 DATE="15 Apr 2004"
11 LSMDATE=15Apr04
12 VERSION=1.35.0
13 VERNAME=bacula-$(VERSION)#
14 MAINT=Kern Sibbald#
15 MAINTEMAIL=<kern@sibbald.com>#
16 WEBMAINT=#
17 WEBMAINTEMAIL=#
18 WEBPAGE=#
19 FTPSITENAME=#
20 FTPSITEDIR=#
21 #-------------------------------------------------------------------------
22
23 SHELL = /bin/sh
24
25 # Installation target directories & other installation stuff
26 prefix = 
27 exec_prefix = 
28 binprefix =
29 manprefix =
30 sbindir = /sbin
31 sysconfdir = /etc/bacula
32 scriptdir = /etc/bacula
33 mandir = ${prefix}/man/man1
34 manext = 1
35
36 # Tools & program stuff
37 CC = gcc
38 CPP = gcc -E
39 CXX = g++
40 MV = /usr/bin/mv
41 RM = /usr/bin/rm
42 RMF = /usr/bin/rm -f
43 CP = /usr/bin/cp
44 SED = /usr/bin/sed
45 AWK = /usr/bin/awk
46 ECHO = /usr/bin/echo
47 CMP = /usr/bin/cmp
48 TBL = /usr/bin/tbl
49 AR = /usr/bin/ar
50 RANLIB = /usr/bin/ranlib
51 INSTALL = /usr/bin/install -c
52 # add the -s to the following in PRODUCTION mode
53 INSTALL_PROGRAM = /usr/bin/install -c -m 754
54 INSTALL_DATA = /usr/bin/install -c -m 644
55 INSTALL_SCRIPT = /usr/bin/install -c -m 754
56 INSTALL_CONFIG = /usr/bin/install -c -m 640
57
58 # Flags & libs
59 CFLAGS = -g -O2 
60 CPPFLAGS = 
61 LDFLAGS = -O
62 TTOOL_LDFLAGS = 
63 DEFS = -DHAVE_WIN32 -DHAVE_MINGW
64 LIBS = -lpthreadGC -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool \
65        -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lwsock32 \
66        -lmsvcrt
67 DINCLUDE = 
68 DLIB = 
69 DB_LIBS = 
70
71 # Windows (cygwin) flags 
72 WCFLAGS = -mwindows
73 WLDFLAGS = -mwindows -Wl,--subsystem,windows -mthreads
74
75 # X Include directory
76 #XINC =  @XPM_CFLAGS@
77
78 # extra libraries needed by X on some systems, X library location
79 #XLIB =  @XPM_LIBS@ -lX11 
80
81 # End of common section of the Makefile
82 #-------------------------------------------------------------------------
83
84 srcdir =        .
85 VPATH =         .
86 .PATH:          .
87
88 # one up
89 basedir = ..
90 # top dir
91 topdir = ../..
92 # this dir relative to top dir
93 thisdir = src/filed
94
95 DEBUG=
96
97 first_rule: all
98 dummy:
99
100 #
101 SVRSRCS = filed.c authenticate.c backup.c chksum.c estimate.c \
102           filed_conf.c heartbeat.c job.c \
103           restore.c status.c verify.c verify_vol.c
104 SVROBJS = filed.o authenticate.o backup.o chksum.o estimate.o \
105           filed_conf.o heartbeat.o job.o \
106           restore.o status.o verify.o verify_vol.o
107
108 # these are the objects that are changed by the .configure process
109 EXTRAOBJS = 
110
111 FDLIBS = -lz              # extra libs for File daemon
112
113 # extra items for linking on Win32
114 WIN32OBJS = win32/winmain.o win32/winlib.a win32/winres.res
115 win32 = $(WIN32OBJS)
116
117 WIN32LIBS = $(win32)
118
119 .SUFFIXES:      .c .o
120 .PHONY:
121 .DONTCARE:
122
123 # inference rules
124 .c.o:
125         $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) -I$(srcdir) -I$(basedir) -I../win32/compat $(DINCLUDE) $(CFLAGS) $<
126 #-------------------------------------------------------------------------
127 all: win32 bacula-fd 
128         @echo "==== Make of filed is good ===="
129         @echo " "
130
131 win32/winlib.a:
132         (cd win32; $(MAKE) -f Makefile.mingw DESTDIR=$(DESTDIR))
133         @rm -f bacula-fd.exe
134
135 win32/winmain.o:
136         (cd win32; $(MAKE) -f Makefile.mingw DESTDIR=$(DESTDIR))
137         @rm -f bacula-fd.exe
138
139 win32/winres.res:
140         (cd win32; $(MAKE) -f Makefile.mingw DESTDIR=$(DESTDIR))
141         @rm -f bacula-fd.exe
142
143 # win32 libraries if needed
144 win32:  $(WIN32OBJS)
145         (cd win32; $(MAKE) -f Makefile.mingw DESTDIR=$(DESTDIR))
146         @rm -f bacula-fd.exe
147
148 bacula-fd:  $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a win32
149         $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(SVROBJS) \
150           $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(LIBS) $(DLIB)
151
152 static-bacula-fd:  $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a win32
153         $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../findlib -o $@ $(SVROBJS) \
154            $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(LIBS) $(DLIB)
155         strip $@
156
157 ../findlib/libfind.a: ../findlib/*.c
158         (cd ../findlib/; $(MAKE) -f Makefile.mingw DESTDIR=$(DESTDIR))
159         @rm -f bacula-fd.exe
160
161 ../lib/libbac.a: ../lib/*.c*
162         (cd ../lib/; $(MAKE) -f Makefile.mingw DESTDIR=$(DESTDIR))
163         @rm -f bacula-fd.exe
164
165 clean:
166         @$(RMF) bacula-fd filed core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
167         @$(RMF) static-bacula-fd
168         if test -f win32/Makefile; then \
169            (cd win32; $(MAKE) clean); \
170         fi
171
172 realclean: clean
173         @$(RMF) tags bacula-fd.conf
174
175 distclean: realclean
176         if test $(srcdir) = .; then $(MAKE) realclean; fi
177         (cd $(srcdir); $(RMF) Makefile; $(RMF) -r CVS)
178         if test -f win32/Makefile; then \
179            (cd win32; $(MAKE) distclean); \
180         fi
181
182 devclean: realclean
183         if test $(srcdir) = .; then $(MAKE) realclean; fi
184         (cd $(srcdir); $(RMF) Makefile)
185         if test -f win32/Makefile; then \
186            (cd win32; $(MAKE) devclean); \
187         fi
188
189 install: all
190         $(INSTALL_PROGRAM) bacula-fd $(DESTDIR)$(sbindir)/bacula-fd 
191         @srcconf=bacula-fd.conf; \
192         if  test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
193            destconf=$$srcconf.new; \
194            echo "  ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
195         else \
196            destconf=$$srcconf; \
197         fi; \
198         echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
199         ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
200         @if test -f static-bacula-fd; then \
201            $(INSTALL_PROGRAM) static-bacula-fd $(DESTDIR)$(sbindir)/static-bacula-fd; \
202         fi
203
204
205
206 uninstall:
207         (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd)
208         (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd.conf)
209         (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd.conf.new)
210
211
212
213 # Semi-automatic generation of dependencies:
214 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
215 # and it also includes system headers.
216 # `semi'-automatic since dependencies are generated at distribution time.
217
218 depend:
219         @$(MV) Makefile Makefile.bak
220         @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
221         @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
222         @$(CC) -S -M $(CPPFLAGS) $(XINC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
223         @if test -f Makefile ; then \
224             $(RMF) Makefile.bak; \
225         else \
226            $(MV) Makefile.bak Makefile; \
227            echo -e "Something went wrong\n\a"; \
228         fi
229
230 # -----------------------------------------------------------------------
231 # DO NOT DELETE: nice dependency list follows