chiark / gitweb /
Use nettle for hash functions.
[chiark-tcl.git] / base / troglodyte-Makefile
1 OBJS=           tables.o \
2                 hbytes.o \
3                 enum.o \
4                 ulongs.o \
5                 sockaddr.o \
6                 dgram.o \
7                 chop.o \
8                 hook.o \
9                 bcmode.o \
10                 misc.o \
11                 algtables.o \
12                 serpent.o \
13                 crypto.o \
14                 parse.o
15
16 HDRS=           hbytes.h \
17                 serpent.h \
18                 $(AUTO_HDRS)
19
20 AUTO_HDRS=      tables.h
21 AUTO_SRCS=      tables.c
22 AUTOS=          $(AUTO_HDRS) $(AUTO_SRCS)
23
24 TARGETS=        hbytes.so autocode.tcl autococo.tcl
25
26 CC_CRYPTO=      $(CC) $(CFLAGS) $(CPPFLAGS) -O3
27 CPPFLAGS=       -I../plocal/include
28 LDFLAGS=        -L../plocal/lib
29 LDLIBS=         -lnettle
30 CFLAGS=         -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Werror \
31                 $(OPTIMISE)
32 OPTIMISE=       -O2
33
34 all:            $(TARGETS) $(AUTOS)
35
36 hbytes.so:      $(OBJS)
37                 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ -shared $(OBJS) $(LDLIBS)
38
39 autoco%.tcl:    deco%gen.tcl decobogen.tcl general.tcl ./hbytes.so \
40                         protocol.deco
41                 ./$< protocol.deco >$@.new && mv -f $@.new $@           
42
43 %.c:            %.tct tcmdifgen
44                 ./tcmdifgen -wc -o$@ $<
45
46 %.h:            %.tct tcmdifgen
47                 ./tcmdifgen -wh -o$@ $<
48
49 %.o:            %.c $(HDRS)
50                 $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
51
52 serpent.o:      serpent.c serpent.h serpentsboxes.h
53                 $(CC_CRYPTO) -o $@ -c $<
54
55 clean:
56                 rm -f $(OBJS) $(TARGETS) *~ ./#*#