# the directory for the configuration file
CONFIGDIR=/usr/local/etc

#the directory for the portato binary
BINDIR=/usr/local/bin

# compiler
CC = gcc

# compiler options (uncomment only one)
# standard version
CFLAGS = -Wall -m486 -O2
# with profiling
#CFLAGS = -Wall -m486 -O2 -DPROFILE
# with profiling, debugging, and a test-only version
#CFLAGS = -g -DTESTCOMPILE -DPROFILE -DDEBUG

portato: portato.o
	$(CC) -o portato portato.o
	strip portato
	chown root portato
	chmod 4755 portato

install: portato portato.conf
	cp portato.conf $(CONFIGDIR)/portato.conf
	chmod 644 $(CONFIGDIR)/portato.conf
	cp portato $(BINDIR)

portato.o: portato.c port.h
	$(CC) $(CFLAGS) -DCONFIG_FILE=\"$(CONFIGDIR)/portato.conf\" -c portato.c

clean:
	rm -f *.o portato
