
ACCESS=-DCHECKACCESS=1

all:	bind_port libbind.so

bind_port:	bind_port.o access.o
	rm -f bind_port
	$(CC) -o bind_port bind_port.o access.o -lcap

bind_port.o:	bind_port.c constants.h
	$(CC) $(ACCESS) -c bind_port.c

access.o:	access.c constants.h
	$(CC) $(ACCESS) -c access.c
	

TESTFLAGS= -DDEBUGGING
TESTFLAGS= 
BIND_SYMREP= -DREPLACE_BIND_SYMBOL
BIND_CFLAGS= $(TESTFLAGS) $(BIND_SYMREP)


libbind.o:	libbind.c constants.h
	$(CC) -o libbind.o $(BIND_SYMREP) -fPIC -c libbind.c

libbind.so: libbind.o 
	$(CC) -shared -o libbind.so -Wl,-soname,libbind.so libbind.o 

bt.o:	bt.c 
	$(CC) -o bt bt.o libbind.o
