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