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