Makefile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. include ../defs.mk
  2. # fs stubs
  3. FS_DEFS = $(HURD_DIRECTORY)/fs.defs
  4. GENERATED_FS_SERVER = fs-server
  5. FS_OBJECTS = $(GENERATED_FS_SERVER).o fs-wrapper.o
  6. # io stubs
  7. IO_DEFS = $(HURD_DIRECTORY)/io.defs
  8. GENERATED_IO_SERVER = io-server
  9. IO_OBJECTS = $(GENERATED_IO_SERVER).o io-wrapper.o
  10. # fsys stubs
  11. FSYS_DEFS = $(HURD_DIRECTORY)/fsys.defs
  12. GENERATED_FSYS_SERVER = fsys-server
  13. FSYS_OBJECTS = $(GENERATED_FSYS_SERVER).o fsys-wrapper.o
  14. # notify stubs
  15. NOTIFY_DEFS = $(MACH_DIRECTORY)/notify.defs
  16. GENERATED_NOTIFY_SERVER = notify-server
  17. NOTIFY_OBJECTS = $(GENERATED_NOTIFY_SERVER).o notify-wrapper.o
  18. # fsys reply stubs
  19. FSYS_REPLY_DEFS = $(HURD_DIRECTORY)/fsys_reply.defs
  20. GENERATED_FSYS_REPLY_USER = fsys-reply-user
  21. FSYS_REPLY_OBJECTS = $(GENERATED_FSYS_REPLY_USER).o
  22. TARGETS = liblisptrans.so
  23. OBJS = fetch-root.o file-exec.o \
  24. file-utimes.o portset-demuxer.o \
  25. $(IO_OBJECTS) $(FS_OBJECTS) \
  26. $(FSYS_OBJECTS) $(NOTIFY_OBJECTS) \
  27. $(FSYS_REPLY_OBJECTS)
  28. LDFLAGS = -lfshelp
  29. all: $(TARGETS)
  30. liblisptrans.so: $(OBJS)
  31. $(CC) -shared \
  32. -o liblisptrans.so $(OBJS) $(LDFLAGS) -lfshelp
  33. $(GENERATED_IO_SERVER).c: $(IO_DEFS)
  34. $(MIG_SERVER) $(GENERATED_IO_SERVER).c $(IO_DEFS)
  35. sed -e 's:lisp_S_io_server:lisp_io_server:g' \
  36. -i $(GENERATED_IO_SERVER).c
  37. sed -e 's:lisp_io_server_version:lisp_S_io_server_version:g' \
  38. -i $(GENERATED_IO_SERVER).c
  39. io-wrapper.o: io-wrapper.c io-wrapper.h common.c
  40. $(GENERATED_FS_SERVER).c: $(FS_DEFS)
  41. $(MIG_SERVER) $(GENERATED_FS_SERVER).c $(FS_DEFS)
  42. sed -e 's:lisp_S_fs_server:lisp_fs_server:g' -i $(GENERATED_FS_SERVER).c
  43. fs-wrapper.o: fs-wrapper.c fs-wrapper.h common.c
  44. $(GENERATED_FSYS_SERVER).c: $(FSYS_DEFS)
  45. cpp $(FSYS_DEFS) -D REPLY_PORTS > tmp.defs
  46. $(MIG_SERVER) $(GENERATED_FSYS_SERVER).c tmp.defs
  47. sed -e 's:lisp_S_fsys_server:lisp_fsys_server:g' \
  48. -i $(GENERATED_FSYS_SERVER).c
  49. rm -f tmp.defs
  50. fsys-wrapper.o: fsys-wrapper.c fsys-wrapper.h common.c
  51. $(GENERATED_NOTIFY_SERVER).c: $(NOTIFY_DEFS)
  52. $(MIG_SERVER) $(GENERATED_NOTIFY_SERVER).c $(NOTIFY_DEFS) -prefix lisp_
  53. notify-wrapper.o: notify-wrapper.c notify-wrapper.h common.c
  54. $(GENERATED_FSYS_REPLY_USER).c: $(FSYS_REPLY_DEFS)
  55. $(MIG_USER) $(GENERATED_FSYS_REPLY_USER).c $(FSYS_REPLY_DEFS)
  56. clean:
  57. rm -f *.so *.o \
  58. $(GENERATED_IO_SERVER).c \
  59. $(GENERATED_FS_SERVER).c \
  60. $(GENERATED_FSYS_SERVER).c \
  61. $(GENERATED_NOTIFY_SERVER).c \
  62. $(GENERATED_FSYS_REPLY_USER).c
  63. install: all
  64. cp $(TARGETS) /usr/lib