]> git.sur5r.net Git - bacula/bacula/commitdiff
Makefile for mingw.
authorNicolas Boichat <nicolas@boichat.ch>
Mon, 19 Apr 2004 19:27:50 +0000 (19:27 +0000)
committerNicolas Boichat <nicolas@boichat.ch>
Mon, 19 Apr 2004 19:27:50 +0000 (19:27 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1251 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/filed/Makefile.mingw [new file with mode: 0644]
bacula/src/filed/win32/Makefile.mingw [new file with mode: 0644]
bacula/src/findlib/Makefile.mingw [new file with mode: 0644]

diff --git a/bacula/src/filed/Makefile.mingw b/bacula/src/filed/Makefile.mingw
new file mode 100644 (file)
index 0000000..0b1e154
--- /dev/null
@@ -0,0 +1,231 @@
+#
+# Bacula Makefile for the File daemon
+#
+#  Version $Id$
+#
+
+
+# autoconf/Make.common.in       -*- Makefile -*-
+# release date (man), LSM date, version number/name, current maintainer
+DATE="15 Apr 2004"
+LSMDATE=15Apr04
+VERSION=1.35.0
+VERNAME=bacula-$(VERSION)#
+MAINT=Kern Sibbald#
+MAINTEMAIL=<kern@sibbald.com>#
+WEBMAINT=#
+WEBMAINTEMAIL=#
+WEBPAGE=#
+FTPSITENAME=#
+FTPSITEDIR=#
+#-------------------------------------------------------------------------
+
+SHELL = /bin/sh
+
+# Installation target directories & other installation stuff
+prefix = 
+exec_prefix = 
+binprefix =
+manprefix =
+sbindir = /sbin
+sysconfdir = /etc/bacula
+scriptdir = /etc/bacula
+mandir = ${prefix}/man/man1
+manext = 1
+
+# Tools & program stuff
+CC = gcc
+CPP = gcc -E
+CXX = g++
+MV = /usr/bin/mv
+RM = /usr/bin/rm
+RMF = /usr/bin/rm -f
+CP = /usr/bin/cp
+SED = /usr/bin/sed
+AWK = /usr/bin/awk
+ECHO = /usr/bin/echo
+CMP = /usr/bin/cmp
+TBL = /usr/bin/tbl
+AR = /usr/bin/ar
+RANLIB = /usr/bin/ranlib
+INSTALL = /usr/bin/install -c
+# add the -s to the following in PRODUCTION mode
+INSTALL_PROGRAM = /usr/bin/install -c -m 754
+INSTALL_DATA = /usr/bin/install -c -m 644
+INSTALL_SCRIPT = /usr/bin/install -c -m 754
+INSTALL_CONFIG = /usr/bin/install -c -m 640
+
+# Flags & libs
+CFLAGS = -g -O2 
+CPPFLAGS = 
+LDFLAGS = -O
+TTOOL_LDFLAGS = 
+DEFS = -DHAVE_WIN32 -DHAVE_MINGW
+LIBS = -lpthreadGC -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool \
+       -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lwsock32 \
+       -lmsvcrt
+DINCLUDE = 
+DLIB = 
+DB_LIBS = 
+
+# Windows (cygwin) flags 
+WCFLAGS = -mwindows
+WLDFLAGS = -mwindows -Wl,--subsystem,windows -mthreads
+
+# X Include directory
+#XINC =  @XPM_CFLAGS@
+
+# extra libraries needed by X on some systems, X library location
+#XLIB =  @XPM_LIBS@ -lX11 
+
+# End of common section of the Makefile
+#-------------------------------------------------------------------------
+
+srcdir =       .
+VPATH =        .
+.PATH:         .
+
+# one up
+basedir = ..
+# top dir
+topdir = ../..
+# this dir relative to top dir
+thisdir = src/filed
+
+DEBUG=
+
+first_rule: all
+dummy:
+
+#
+SVRSRCS = filed.c authenticate.c backup.c estimate.c \
+         filed_conf.c heartbeat.c job.c \
+         restore.c status.c verify.c verify_vol.c
+SVROBJS = filed.o authenticate.o backup.o estimate.o \
+         filed_conf.o heartbeat.o job.o \
+         restore.o status.o verify.o verify_vol.o
+
+# these are the objects that are changed by the .configure process
+EXTRAOBJS = 
+
+FDLIBS = -lz             # extra libs for File daemon
+
+# extra items for linking on Win32
+WIN32OBJS = win32/winmain.o win32/winlib.a win32/winres.res
+win32 = $(WIN32OBJS)
+
+WIN32LIBS = $(win32)
+
+.SUFFIXES:     .c .o
+.PHONY:
+.DONTCARE:
+
+# inference rules
+.c.o:
+       $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) -I$(srcdir) -I$(basedir) -I../win32/compat $(DINCLUDE) $(CFLAGS) $<
+#-------------------------------------------------------------------------
+all: win32 bacula-fd 
+       @echo "==== Make of filed is good ===="
+       @echo " "
+
+win32/winlib.a:
+       (cd win32; $(MAKE) -f Makefile.mingw DESTDIR=$(DESTDIR))
+       @rm -f bacula-fd.exe
+
+win32/winmain.o:
+       (cd win32; $(MAKE) -f Makefile.mingw DESTDIR=$(DESTDIR))
+       @rm -f bacula-fd.exe
+
+win32/winres.res:
+       (cd win32; $(MAKE) -f Makefile.mingw DESTDIR=$(DESTDIR))
+       @rm -f bacula-fd.exe
+
+# win32 libraries if needed
+win32: $(WIN32OBJS)
+       (cd win32; $(MAKE) -f Makefile.mingw DESTDIR=$(DESTDIR))
+       @rm -f bacula-fd.exe
+
+bacula-fd:  $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a win32
+       $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(SVROBJS) \
+         $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(LIBS) $(DLIB)
+
+static-bacula-fd:  $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a win32
+       $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../findlib -o $@ $(SVROBJS) \
+          $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(LIBS) $(DLIB)
+       strip $@
+
+../findlib/libfind.a: ../findlib/*.c
+       (cd ../findlib/; $(MAKE) -f Makefile.mingw DESTDIR=$(DESTDIR))
+       @rm -f bacula-fd.exe
+
+../lib/libbac.a: ../lib/*.c*
+       (cd ../lib/; $(MAKE) -f Makefile.mingw DESTDIR=$(DESTDIR))
+       @rm -f bacula-fd.exe
+
+clean:
+       @$(RMF) bacula-fd filed core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
+       @$(RMF) static-bacula-fd
+       if test -f win32/Makefile; then \
+          (cd win32; $(MAKE) clean); \
+       fi
+
+realclean: clean
+       @$(RMF) tags bacula-fd.conf
+
+distclean: realclean
+       if test $(srcdir) = .; then $(MAKE) realclean; fi
+       (cd $(srcdir); $(RMF) Makefile; $(RMF) -r CVS)
+       if test -f win32/Makefile; then \
+          (cd win32; $(MAKE) distclean); \
+       fi
+
+devclean: realclean
+       if test $(srcdir) = .; then $(MAKE) realclean; fi
+       (cd $(srcdir); $(RMF) Makefile)
+       if test -f win32/Makefile; then \
+          (cd win32; $(MAKE) devclean); \
+       fi
+
+install: all
+       $(INSTALL_PROGRAM) bacula-fd $(DESTDIR)$(sbindir)/bacula-fd 
+       @srcconf=bacula-fd.conf; \
+       if  test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
+          destconf=$$srcconf.new; \
+          echo "  ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
+       else \
+          destconf=$$srcconf; \
+       fi; \
+       echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
+       ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
+       @if test -f static-bacula-fd; then \
+          $(INSTALL_PROGRAM) static-bacula-fd $(DESTDIR)$(sbindir)/static-bacula-fd; \
+       fi
+
+
+
+uninstall:
+       (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd)
+       (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd.conf)
+       (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd.conf.new)
+
+
+
+# Semi-automatic generation of dependencies:
+# Use gcc -MM because X11 `makedepend' doesn't work on all systems
+# and it also includes system headers.
+# `semi'-automatic since dependencies are generated at distribution time.
+
+depend:
+       @$(MV) Makefile Makefile.bak
+       @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
+       @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
+       @$(CC) -S -M $(CPPFLAGS) $(XINC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
+       @if test -f Makefile ; then \
+           $(RMF) Makefile.bak; \
+       else \
+          $(MV) Makefile.bak Makefile; \
+          echo -e "Something went wrong\n\a"; \
+       fi
+
+# -----------------------------------------------------------------------
+# DO NOT DELETE: nice dependency list follows
diff --git a/bacula/src/filed/win32/Makefile.mingw b/bacula/src/filed/win32/Makefile.mingw
new file mode 100644 (file)
index 0000000..978699c
--- /dev/null
@@ -0,0 +1,125 @@
+#
+# makefile to build Windows specific pieces of the Bacula File daemon
+#
+# Version $Id$
+#
+CFLAGS=-g -O2 -DHAVE_WIN32 -DHAVE_MINGW
+WCFLAGS=-mwindows -I../../win32/compat
+CC = gcc
+CXX = g++
+RANLIB = /usr/bin/ranlib
+SHELL = /bin/sh
+
+# Program to install `make'.
+INSTALL_PROGRAM = ${INSTALL}
+# Program to install the man page.
+INSTALL_DATA = ${INSTALL} -m 644
+# Generic install program.
+INSTALL = /usr/bin/install -c
+
+VERSION = 1.35.0
+
+
+# this dir
+srcdir = .
+# main dir
+topdir = ../../..
+# this dir relative to top dir
+thisdir = src/filed/win32
+
+# Common prefix for machine-independent installed files.
+prefix = 
+sysconfdir = /etc/bacula
+sbindir = /sbin
+piddir = /var/run
+
+SRCS = shutdown.c
+
+OBJS = shutdown.o
+
+BACOBJS = winabout.o winevents.o winservice.o winstat.o wintray.o winmain.o
+
+all: winlib.a winres.res 
+
+win32: winlib.a
+
+winlib.a: $(BACOBJS) winres.res
+       ar rcs $@ $(BACOBJS)
+
+winres.res: winres.rc bacula.ico winres.h idle.ico running.ico error.ico
+       windres -DHAVE_MINGW $< -O coff -o $@
+
+winmain.o: winmain.cpp winbacula.h
+       $(CC) -c $(WCFLAGS) $(CFLAGS) $<
+
+libmymapi32.a: mymapi32.def
+       dlltool --as=as -k --output-lib $@ --def $<
+
+Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
+       cd $(topdir) \
+         && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+clean:
+       rm -f *.exe *.o *.res *.a 1 2 3
+       rm -f bin/smtp.exe bin/console.exe
+       rm -f bin/bacula-fd.exe bin/bsmtp.exe bin/testfind.exe
+
+distclean: clean
+       @rm -f Makefile
+       @rm -rf bin/CVS CVS
+
+devclean: clean
+       @rm -f Makefile
+
+install:
+       @mkdir -p $(DESTDIR)$(sbindir) $(DESTDIR)/tmp $(DESTDIR)$(sbindir)/../working
+       @echo "Installing system binary files ..."
+       @strip ../bacula-fd.exe
+       @strip ../../tools/bsmtp.exe
+       @strip ../../tools/testfind.exe
+       @strip ../../console/bconsole.exe
+       @cp -f ../bacula-fd.exe bin/
+       @cp -f ../../tools/bsmtp.exe bin/
+       @cp -f ../../tools/testfind.exe bin/
+       @cp -f ../../console/bconsole.exe bin/
+       @cp -f bin/* $(DESTDIR)$(sbindir)
+       @cp -f ../bacula-fd.conf $(DESTDIR)$(sysconfdir)/bacula-fd.conf.new
+       @cp -f ../../console/bconsole.conf $(DESTDIR)$(sysconfdir)/bconsole.conf.new
+
+# Make a Win32 binary release 
+binary-release:
+       @rm -rf wr
+       @mkdir -p wr
+       @mkdir -p wr/$(prefix) wr/$(sbindir) wr/$(sbindir)/../working wr/$(sysconfdir) wr/tmp
+       @echo "Copying system binary files ..."
+       @cp bin/* wr/$(sbindir)
+       @strip ../bacula-fd.exe
+       @strip ../../tools/bsmtp.exe
+       @strip ../../tools/testfind.exe
+       @strip ../../console/bconsole.exe
+       @echo "Copying executables ..."
+       @cp -f ../bacula-fd.exe wr/$(sbindir)/bacula-fd.exe 
+       @cp -f ../../tools/bsmtp.exe wr/$(sbindir)/bsmtp.exe 
+       @cp -f ../../tools/testfind.exe wr/$(sbindir)/testfind.exe 
+       @cp -f ../../console/bconsole.exe wr/$(sbindir)/bconsole.exe 
+       @echo "Copying bacula-fd.conf..."
+       @cp -f ../bacula-fd.conf wr/$(sysconfdir)/bacula-fd.conf.new
+       @cp -f ../../console/bconsole.conf wr/$(sysconfdir)/bconsole.conf.new
+# the two dummy files are necessary to insure that WinZip
+# actually creates the directories.
+       @echo "dummy" >wr/tmp/dummy.txt
+       @echo "dummy" >wr/$(sbindir)/../working/dummy.txt
+       @echo "Making tar file ..."
+       @tar cfz winbacula-${VERSION}.tar.gz -C wr bacula tmp
+       @mv -f winbacula-${VERSION}.tar.gz $(topdir)/..
+       @rm -rf wr
+       @(cd $(topdir)/..; \
+          echo "Tar file in: `pwd`/winbacula-${VERSION}.tar.gz")
+
+dummy:
+
+.c.o:
+       $(CC) -c $(WCFLAGS) $(CFLAGS) $<
+
+.cpp.o:
+       $(CXX) -c $(WCFLAGS) $(CFLAGS) $<
diff --git a/bacula/src/findlib/Makefile.mingw b/bacula/src/findlib/Makefile.mingw
new file mode 100644 (file)
index 0000000..5cc0fdd
--- /dev/null
@@ -0,0 +1,162 @@
+#
+#  Find files library Makefile
+#
+
+# autoconf/Make.common.in       -*- Makefile -*-
+# release date (man), LSM date, version number/name, current maintainer
+DATE="15 Apr 2004"
+LSMDATE=15Apr04
+VERSION=1.35.0
+VERNAME=bacula-$(VERSION)#
+MAINT=Kern Sibbald#
+MAINTEMAIL=<kern@sibbald.com>#
+WEBMAINT=#
+WEBMAINTEMAIL=#
+WEBPAGE=#
+FTPSITENAME=#
+FTPSITEDIR=#
+#-------------------------------------------------------------------------
+
+SHELL = /bin/sh
+
+# Installation target directories & other installation stuff
+prefix = 
+exec_prefix = 
+binprefix =
+manprefix =
+sbindir = /sbin
+sysconfdir = /etc/bacula
+scriptdir = /etc/bacula
+mandir = ${prefix}/man/man1
+manext = 1
+
+# Tools & program stuff
+CC = gcc
+CPP = gcc -E
+CXX = g++
+MV = /usr/bin/mv
+RM = /usr/bin/rm
+RMF = /usr/bin/rm -f
+CP = /usr/bin/cp
+SED = /usr/bin/sed
+AWK = /usr/bin/awk
+ECHO = /usr/bin/echo
+CMP = /usr/bin/cmp
+TBL = /usr/bin/tbl
+AR = ar
+RANLIB = ranlib
+INSTALL = /usr/bin/install -c
+# add the -s to the following in PRODUCTION mode
+INSTALL_PROGRAM = /usr/bin/install -c -m 754
+INSTALL_DATA = /usr/bin/install -c -m 644
+INSTALL_SCRIPT = /usr/bin/install -c -m 754
+INSTALL_CONFIG = /usr/bin/install -c -m 640
+
+# Flags & libs
+CFLAGS = -g -O2 
+CPPFLAGS = 
+LDFLAGS = -O
+TTOOL_LDFLAGS = 
+DEFS = -DHAVE_WIN32 -DHAVE_MINGW
+LIBS = -lpthread
+DINCLUDE = 
+DLIB = 
+DB_LIBS = 
+
+# Windows (cygwin) flags 
+WCFLAGS = -mwindows
+WLDFLAGS = -mwindows
+
+# X Include directory
+#XINC =  @XPM_CFLAGS@
+
+# extra libraries needed by X on some systems, X library location
+#XLIB =  @XPM_LIBS@ -lX11 
+
+# End of common section of the Makefile
+#-------------------------------------------------------------------------
+
+srcdir =       .
+VPATH =        .
+.PATH:         .
+
+# one up
+basedir = ..
+# top dir
+topdir = ../..
+# this dir relative to top dir
+thisdir = src/findlib
+
+DEBUG=
+
+first_rule: all
+dummy:
+
+#
+LIBSRCS = find.c match.c find_one.c attibs.c create_file.c \
+         bfile.c enable_priv.c makepath.c save-cwd.c winapi.c
+LIBOBJS = find.o match.o find_one.o attribs.o create_file.o \
+         bfile.o enable_priv.o makepath.o save-cwd.o winapi.o
+
+.SUFFIXES:     .c .o
+.PHONY:
+.DONTCARE:
+
+# inference rules
+.c.o:
+       $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) -I$(srcdir) -I$(basedir) -I../win32/compat $(DINCLUDE) $(CFLAGS) $<
+#-------------------------------------------------------------------------
+all: libfind.a
+       @echo "==== Make of findlib is good ===="
+       @echo " "
+
+libfind.a: $(LIBOBJS)
+       $(RMF) $@
+       $(AR) cr $@ $(LIBOBJS)
+       $(RANLIB) $@
+
+install:
+
+uninstall:
+
+
+clean:
+       $(RMF) find core a.out *.a *.o *.bak *~ *.intpro *.extpro 1 2 3
+
+realclean: clean
+       $(RMF) tags
+
+distclean: realclean
+       if test $(srcdir) = .; then $(MAKE) realclean; fi
+       (cd $(srcdir); $(RMF) Makefile; $(RMF) -r CVS)
+
+devclean: realclean
+       if test $(srcdir) = .; then $(MAKE) realclean; fi
+       (cd $(srcdir); $(RMF) Makefile)
+
+install:
+
+
+uninstall:
+
+
+
+# Semi-automatic generation of dependencies:
+# Use gcc -M  because X11 `makedepend' doesn't work on all systems
+# and it also includes system headers.
+# `semi'-automatic since dependencies are generated at distribution time.
+
+depend:
+       @$(MV) Makefile Makefile.bak
+       @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
+       @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
+       @$(CC) -S -M $(CPPFLAGS) $(XINC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
+       @if test -f Makefile ; then \
+           $(RMF) Makefile.bak; \
+       else \
+          $(MV) Makefile.bak Makefile; \
+          echo -e "Something went wrong\n\a"; \
+       fi
+
+# -----------------------------------------------------------------------
+# DO NOT DELETE: nice dependency list follows