Makerules.mig.am 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. # Makerules.mig: how to do some MIG-related things.
  2. # Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
  3. # This program is free software; you can redistribute it and/or modify it
  4. # under the terms of the GNU General Public License as published by the
  5. # Free Software Foundation; either version 2, or (at your option) any later
  6. # version.
  7. #
  8. # This program is distributed in the hope that it will be useful, but
  9. # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  10. # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  11. # for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License along
  14. # with this program; if not, write to the Free Software Foundation, Inc.,
  15. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  16. #
  17. # Written by Thomas Schwinge.
  18. # serial 0
  19. # TODO. This file should probably be distributed with GNU MIG and then there
  20. # should be some mechanism so that every package using it is automagically
  21. # using the latest available (or best-matching) version of it. Which is not
  22. # trivial, as the file is already needed to build the build system. But then,
  23. # this file does not really depend on GNU Automake. Hmm...
  24. # USAGE.
  25. # Before `include'ing this file, `noinst_LIBRARIES' and `MOSTLYCLEANFILES' have
  26. # to be initialized.
  27. # For using these rules, `AM_CPPFLAGS', `MIGCOM', `MIGCOMFLAGS', `MIGCOMSFLAGS'
  28. # and `MIGCOMUFLAGS' have to be defined as desired.
  29. # Then you can (read: currently ``have to''; see below for comments) use
  30. # constructs like:
  31. #
  32. # # User stubs.
  33. # nodist_lib_dep_tr_for_defs_a_SOURCES += \
  34. # vm/memory_object_user.user.defs.c
  35. # nodist_libkernel_a_SOURCES += \
  36. # vm/memory_object_user.user.h \
  37. # vm/memory_object_user.user.c \
  38. # vm/memory_object_user.user.msgids
  39. #
  40. # # Server stubs.
  41. # nodist_lib_dep_tr_for_defs_a_SOURCES += \
  42. # device/device.server.defs.c
  43. # nodist_libkernel_a_SOURCES += \
  44. # device/device.server.h \
  45. # device/device.server.c \
  46. # device/device.server.msgids
  47. #
  48. # Building RPC stubs.
  49. #
  50. # TODO. Get rid of that stuff, lib_dep_tr_for_defs.a and the four following
  51. # rules. See the thread at
  52. # <http://lists.gnu.org/archive/html/automake/2006-10/msg00039.html> about what
  53. # we really want to do. This requires work on GNU Automake.
  54. noinst_LIBRARIES += \
  55. lib_dep_tr_for_defs.a
  56. nodist_lib_dep_tr_for_defs_a_SOURCES =
  57. MOSTLYCLEANFILES += \
  58. $(nodist_lib_dep_tr_for_defs_a_SOURCES)
  59. # Preprocess only.
  60. lib_dep_tr_for_defs_a_CPPFLAGS = $(AM_CPPFLAGS) \
  61. -E
  62. %.server.defs.c: %.srv
  63. $(AM_V_at) rm -f $@
  64. $(AM_V_GEN) cp -p $< $@
  65. %.server.h %.server.c %.server.msgids: lib_dep_tr_for_defs_a-%.server.defs.$(OBJEXT)
  66. $(MIGCOM_V) $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMSFLAGS) \
  67. -sheader $*.server.h -server $*.server.c \
  68. -list $*.server.msgids \
  69. < $<
  70. %.user.defs.c: %.cli
  71. $(AM_V_at) rm -f $@
  72. $(AM_V_GEN) cp -p $< $@
  73. %.user.h %.user.c %.user.msgids: lib_dep_tr_for_defs_a-%.user.defs.$(OBJEXT)
  74. $(MIGCOM_V) $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMUFLAGS) \
  75. -user $*.user.c -header $*.user.h \
  76. -list $*.user.msgids \
  77. < $<
  78. # Stand-alone rule to generate the list of message ids when neither
  79. # the client nor the server stubs are required.
  80. %.none.defs.c: %.defs
  81. $(AM_V_at) rm -f $@
  82. $(AM_V_GEN) cp -p $< $@
  83. %.none.msgids: lib_dep_tr_for_defs_a-%.none.defs.$(OBJEXT)
  84. $(MIGCOM_V) $(MIGCOM) $(MIGCOMFLAGS) \
  85. -list $*.none.msgids \
  86. < $<
  87. # This is how it should be done, but this is not integrated into GNU Automake
  88. # and is missing automatic inter-file dependency management because of that.
  89. # These chained rules could be (and used to be) single rules using pipes or
  90. # could even --- if you dare to --- use the `mig' shell script, but it's
  91. # convenient to be able to explicitly make the intermediate files when you want
  92. # to deal with a problem in the MIG stub generator.
  93. # TODO. Get rid of the .srv files and rather use .defs files and MIG*SFLAGS?
  94. #%.server.defs: %.srv
  95. # $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -o $@ $<
  96. #%.server.defs: %.defs
  97. # $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) $(MIGSFLAGS) -o $@ $<
  98. #%.server.h %.server.c %.server.msgids: %.server.defs
  99. # $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMSFLAGS) \
  100. # -sheader $*.server.h -server $*.server.c \
  101. # -list $*.server.msgids \
  102. # < $<
  103. # TODO. Get rid of the .cli files and rather use .defs files and MIG*UFLAGS?
  104. #%.user.defs: %.cli
  105. # $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -o $@ $<
  106. #%.user.defs: %.defs
  107. # $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) $(MIGUFLAGS) -o $@ $<
  108. #%.user.h %.user.c %.user.msgids: %.user.defs
  109. # $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMUFLAGS) \
  110. # -user $*.user.c -header $*.user.h \
  111. # -list $*.user.msgids \
  112. # < $<