CC = gcc
CFLAGS = -g -O2 -D_REENTRANT -D_THREAD_SAFE
CPPFLAGS = 
LDFLAGS =  -pthread
LIBS =  -lbind
DEFS = -DHAVE_CONFIG_H
CFLAGS_GCC = -g -Wall -Wpointer-arith -Wconversion

CFLAGS += $(CFLAGS_GCC) $(DEFS)

PROGS = verify_sender verify_test

VO_OBJS = main.o mcom.o verify.o nuxres.o io3.o avltree.o
VT_OBJS = test.o mcom.o verify.o nuxres.o io3.o avltree.o
VO_LDFLAGS = $(LDFLAGS)
VO_LIBS = $(LIBS) -lmilter
VT_LDFLAGS = $(LDFLAGS)
VT_LIBS = $(LIBS)

all: $(PROGS)

verify_sender: $(VO_OBJS)
	$(CC) -o $@ $(VO_OBJS) $(VO_LDFLAGS) $(VO_LIBS)

verify_test: $(VT_OBJS)
	$(CC) -o $@ $(VT_OBJS) $(VT_LDFLAGS) $(VT_LIBS)

install: all
	install -c -m 755 -o root -g wheel verify_sender /usr/local/libexec/

.PHONY:	clean

clean:		
	rm -f -- *.o $(PROGS)
	rm -f -- *~
