MOZSRC = ~/autobuild/mozilla/
BUILDDIR = $(MOZSRC)/../ff-build/ 
DIFF = $(MOZSRC)../pork/"prbool_$(UNIQUE).diff"
ERR_LOG =  $(MOZSRC)../pork/"prbool_$(UNIQUE).err"
BUILD_LOG =  $(MOZSRC)../pork/"build_$(UNIQUE).log"
FILE_LIST =  $(MOZSRC)../pork/"input_files_$(UNIQUE).txt"
export CC = /usr/bin/gcc34 -Wp,-K -Wp,-W0 -save-temps
export CXX = /usr/bin/g++34 -Wp,-K -Wp,-W0 -save-temps
export LD_LIBRARY_PATH=/home/tglek/local/lib/
complain:
	$(MAKE) UNIQUE=`date | sed 's/ /_/g'` complain2 -f check_mozilla.mk

complain2: diff_and_err
	./db_check.py $(MOZSRC) $(DIFF) $(ERR_LOG)

checkout:
	$(MAKE) -C $(MOZSRC) -f client.mk checkout

build:
	rm -fR $(BUILDDIR)
	$(MAKE) -C $(MOZSRC) -f client.mk checkout build 2>&1| cat > $(BUILD_LOG)

diff_and_err: file_list
	./pork-barrel 4 $(FILE_LIST) /home/tglek/work/oink-stack/oink/prcheck > $(DIFF) 2> $(ERR_LOG)

file_list: build 
	find $(BUILDDIR) -name \*.i > $(FILE_LIST)
	find $(BUILDDIR) -name \*.ii >> $(FILE_LIST)

