
CC = gcc
CFLAGS = -pipe -g -Wall

RM = rm -f


### Firewall code selection ###

## For the script based system.
FW_OBJS=fw_program.o
#CFLAGS += -DFW_PROGRAM=\"/your/fw/program\"

## For the built-in Linux method.
## Note that this only works with 2.2 kernels.
## Porting to 2.4 should be easy but I havn't done it :)
#FW_OBJS=fw_linux.o


### Digest code selection ###

# For libcrpyto/OpenSSL
MD_LIBS=-lcrypto

# For libmd (http://www.penguin.cz/~mhi/libmd/)
#MD_LIBS=-lmd
#CFLAGS += -DUSE_MD

TARGETS = in.ipscrompd ipscromp fw_test

all: $(TARGETS)

install: all
	install -m 755 -s ipscromp /usr/local/bin
	install -m 755 -s in.ipscrompd /usr/local/sbin

ipscromp: ipscromp.o common.o
	$(CC) $(CFLAGS) -o ipscromp ipscromp.o common.o $(MD_LIBS)

in.ipscrompd: $(FW_OBJS) in.ipscrompd.o common.o auth_proto_v2.o
	$(CC) $(CFLAGS) -o in.ipscrompd in.ipscrompd.o common.o \
				auth_proto_v2.o $(FW_OBJS) $(MD_LIBS)

fw_test: $(FW_OBJS) common.o fw_test.o
	$(CC) $(CFLAGS) -o fw_test $(FW_OBJS) common.o fw_test.o $(MD_LIBS)

clean:;
	$(RM) *.o core *.core *~ $(TARGETS)
