utf8: don't allow NUL in decoded strings.
[ccan] / ccan / nfs / Makefile
1 CC=gcc
2 CFLAGS=-g -O0 -Wall -W -I../..
3 LIBS=
4
5 LIBNFS_OBJ = libnfs-raw-mount.o libnfs-raw-portmap.o libnfs-raw-nfs.o libnfs-raw-nfsacl.o mount.o nfs.o nfsacl.o portmap.o pdu.o init.o socket.o libnfs.o libnfs-sync.o
6
7 LICENSE_LINE = echo '/* Licensed under GPLv3+ - see LICENSE file for details */' > $@
8
9 all: tools/nfsclient-raw tools/nfsclient-async tools/nfsclient-sync
10
11 tools/nfsclient-async: tools/nfsclient-async.c libnfs.a
12         $(CC) $(CFLAGS) -o $@ tools/nfsclient-async.c libnfs.a $(LIBS)
13
14 tools/nfsclient-sync: tools/nfsclient-sync.c libnfs.a
15         $(CC) $(CFLAGS) -o $@ tools/nfsclient-sync.c libnfs.a $(LIBS)
16
17 tools/nfsclient-raw: tools/nfsclient-raw.c libnfs.a
18         $(CC) $(CFLAGS) -o $@ tools/nfsclient-raw.c libnfs.a $(LIBS)
19
20 libnfs.a: $(LIBNFS_OBJ)
21         @echo Creating library $@
22         ar r libnfs.a $(LIBNFS_OBJ) 
23         ranlib libnfs.a
24
25 rpc/mount.h: rpc/mount.x
26         @echo Generating $@
27         $(LICENSE_LINE) && rpcgen -h rpc/mount.x >> $@
28
29 libnfs-raw-mount.c: rpc/mount.x
30         @echo Generating $@
31         $(LICENSE_LINE) && rpcgen -c rpc/mount.x >> $@
32
33 libnfs-raw-mount.o: libnfs-raw-mount.c rpc/mount.h
34         @echo Compiling $@
35         gcc -g -c libnfs-raw-mount.c -o $@
36
37 rpc/nfs.h: rpc/nfs.x
38         @echo Generating $@
39         $(LICENSE_LINE) && rpcgen -h rpc/nfs.x >> $@
40
41 libnfs-raw-nfs.c: rpc/nfs.x
42         @echo Generating $@
43         $(LICENSE_LINE) && rpcgen -c rpc/nfs.x >> $@
44
45 libnfs-raw-nfs.o: libnfs-raw-nfs.c rpc/nfs.h
46         @echo Compiling $@
47         gcc -g -c libnfs-raw-nfs.c -o $@
48
49 rpc/nfsacl.h: rpc/nfsacl.x
50         @echo Generating $@
51         $(LICENSE_LINE) && rpcgen -h rpc/nfsacl.x >> $@
52
53 libnfs-raw-nfsacl.c: rpc/nfsacl.x
54         @echo Generating $@
55         $(LICENSE_LINE) && rpcgen -c rpc/nfsacl.x >> $@
56
57 libnfs-raw-nfsacl.o: libnfs-raw-nfsacl.c rpc/nfsacl.h
58         @echo Compiling $@
59         gcc -g -c libnfs-raw-nfsacl.c -o $@
60
61 rpc/portmap.h: rpc/portmap.x
62         @echo Generating $@
63         $(LICENSE_LINE) && rpcgen -h rpc/portmap.x >> $@
64
65 libnfs-raw-portmap.c: rpc/portmap.x
66         @echo Generating $@
67         $(LICENSE_LINE) && rpcgen -c rpc/portmap.x >> $@
68
69 libnfs-raw-portmap.o: libnfs-raw-portmap.c rpc/portmap.h
70         @echo Compiling $@
71         gcc -g -c libnfs-raw-portmap.c -o $@
72
73 clean:
74         rm -f *.o
75         rm -f *.a
76         rm -f rpc/mount.h libnfs-raw-mount.c
77         rm -f rpc/nfs.h libnfs-raw-nfs.c
78         rm -f rpc/nfsacl.h libnfs-raw-nfsacl.c
79         rm -f rpc/portmap.h libnfs-raw-portmap.c
80         rm -f tools/nfsclient-raw tools/nfsclient-async tools/nfsclient-sync
81