# Makefile for the Natasha bot

CC=gcc

TARGET = natasha

CFLAGS=-I./ -Wall -O3
LDLIBS=-L/usr/local/lib/mysql -lmysqlclient -ldl -lpthread -lpcre -rdynamic

SRC = src/bot.c src/database.c src/memory.c src/irccommands.c src/channels.c src/chattr.tab.c
OBJS=$(SRC:.c=.o)

all:  $(OBJS)
	$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) $(LDLIBS)

.c.o:
	$(CC) $(CFLAGS) -c -o $@ $<

modules_all:
	cd src/modules ; make
modules_clean:                                                                                                                                
	cd src/modules ; make clean
clean:
	rm src/*.o natasha

distclean:
	rm src/*.o src/*~ natasha modules/*.so *.rrd graph/*.gif tv
	make modules_clean

