chiark / gitweb /
fbcfc8fc881365b111a83091fda9823911095734
[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                 sha1.o \
14                 md5.o \
15                 crypto.o \
16                 parse.o
17
18 HDRS=           hbytes.h \
19                 serpent.h \
20                 md5.h \
21                 sha1.h \
22                 $(AUTO_HDRS)
23
24 AUTO_HDRS=      tables.h
25 AUTO_SRCS=      tables.c
26 AUTOS=          $(AUTO_HDRS) $(AUTO_SRCS)
27
28 TARGETS=        hbytes.so autocode.tcl autococo.tcl
29
30 CC_CRYPTO=      $(CC) $(CFLAGS) $(CPPFLAGS) -O3
31 CFLAGS=         -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Werror \
32                 $(OPTIMISE)
33 OPTIMISE=       -O2
34
35 all:            $(TARGETS) $(AUTOS)
36
37 hbytes.so:      $(OBJS)
38                 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ -shared $(OBJS) $(LDLIBS)
39
40 autoco%.tcl:    deco%gen.tcl decobogen.tcl general.tcl ./hbytes.so \
41                         protocol.deco
42                 ./$< protocol.deco >$@.new && mv -f $@.new $@           
43
44 %.c:            %.tct tcmdifgen
45                 ./tcmdifgen -wc -o$@ $<
46
47 %.h:            %.tct tcmdifgen
48                 ./tcmdifgen -wh -o$@ $<
49
50 %.o:            %.c $(HDRS)
51                 $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
52
53 serpent.o:      serpent.c serpent.h serpentsboxes.h
54                 $(CC_CRYPTO) -o $@ -c $<
55
56 md5.o:          md5.c md5.h
57                 $(CC_CRYPTO) -o $@ -c $<
58
59 sha1.o:         sha1.c sha1.h
60                 $(CC_CRYPTO) -o $@ -c $<
61
62 clean:
63                 rm -f $(OBJS) $(TARGETS) *~ ./#*#