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