############################ -*- Mode: Makefile -*- ###########################
## GNUmakefile -- 
## Copyright 2004 Raider Solutions, Inc.
## 
##   This program is free software; you can redistribute it and/or
##   modify it under the terms of the GNU General Public License as
##   published by the Free Software Foundation; either version 2 of
##   the License, or (at your option) any later version.
##
##   This program is distributed in the hope that it will be useful,
##   but WITHOUT ANY WARRANTY; without even the implied warranty of
##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
##   General Public License for more details.
##
##   You should have received a copy of the GNU General Public
##   License along with this program; if not, write to the Free
##   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
##   MA 02111-1307, USA.
## 
## 
## Author          : Christopher S. Hull
## Created On      : Mon Feb  9 12:39:54 2004
## Last Modified By: Christopher S. Hull
## Last Modified On: Mon Feb  9 12:40:45 2004
## Update Count    : 5
## $Id: GNUmakefile,v 1.1 2004/02/10 13:47:34 kerns Exp $
###############################################################################


default: zlib pthreads bacula-fd installer

zlib:  _dummy
	(cd zlib; env MAKEFLAGS= nmake /f win32/Makefile.msc)

pthreads: _dummy
	(cd pthreads; env MAKEFLAGS= nmake VCE)

bacula-fd: _dummy
	(cd baculafd; make)


clean:
	(cd zlib; env MAKEFLAGS= nmake /f win32/Makefile.msc clean)
	(cd pthreads; env MAKEFLAGS= nmake clean)
	(cd baculafd; make clean)

distclean: clean
	(cd baculafd; /bin/rm -f baculafd.opt baculafd.plg baculafd.dep baculafd.clw baculafd.aps baculafd.ncb)
	/bin/rm -rf baculafd/Release baculafd/Debug
	/bin/rm -f pthreads/*.lib pthreads/*.dll 
	/bin/rm -f rsi-install.exe bacula-install.exe
	-find . -name \*~ | xargs -r /bin/rm

installer: rsi-install.exe bacula-install.exe

_dummy:

rsi-install.exe: pthreads/pthreadVCE.dll baculafd/Release/bacula-fd.exe rsi.nsi rsi/License.txt
	/programs/NSIS/makensis rsi.nsi

bacula-install.exe: pthreads/pthreadVCE.dll baculafd/Release/bacula-fd.exe bacula.nsi License.txt
	/programs/NSIS/makensis bacula.nsi

