2 CFLAGS=-g -O0 -Wall -W -I../..
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
7 LICENSE_LINE = echo '/* Licensed under GPLv3+ - see LICENSE file for details */' > $@
9 all: tools/nfsclient-raw tools/nfsclient-async tools/nfsclient-sync
11 tools/nfsclient-async: tools/nfsclient-async.c libnfs.a
12 $(CC) $(CFLAGS) -o $@ tools/nfsclient-async.c libnfs.a $(LIBS)
14 tools/nfsclient-sync: tools/nfsclient-sync.c libnfs.a
15 $(CC) $(CFLAGS) -o $@ tools/nfsclient-sync.c libnfs.a $(LIBS)
17 tools/nfsclient-raw: tools/nfsclient-raw.c libnfs.a
18 $(CC) $(CFLAGS) -o $@ tools/nfsclient-raw.c libnfs.a $(LIBS)
20 libnfs.a: $(LIBNFS_OBJ)
21 @echo Creating library $@
22 ar r libnfs.a $(LIBNFS_OBJ)
25 rpc/mount.h: rpc/mount.x
27 $(LICENSE_LINE) && rpcgen -h rpc/mount.x >> $@
29 libnfs-raw-mount.c: rpc/mount.x
31 $(LICENSE_LINE) && rpcgen -c rpc/mount.x >> $@
33 libnfs-raw-mount.o: libnfs-raw-mount.c rpc/mount.h
35 gcc -g -c libnfs-raw-mount.c -o $@
39 $(LICENSE_LINE) && rpcgen -h rpc/nfs.x >> $@
41 libnfs-raw-nfs.c: rpc/nfs.x
43 $(LICENSE_LINE) && rpcgen -c rpc/nfs.x >> $@
45 libnfs-raw-nfs.o: libnfs-raw-nfs.c rpc/nfs.h
47 gcc -g -c libnfs-raw-nfs.c -o $@
49 rpc/nfsacl.h: rpc/nfsacl.x
51 $(LICENSE_LINE) && rpcgen -h rpc/nfsacl.x >> $@
53 libnfs-raw-nfsacl.c: rpc/nfsacl.x
55 $(LICENSE_LINE) && rpcgen -c rpc/nfsacl.x >> $@
57 libnfs-raw-nfsacl.o: libnfs-raw-nfsacl.c rpc/nfsacl.h
59 gcc -g -c libnfs-raw-nfsacl.c -o $@
61 rpc/portmap.h: rpc/portmap.x
63 $(LICENSE_LINE) && rpcgen -h rpc/portmap.x >> $@
65 libnfs-raw-portmap.c: rpc/portmap.x
67 $(LICENSE_LINE) && rpcgen -c rpc/portmap.x >> $@
69 libnfs-raw-portmap.o: libnfs-raw-portmap.c rpc/portmap.h
71 gcc -g -c libnfs-raw-portmap.c -o $@
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