2 # Makefile for win32 bacula executables
3 # Using MinGW cross-compiler on GNU/Linux
5 # Written by Robert Nelson, June 2006
8 include ../Makefile.inc
19 vpath %.c $(BUILDDIR)/compat $(MAINDIR)/src/findlib $(MAINDIR)/src/lib
20 vpath %.cpp $(BUILDDIR)/compat $(MAINDIR)/src/findlib $(MAINDIR)/src/lib
22 ######################################################################
24 # Files files in src/lib
31 # $(OBJDIR)/getopt.o \
36 $(OBJDIR)/create_file.o \
37 $(OBJDIR)/drivetype.o \
38 $(OBJDIR)/enable_priv.o \
40 $(OBJDIR)/find_one.o \
46 $(OBJDIR)/address_conf.o \
51 $(OBJDIR)/bget_msg.o \
53 $(OBJDIR)/bnet_server.o \
58 $(OBJDIR)/bsnprintf.o \
62 $(OBJDIR)/cram-md5.o \
69 $(OBJDIR)/guid_to_name.o \
75 $(OBJDIR)/mem_pool.o \
79 $(OBJDIR)/pythonlib.o \
82 $(OBJDIR)/runscript.o \
88 $(OBJDIR)/smartall.o \
93 $(OBJDIR)/watchdog.o \
98 $(COMPAT_OBJS) $(FIND_OBJS) $(LIB_OBJS)
101 $(OBJDIR)/parse_conf.o \
105 $(DLL_OBJS) $(STATIC_OBJS)
117 ######################################################################
123 all: $(BINDIR)/bacula.dll $(LIBDIR)/libbacula.a
126 @echo "Cleaning `pwd`"
127 $(call clean_obj,$(ALL_OBJS))
128 $(call clean_exe,$(BINDIR)/bacula.dll)
129 $(ECHO_CMD)rm -f $(OBJDIR)/bacula.a $(LIBDIR)/libbacula.a
130 $(ECHO_CMD)rm -rf $(OBJDIRS)
133 # Rules for generating from ../lib
136 $(LIBDIR)/libbacula.a: DLL_DEFINE=USING_DLL
138 $(LIBDIR)/libbacula.a: $(BINDIR)/bacula.dll $(STATIC_OBJS)
139 @echo "Updating archive $@"
141 $(ECHO_CMD)cp $(OBJDIR)/bacula.a $@
142 $(ECHO_CMD)$(AR) rsv $@ $(filter %.o,$^)
144 $(BINDIR)/bacula.dll: DLL_DEFINE=BUILDING_DLL
146 $(BINDIR)/bacula.dll: $(DLL_OBJS) bacula$(WIN_VERSION).def
149 $(ECHO_CMD)$(CXX) $(LDFLAGS) -mdll -mwindows -Wl,--out-implib,$(OBJDIR)/bacula.a $^ $(LIBS_DLL) -o $@
151 include ../Makefile.rules
156 $(ECHO_CMD)$(CXX) -D$(DLL_DEFINE) $(CFLAGS) -c $< -o $@
161 $(ECHO_CMD)$(CXX) -D$(DLL_DEFINE) $(CFLAGS) -c $< -o $@