#
# change the following lines to fit your needs
#
CC = gcc -DDEBUG
#OCFLAGS = -W -Wall -Werror -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wbad-function-cast -ansi -pedantic-errors -O2
#
# remove the # in front of the next line if you're using linux
OCFLAGS = -DLINUX

SRCS = main.c print.c socket.c request.c http.c alloc.c filter.c db.c file.c dns.c signals.c access.c regex.c msg.c poll.c cache.c time.c
OBJS = $(SRCS:.c=.o)

MANPAGES = ffproxy.8

PREFIX?=/usr/local
CC?=cc

DATADIR?=/var/ffproxy
SYSCONFDIR?=/etc
CFLAGS = ${OCFLAGS} -DCFGFILE="\"${SYSCONFDIR}/ffproxy.conf\"" -DDATADIR="\"${DATADIR}\""

all: proxy

install:
	install -c ffproxy ${PREFIX}/bin/ffproxy
	install -d ${PREFIX}/man/man8
	install -c ffproxy.8 ${PREFIX}/man/man8/ffproxy.8

proxy: $(OBJS)
	${CC} ${CFLAGS} -o ffproxy $(OBJS)

clean:
	rm -f *.o ffproxy
