#
#	Makefile for tproxy.
#
#
# Currently supported OPTIONS flags are
#	DEBUG			Print some stuff to stdout on start up.
#	DNS_LOOKUPS		Looks up the hostnames to translate the HTTP request.
#	USELESS_DNS_LOOKUPS	Looks up the hostnames only needed for the log files.
#	PAY_THE_PENALTY		Slow down if they don't use proxy directly.
#	TRANSLATE_PATH		Set this to the path of your translation table.
#				Translations will be enable only if this is set.
#	MAX_TRANSLATIONS	The number of entries in the translation table.
#				Only looked at if TRANSLATE_PATH is defined.

OPTIONS=-DDNS_LOOKUPS #-DUSELESS_DNS_LOOKUPS

CC=cc
CFLAGS=-O2 -m486 -Wall $(OPTIONS)
LDFLAGS=-s
LIBS=-lresolv

RM=rm -f
INSTALL=install

TARGETNAME=in.tproxyd

tproxy:		tproxy.o
	$(CC) $(LDFLAGS) tproxy.o -o $@ $(LIBS)

tproxy.o:	tproxy.c
	$(CC) $(CFLAGS) -c tproxy.c

clean:
	$(RM) tproxy.o

dist-clean:	clean
	$(RM) tproxy

install:	tproxy
	$(INSTALL) -o bin -g bin -m 555 tproxy /usr/sbin/$(TARGETNAME)
	if test -f /etc/translate.tab ; then echo "Skipping translation table install" ;\
	else $(INSTALL) -o root -g root -m 644 translate.tab /etc ; fi

