#
# 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  \
	-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/test/compress
DEPENDMAKEFLAGS = RELEASE=1
VARIENT = RELEASE
else
CXXFLAGS = -g $(DEFAULT_CXXFLAGS)
OUTBASE = ../../debug
OUTDIR = ../../debug/test/compress
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)/test

$(OUTDIR)/test: $(OUTDIR)/_main.o $(OUTDIR)/testcompress.o $(OUTBASE)/lib/compress/compress.a $(OUTBASE)/lib/common/common.a $(OUTBASE)/lib/win32/win32.a
	$(_LINK) $(LDFLAGS)  -o $(OUTDIR)/test $(OUTDIR)/_main.o $(OUTDIR)/testcompress.o $(OUTBASE)/lib/compress/compress.a $(OUTBASE)/lib/common/common.a $(OUTBASE)/lib/win32/win32.a -lcrypto -lssl -lz -lexecinfo
	cp _t $(OUTDIR)/t
	chmod u+x $(OUTDIR)/t
	cp _t-gdb $(OUTDIR)/t-gdb
	chmod u+x $(OUTDIR)/t-gdb

.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)
endif
endif

$(OUTDIR)/testcompress.o: testcompress.cpp ../../lib/win32/emu.h ../../lib/common/Test.h ../../lib/common/CommonException.h ../../lib/common/BoxConfig-MSVC.h ../../lib/common/BoxPlatform.h ../../lib/common/MemLeakFinder.h ../../lib/common/Box.h ../../lib/common/BoxConfig.h ../../lib/common/MemLeakFindOn.h ../../lib/common/Utils.h ../../lib/common/Logging.h ../../lib/compress/Compress.h ../../lib/common/Guards.h ../../lib/common/CollectInBufferStream.h ../../lib/win32/getopt.h ../../lib/common/FileStream.h ../../lib/compress/CompressStream.h ../../lib/common/MemLeakFindOff.h ../../lib/compress/CompressException.h ../../lib/common/IOStream.h
	$(_CXX) $(CXXFLAGS)  -DBOX_MODULE="\"test/compress\"" -c testcompress.cpp -o $(OUTDIR)/testcompress.o

$(OUTDIR)/_main.o: _main.cpp ../../lib/win32/getopt.h ../../lib/common/FileStream.h ../../lib/common/MemLeakFindOff.h ../../lib/common/IOStream.h ../../lib/common/Timer.h ../../lib/win32/emu.h ../../lib/common/CommonException.h ../../lib/common/BoxTime.h ../../lib/common/Test.h ../../lib/common/BoxPlatform.h ../../lib/common/BoxConfig-MSVC.h ../../lib/common/Box.h ../../lib/common/MemLeakFinder.h ../../lib/common/Logging.h ../../lib/common/Utils.h ../../lib/common/MemLeakFindOn.h ../../lib/common/BoxConfig.h
	$(_CXX) $(CXXFLAGS)  -DBOX_MODULE="\"test/compress\"" -c _main.cpp -o $(OUTDIR)/_main.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)
endif



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

