CFLAGS=-O -std=c++98 -Wall
#CFLAGS=-g -std=c++98 -Wall

deafault:
	make title-bot

all:
	make clean
	make title-bot

btree:btree.o
	c++ btree.o -o btree

btree.o:btree.cpp
	c++ btree.cpp -c

kill:killall
	./killall -9 bot
	./killall -9 wget

init:
	make title-bot
	rm -f temp/*.txt
	rm -f url.db
	rm -f list.dat
	printf "" > title-bot.txt

killall:killall.cpp
	c++ ${CFLAGS} -Wall -std=c++98 killall.cpp -o killall

tcp_stream.o:tcp_stream.h tcp_stream.cpp
	c++ ${CFLAGS} tcp_stream.cpp -c

title-bot:title-bot.o tcp_stream.o
	c++ ${CFLAGS} tcp_stream.o title-bot.o -o title-bot
	strip ./title-bot

tcp_stream6.o:tcp_stream6.cpp
	c++ ${CFLAGS} tcp_stream6.cpp -c 

title-bot.o:title-bot.cpp btree2.h title-bot.h
	c++ ${CFLAGS} title-bot.cpp -c 

test:
	#make init
	./title-bot http://www.internic.com/

fresh:
	make init
	rm -f list.dat
	rm -f url.db
	rm -f title-bot.txt
	rm -f temp/*.txt
	./title-bot http://www.internic.com/ -init

clean:
	rm -f *.core
	rm -f *.o
	rm -f title-bot
