chiark / gitweb /
Many improvements. Now we get as far as SHA256 not being implemented.
[chiark-tcl.git] / base / troglodyte-Makefile
index 765d5e45997366f09822f31b3f8e60aa728d88ba..fbcfc8fc881365b111a83091fda9823911095734 100644 (file)
@@ -1,19 +1,63 @@
-OBJS=          hbytes.o \
-               enum.o
+OBJS=          tables.o \
+               hbytes.o \
+               enum.o \
+               ulongs.o \
+               sockaddr.o \
+               dgram.o \
+               chop.o \
+               hook.o \
+               bcmode.o \
+               misc.o \
+               algtables.o \
+               serpent.o \
+               sha1.o \
+               md5.o \
+               crypto.o \
+               parse.o
 
-HDRS=          hbytes.h
+HDRS=          hbytes.h \
+               serpent.h \
+               md5.h \
+               sha1.h \
+               $(AUTO_HDRS)
 
-TARGETS=       hbytes.so
+AUTO_HDRS=     tables.h
+AUTO_SRCS=     tables.c
+AUTOS=         $(AUTO_HDRS) $(AUTO_SRCS)
 
-CFLAGS=        -g -Wall -O
+TARGETS=       hbytes.so autocode.tcl autococo.tcl
 
-all:           $(TARGETS)
+CC_CRYPTO=     $(CC) $(CFLAGS) $(CPPFLAGS) -O3
+CFLAGS=                -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Werror \
+               $(OPTIMISE)
+OPTIMISE=      -O2
+
+all:           $(TARGETS) $(AUTOS)
 
 hbytes.so:     $(OBJS)
                $(CC) $(CFLAGS) $(LDFLAGS) -o $@ -shared $(OBJS) $(LDLIBS)
 
+autoco%.tcl:   deco%gen.tcl decobogen.tcl general.tcl ./hbytes.so \
+                       protocol.deco
+               ./$< protocol.deco >$@.new && mv -f $@.new $@           
+
+%.c:           %.tct tcmdifgen
+               ./tcmdifgen -wc -o$@ $<
+
+%.h:           %.tct tcmdifgen
+               ./tcmdifgen -wh -o$@ $<
+
 %.o:           %.c $(HDRS)
                $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
 
+serpent.o:     serpent.c serpent.h serpentsboxes.h
+               $(CC_CRYPTO) -o $@ -c $<
+
+md5.o:         md5.c md5.h
+               $(CC_CRYPTO) -o $@ -c $<
+
+sha1.o:                sha1.c sha1.h
+               $(CC_CRYPTO) -o $@ -c $<
+
 clean:
                rm -f $(OBJS) $(TARGETS) *~ ./#*#