]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/win32/filed/plugins/Makefile
Another file to add James' code to get VssObject
[bacula/bacula] / bacula / src / win32 / filed / plugins / Makefile
1 #
2 # Makefile for win32 bacula executables
3 # Using MinGW cross-compiler on GNU/Linux
4 #
5 #  Written by James Harper, October 2008
6 #     Patterned after a Makefile by Robert Nelson, June 2006
7 #
8
9 #
10 # Change the following depending on where this directory is located
11 #  in the Bacula tree.  It should point to the src/win32 directory.
12 BUILDDIR = ../..
13
14 include $(BUILDDIR)/Makefile.inc
15
16 INCLUDES = \
17         $(INCLUDE_PTHREADS) \
18         $(INCLUDE_BACULA) \
19         $(INCLUDE_ZLIB) \
20         $(INCLUDE_OPENSSL) \
21         -I$(MAINDIR)/src \
22         -I$(MAINDIR)/src/filed \
23         -I$(MAINDIR)/src/win32/filed
24
25 DEFINES = \
26         $(HAVES)
27
28 #vpath %.c $(BUILDDIR)/compat $(MAINDIR)/src/findlib $(MAINDIR)/src/lib
29 #vpath %.cpp $(BUILDDIR)/compat $(MAINDIR)/src/findlib $(MAINDIR)/src/lib
30
31 ######################################################################
32
33 # Files files in src/win32/filed/plugins
34
35 EXCHANGE_OBJS = \
36         $(OBJDIR)/exchange-fd.o \
37         $(OBJDIR)/api.o \
38         $(OBJDIR)/node.o \
39         $(OBJDIR)/root_node.o \
40         $(OBJDIR)/service_node.o \
41         $(OBJDIR)/storage_group_node.o \
42         $(OBJDIR)/store_node.o \
43         $(OBJDIR)/dbi_node.o \
44         $(OBJDIR)/file_node.o
45
46 SYSTEMSTATE_OBJS = \
47         $(OBJDIR)/systemstate-fd.o
48
49 LIBS_DLL = \
50         $(LIBS_SSL) \
51         $(LIBS_CRYPTO) \
52         $(LIBS_PTHREADS) \
53         $(LIBS_ZLIB) \
54         $(LIBS_NETWORK) \
55         -lole32 \
56         -loleaut32 \
57         -luuid
58
59 ######################################################################
60
61 # Targets
62
63 .PHONY: all clean
64
65 all: $(BINDIR)/exchange-fd.dll $(BINDIR)/systemstate-fd.dll
66
67 clean:
68         @echo "Cleaning `pwd`"
69         $(call clean_obj,$(EXCHANGE_OBJS))
70         $(call clean_exe,$(BINDIR)/exchange-fd.dll)
71         $(ECHO_CMD)rm -f $(OBJDIR)/exchange-fd.a $(LIBDIR)/libexchange-fd.a
72         $(call clean_obj,$(SYSTEMSTATE_OBJS))
73         $(call clean_exe,$(BINDIR)/systemstate-fd.dll)
74         $(ECHO_CMD)rm -f $(OBJDIR)/systemstate-fd.a $(LIBDIR)/libsystemstate-fd.a
75         $(ECHO_CMD)rm -rf $(OBJDIRS)
76
77 #
78 # Rules for generating from ../lib
79 #
80
81 #$(LIBDIR)/libexchange-fd.a: DLL_DEFINE=USING_DLL
82
83 #$(LIBDIR)/libexchange-fd.a: $(BINDIR)/exchange-fd.dll $(STATIC_OBJS)
84 #       @echo "Updating archive $@"
85 #       $(call checkdir,$@)
86 #       $(ECHO_CMD)cp $(OBJDIR)/exchange-fd.a $@
87 #       $(ECHO_CMD)$(AR) rsv $@ $(filter %.o,$^)
88
89 $(BINDIR)/exchange-fd.dll: DLL_DEFINE=BUILDING_DLL
90
91 $(BINDIR)/exchange-fd.dll: $(EXCHANGE_OBJS) exchange-fd.def
92         @echo "Linking $@"
93         $(call checkdir,$@)
94         $(ECHO_CMD)$(CXX) $(LDFLAGS) -mdll -mwindows -Wl,--out-implib,$(OBJDIR)/exchange-fd.a $^ $(LIBS_DLL) -o $@
95
96 $(BINDIR)/systemstate-fd.dll: DLL_DEFINE=BUILDING_DLL
97
98 $(BINDIR)/systemstate-fd.dll: $(SYSTEMSTATE_OBJS) systemstate-fd.def
99         @echo "Linking $@"
100         $(call checkdir,$@)
101         $(ECHO_CMD)$(CXX) $(LDFLAGS) -mdll -mwindows -Wl,--out-implib,$(OBJDIR)/systemstate-fd.a $^ $(LIBS_DLL) -o $@
102
103
104 include $(BUILDDIR)/Makefile.rules
105
106 $(OBJDIR)/%.o: %.c
107         @echo "Compiling $<"
108         $(call checkdir,$@)
109         $(ECHO_CMD)$(CXX) -D$(DLL_DEFINE) $(CFLAGS) -c $< -o $@
110
111 $(OBJDIR)/%.o: %.cpp
112         @echo "Compiling $<"
113         $(call checkdir,$@)
114         $(ECHO_CMD)$(CXX) -D$(DLL_DEFINE) $(CFLAGS) -c $< -o $@