Makefile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. CC=gcc
  2. CFLAGS=-g -O0 -Wall -W -I../..
  3. LIBS=
  4. 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
  5. LICENSE_LINE = echo '/* Licensed under GPLv3+ - see LICENSE file for details */' > $@
  6. all: tools/nfsclient-raw tools/nfsclient-async tools/nfsclient-sync
  7. tools/nfsclient-async: tools/nfsclient-async.c libnfs.a
  8. $(CC) $(CFLAGS) -o $@ tools/nfsclient-async.c libnfs.a $(LIBS)
  9. tools/nfsclient-sync: tools/nfsclient-sync.c libnfs.a
  10. $(CC) $(CFLAGS) -o $@ tools/nfsclient-sync.c libnfs.a $(LIBS)
  11. tools/nfsclient-raw: tools/nfsclient-raw.c libnfs.a
  12. $(CC) $(CFLAGS) -o $@ tools/nfsclient-raw.c libnfs.a $(LIBS)
  13. libnfs.a: $(LIBNFS_OBJ)
  14. @echo Creating library $@
  15. ar r libnfs.a $(LIBNFS_OBJ)
  16. ranlib libnfs.a
  17. rpc/mount.h: rpc/mount.x
  18. @echo Generating $@
  19. $(LICENSE_LINE) && rpcgen -h rpc/mount.x >> $@
  20. libnfs-raw-mount.c: rpc/mount.x
  21. @echo Generating $@
  22. $(LICENSE_LINE) && rpcgen -c rpc/mount.x >> $@
  23. libnfs-raw-mount.o: libnfs-raw-mount.c rpc/mount.h
  24. @echo Compiling $@
  25. gcc -g -c libnfs-raw-mount.c -o $@
  26. rpc/nfs.h: rpc/nfs.x
  27. @echo Generating $@
  28. $(LICENSE_LINE) && rpcgen -h rpc/nfs.x >> $@
  29. libnfs-raw-nfs.c: rpc/nfs.x
  30. @echo Generating $@
  31. $(LICENSE_LINE) && rpcgen -c rpc/nfs.x >> $@
  32. libnfs-raw-nfs.o: libnfs-raw-nfs.c rpc/nfs.h
  33. @echo Compiling $@
  34. gcc -g -c libnfs-raw-nfs.c -o $@
  35. rpc/nfsacl.h: rpc/nfsacl.x
  36. @echo Generating $@
  37. $(LICENSE_LINE) && rpcgen -h rpc/nfsacl.x >> $@
  38. libnfs-raw-nfsacl.c: rpc/nfsacl.x
  39. @echo Generating $@
  40. $(LICENSE_LINE) && rpcgen -c rpc/nfsacl.x >> $@
  41. libnfs-raw-nfsacl.o: libnfs-raw-nfsacl.c rpc/nfsacl.h
  42. @echo Compiling $@
  43. gcc -g -c libnfs-raw-nfsacl.c -o $@
  44. rpc/portmap.h: rpc/portmap.x
  45. @echo Generating $@
  46. $(LICENSE_LINE) && rpcgen -h rpc/portmap.x >> $@
  47. libnfs-raw-portmap.c: rpc/portmap.x
  48. @echo Generating $@
  49. $(LICENSE_LINE) && rpcgen -c rpc/portmap.x >> $@
  50. libnfs-raw-portmap.o: libnfs-raw-portmap.c rpc/portmap.h
  51. @echo Compiling $@
  52. gcc -g -c libnfs-raw-portmap.c -o $@
  53. clean:
  54. rm -f *.o
  55. rm -f *.a
  56. rm -f rpc/mount.h libnfs-raw-mount.c
  57. rm -f rpc/nfs.h libnfs-raw-nfs.c
  58. rm -f rpc/nfsacl.h libnfs-raw-nfsacl.c
  59. rm -f rpc/portmap.h libnfs-raw-portmap.c
  60. rm -f tools/nfsclient-raw tools/nfsclient-async tools/nfsclient-sync