.PHONY: all clean realclean distclean dist install
PACKAGE:=secnet
-VERSION:=0.2.1
+VERSION:=0.3.0~beta3
@SET_MAKE@
TARGETS:=secnet
OBJECTS:=secnet.o util.o conffile.yy.o conffile.tab.o conffile.o modules.o \
- resolver.o random.o udp.o site.o transform.o netlink.o rsa.o dh.o \
- serpent.o md5.o version.o tun.o slip.o sha1.o ipaddr.o log.o \
+ resolver.o random.o udp.o site.o transform-cbcmac.o transform-eax.o \
+ netlink.o rsa.o dh.o serpent.o serpentbe.o \
+ md5.o sha512.o version.o tun.o slip.o sha1.o ipaddr.o log.o \
process.o @LIBOBJS@ \
hackypar.o
+TEST_OBJECTS:=eax-aes-test.o eax-serpent-test.o eax-serpentbe-test.o \
+ eax-test.o aes.o
+
%.c: %.y
%.yy.c: %.fl
%.o: %.c
$(CC) $(CPPFLAGS) $(ALL_CFLAGS) -c $< -o $@
-all: $(TARGETS)
+all: $(TARGETS) check
# Automatic remaking of configuration files, from autoconf documentation
${srcdir}/configure: configure.in
# End of config file remaking rules
# C and header file dependency rules
-SOURCES:=$(OBJECTS:.o=.c)
-DEPENDS:=$(OBJECTS:.o=.d)
+SOURCES:=$(OBJECTS:.o=.c) $(TEST_OBJECTS:.o=.c)
+DEPENDS:=$(OBJECTS:.o=.d) $(TEST_OBJECTS:.o=.d)
$(DEPENDS): ${srcdir}/depend.sh
secnet: $(OBJECTS)
$(CC) $(LDFLAGS) $(ALL_CFLAGS) -o $@ $(OBJECTS) $(LDLIBS)
+check: eax-aes-test.confirm eax-serpent-test.confirm \
+ eax-serpentbe-test.confirm
+
version.c: Makefile
echo "#include \"secnet.h\"" >$@.new
echo "char version[]=\"secnet $(VERSION)\";" >>$@.new
mv -f $@.new $@
+eax-%-test: eax-%-test.o eax-test.o %.o
+ $(CC) $(LDFLAGS) $(ALL_CFLAGS) -o $@ $^
+
+eax-%-test.confirm: eax-%-test eax-%-test.vectors
+ ./$< <$(srcdir)/eax-$*-test.vectors >$@.new
+ mv -f $@.new $@
+
+.PRECIOUS: eax-%-test
+
installdirs:
$(INSTALL) -d $(prefix)/share/secnet $(sbindir)
$(INSTALL) -d $(mandir)/man8
clean:
$(RM) -f *.o *.yy.c *.tab.[ch] $(TARGETS) core version.c
- $(RM) -f *.d *~
+ $(RM) -f *.d *~ eax-*-test.confirm eax-*-test
realclean: clean
$(RM) -f *~ Makefile config.h *.d \