#
# AUTOMATICALLY GENERATED FILE
#    do not edit!
#
#
CXX = c++
AR = ar
RANLIB = ranlib
PERL = /usr/pkg/bin/perl
WINDRES = 

DEFAULT_CXXFLAGS = -I/usr/include -O2 -D_FORTIFY_SOURCE=2 -I/usr/include -Wall -Wundef \
	-I../../lib/win32 -I../../lib/common -I../../lib/compress -I../../lib/crypto -I../../lib/server -I../../lib/backupclient  \
	-DBOX_VERSION="\"0.11.1\""
LDFLAGS = -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -rdynamic

ifdef RELEASE
CXXFLAGS = -DBOX_RELEASE_BUILD -O2 $(DEFAULT_CXXFLAGS)
OUTBASE = ../../release
OUTDIR = ../../release/bin/bbackupquery
DEPENDMAKEFLAGS = RELEASE=1
VARIENT = RELEASE
else
CXXFLAGS = -g $(DEFAULT_CXXFLAGS)
OUTBASE = ../../debug
OUTDIR = ../../debug/bin/bbackupquery
DEPENDMAKEFLAGS =
VARIENT = DEBUG
endif

HIDE     = $(if $(V),,@)
_CXX     = $(if $(V),$(CXX),     @ echo "  [CXX]     $<" && $(CXX))
_LINK    = $(if $(V),$(CXX),     @ echo "  [LINK]    $@" && $(CXX))
_WINDRES = $(if $(V),$(WINDRES), @ echo "  [WINDRES] $<" && $(WINDRES))
_AR      = $(if $(V),$(AR),      @ echo "  [AR]      $@" && $(AR))
_RANLIB  = $(if $(V),$(RANLIB),  @ echo "  [RANLIB]  $@" && $(RANLIB))
_PERL    = $(if $(V),$(PERL),    @ echo "  [PERL]    $@" && $(PERL) >/dev/null)

.PHONY: all
all: dep_modules $(OUTDIR)/bbackupquery

$(OUTDIR)/bbackupquery: $(OUTDIR)/BackupQueries.o $(OUTDIR)/autogen_Documentation.o $(OUTDIR)/bbackupquery.o $(OUTBASE)/lib/backupclient/backupclient.a $(OUTBASE)/lib/server/server.a $(OUTBASE)/lib/crypto/crypto.a $(OUTBASE)/lib/compress/compress.a $(OUTBASE)/lib/common/common.a $(OUTBASE)/lib/win32/win32.a
	$(_LINK) $(LDFLAGS)  -o $(OUTDIR)/bbackupquery $(OUTDIR)/BackupQueries.o $(OUTDIR)/autogen_Documentation.o $(OUTDIR)/bbackupquery.o $(OUTBASE)/lib/backupclient/backupclient.a $(OUTBASE)/lib/server/server.a $(OUTBASE)/lib/crypto/crypto.a $(OUTBASE)/lib/compress/compress.a $(OUTBASE)/lib/common/common.a $(OUTBASE)/lib/win32/win32.a -lcrypto -lssl -lz -lexecinfo

.PHONY:	dep_modules
dep_modules:
ifndef NODEPS
ifeq ($(strip $(.TARGETS)),)
		$(HIDE) (cd ../../lib/win32; $(MAKE) -q $(DEPENDMAKEFLAGS) NODEPS=1 || $(MAKE) $(DEPENDMAKEFLAGS) NODEPS=1)
		$(HIDE) (cd ../../lib/common; $(MAKE) -q $(DEPENDMAKEFLAGS) NODEPS=1 || $(MAKE) $(DEPENDMAKEFLAGS) NODEPS=1)
		$(HIDE) (cd ../../lib/compress; $(MAKE) -q $(DEPENDMAKEFLAGS) NODEPS=1 || $(MAKE) $(DEPENDMAKEFLAGS) NODEPS=1)
		$(HIDE) (cd ../../lib/crypto; $(MAKE) -q $(DEPENDMAKEFLAGS) NODEPS=1 || $(MAKE) $(DEPENDMAKEFLAGS) NODEPS=1)
		$(HIDE) (cd ../../lib/server; $(MAKE) -q $(DEPENDMAKEFLAGS) NODEPS=1 || $(MAKE) $(DEPENDMAKEFLAGS) NODEPS=1)
		$(HIDE) (cd ../../lib/backupclient; $(MAKE) -q $(DEPENDMAKEFLAGS) NODEPS=1 || $(MAKE) $(DEPENDMAKEFLAGS) NODEPS=1)
endif
endif

$(OUTDIR)/bbackupquery.o: bbackupquery.cpp ../../lib/common/Logging.h ../../lib/common/BoxPlatform.h ../../lib/common/BoxConfig-MSVC.h ../../lib/common/Box.h ../../lib/backupclient/BackupStoreFilename.h ../../lib/common/CommonException.h ../../lib/common/BannerText.h ../../lib/win32/emu.h ../../lib/backupclient/BackupStoreFilenameClear.h ../../lib/server/SSLLib.h ../../lib/common/FdGetLine.h ../../lib/common/MemLeakFindOff.h ../../lib/common/ExcludeList.h ../../lib/common/IOStream.h ../../lib/win32/getopt.h ../../lib/backupclient/BackupClientMakeExcludeList.h ../../lib/common/FileStream.h ../../lib/server/SocketStreamTLS.h BoxBackupCompareParams.h ../../lib/backupclient/BackupDaemonConfigVerify.h ../../lib/common/Utils.h ../../lib/backupclient/BackupClientCryptoKeys.h ../../lib/common/BoxConfig.h ../../lib/common/MemLeakFindOn.h ../../lib/common/MemLeakFinder.h ../../lib/backupclient/BackupStoreException.h ../../lib/common/BoxPortsAndFiles.h ../../lib/common/BoxTime.h ../../lib/server/SocketStream.h ../../lib/server/ProtocolObject.h ../../lib/server/Socket.h ../../lib/server/Protocol.h ../../lib/backupclient/autogen_BackupProtocolClient.h ../../lib/common/Configuration.h ../../lib/common/BoxException.h ../../lib/server/ServerException.h ../../lib/common/MainHelper.h ../../lib/backupclient/BackupStoreConstants.h BackupQueries.h ../../lib/server/TLSContext.h
	$(_CXX) $(CXXFLAGS)  -DBOX_MODULE="\"bin/bbackupquery\"" -c bbackupquery.cpp -o $(OUTDIR)/bbackupquery.o

$(OUTDIR)/BackupQueries.o: BackupQueries.cpp ../../lib/backupclient/RunStatusProvider.h ../../lib/common/Logging.h ../../lib/common/BoxTimeToText.h ../../lib/common/Box.h ../../lib/common/BoxConfig-MSVC.h ../../lib/common/BoxPlatform.h ../../lib/backupclient/BackupStoreDirectory.h ../../lib/backupclient/BackupStoreFilename.h ../../lib/common/CommonException.h ../../lib/backupclient/BackupStoreFilenameClear.h ../../lib/win32/emu.h ../../lib/common/IOStream.h ../../lib/backupclient/BackupClientFileAttributes.h ../../lib/common/ExcludeList.h ../../lib/common/MemLeakFindOff.h ../../lib/common/TemporaryDirectory.h ../../lib/backupclient/BackupClientRestore.h ../../lib/common/FileStream.h ../../lib/backupclient/BackupClientMakeExcludeList.h ../../lib/win32/getopt.h BoxBackupCompareParams.h ../../lib/common/MemLeakFindOn.h ../../lib/common/BoxConfig.h ../../lib/common/Utils.h ../../lib/common/MemLeakFinder.h ../../lib/backupclient/BackupStoreFile.h ../../lib/common/BoxTime.h ../../lib/backupclient/BackupStoreException.h ../../lib/common/PathUtils.h ../../lib/server/ProtocolObject.h ../../lib/common/StreamableMemBlock.h ../../lib/backupclient/autogen_BackupProtocolClient.h ../../lib/common/SelfFlushingStream.h ../../lib/server/Protocol.h ../../lib/common/FileModificationTime.h ../../lib/server/ServerException.h ../../lib/common/Configuration.h ../../lib/common/ReadLoggingStream.h BackupQueries.h
	$(_CXX) $(CXXFLAGS)  -DBOX_MODULE="\"bin/bbackupquery\"" -c BackupQueries.cpp -o $(OUTDIR)/BackupQueries.o

$(OUTDIR)/autogen_Documentation.o: autogen_Documentation.cpp ../../lib/win32/getopt.h ../../lib/common/FileStream.h ../../lib/common/MemLeakFindOff.h ../../lib/common/IOStream.h ../../lib/win32/emu.h ../../lib/common/CommonException.h ../../lib/common/BoxConfig-MSVC.h ../../lib/common/BoxPlatform.h ../../lib/common/Box.h ../../lib/common/Logging.h ../../lib/common/MemLeakFinder.h ../../lib/common/BoxConfig.h ../../lib/common/MemLeakFindOn.h ../../lib/common/Utils.h
	$(_CXX) $(CXXFLAGS)  -DBOX_MODULE="\"bin/bbackupquery\"" -c autogen_Documentation.cpp -o $(OUTDIR)/autogen_Documentation.o


clean:
	-rm -rf $(OUTDIR)/*
ifndef SUBCLEAN
	$(HIDE) (cd ../../lib/win32; $(MAKE) $(DEPENDMAKEFLAGS) SUBCLEAN=1 clean)
	$(HIDE) (cd ../../lib/common; $(MAKE) $(DEPENDMAKEFLAGS) SUBCLEAN=1 clean)
	$(HIDE) (cd ../../lib/compress; $(MAKE) $(DEPENDMAKEFLAGS) SUBCLEAN=1 clean)
	$(HIDE) (cd ../../lib/crypto; $(MAKE) $(DEPENDMAKEFLAGS) SUBCLEAN=1 clean)
	$(HIDE) (cd ../../lib/server; $(MAKE) $(DEPENDMAKEFLAGS) SUBCLEAN=1 clean)
	$(HIDE) (cd ../../lib/backupclient; $(MAKE) $(DEPENDMAKEFLAGS) SUBCLEAN=1 clean)
endif


include Makefile.extra


buildsystem:
	(cd ../..; perl ./infrastructure/makebuildenv.pl )

