Makefile 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. # Copyright (C) 1991-2026 Free Software Foundation, Inc.
  2. # This file is part of the GNU C Library.
  3. # The GNU C Library is free software; you can redistribute it and/or
  4. # modify it under the terms of the GNU Lesser General Public
  5. # License as published by the Free Software Foundation; either
  6. # version 2.1 of the License, or (at your option) any later version.
  7. # The GNU C Library is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. # Lesser General Public License for more details.
  11. # You should have received a copy of the GNU Lesser General Public
  12. # License along with the GNU C Library; if not, see
  13. # <https://www.gnu.org/licenses/>.
  14. subdir := hurd
  15. include ../Makeconfig
  16. tests := test-sig-xstate \
  17. test-sig-rpc-interrupted
  18. $(objpfx)test-sig-xstate: $(shared-thread-library)
  19. $(objpfx)test-sig-rpc-interrupted: $(shared-thread-library) $(objdir)/hurd/libhurduser.so
  20. headers = \
  21. $(interface-headers) \
  22. hurd.h \
  23. hurd/fd.h \
  24. hurd/id.h \
  25. hurd/ioctl.h \
  26. hurd/lookup.h \
  27. hurd/port.h \
  28. hurd/resource.h \
  29. hurd/signal.h \
  30. hurd/sigpreempt.h \
  31. hurd/userlink.h \
  32. # headers
  33. inline-headers = \
  34. hurd.h \
  35. hurd/fd.h \
  36. hurd/port.h \
  37. hurd/signal.h \
  38. hurd/userlink.h \
  39. # inline-headers
  40. # The RPC interfaces go in a separate library.
  41. interface-library := libhurduser
  42. user-interfaces := \
  43. hurd/auth \
  44. hurd/crash \
  45. hurd/exec \
  46. hurd/exec_startup \
  47. hurd/fs \
  48. hurd/fsys \
  49. hurd/ifsock \
  50. hurd/interrupt \
  51. hurd/io \
  52. hurd/io_reply \
  53. hurd/io_request \
  54. hurd/login \
  55. hurd/msg \
  56. hurd/msg_reply \
  57. hurd/msg_request \
  58. hurd/password \
  59. hurd/pci \
  60. hurd/pfinet \
  61. hurd/process \
  62. hurd/process_request \
  63. hurd/socket \
  64. hurd/startup \
  65. hurd/term \
  66. hurd/tioctl \
  67. # user-interfaces
  68. server-interfaces := \
  69. faultexc \
  70. hurd/msg \
  71. # server-interfaces
  72. routines = \
  73. $(dtable) \
  74. $(inlines) \
  75. $(sig) \
  76. errno-loc \
  77. fchroot \
  78. fd-cleanup \
  79. fopenport \
  80. get-host \
  81. geteuids \
  82. getumask \
  83. hurdauth \
  84. hurdchdir \
  85. hurdexec \
  86. hurdfchdir \
  87. hurdid \
  88. hurdinit \
  89. hurdlock \
  90. hurdlookup \
  91. hurdmsg \
  92. hurdpid \
  93. hurdports \
  94. hurdprio \
  95. hurdrlimit \
  96. hurdselect \
  97. hurdsock \
  98. hurdstartup \
  99. lookup-at \
  100. lookup-retry \
  101. msgportdemux \
  102. path-lookup \
  103. pid2task \
  104. port-cleanup \
  105. ports-get \
  106. ports-set \
  107. privports \
  108. report-wait \
  109. set-host \
  110. setauth \
  111. seteuids \
  112. task2pid \
  113. vpprintf \
  114. xattr \
  115. # routines
  116. sig = \
  117. catch-exc \
  118. catch-signal \
  119. exc2signal \
  120. hurd-raise \
  121. hurdfault \
  122. hurdkill \
  123. hurdsig \
  124. intr-msg \
  125. longjmp-ts \
  126. preempt-sig \
  127. siginfo \
  128. sigthreadmask \
  129. sigunwind \
  130. thread-cancel \
  131. thread-self \
  132. trampoline \
  133. # sig
  134. dtable = \
  135. alloc-fd \
  136. ctty-input \
  137. ctty-output \
  138. dtable \
  139. fd-close \
  140. fd-read \
  141. fd-write \
  142. getdport \
  143. hurdioctl \
  144. intern-fd \
  145. new-fd \
  146. openport \
  147. port2fd \
  148. # dtable
  149. inlines = $(inline-headers:%.h=%-inlines)
  150. # XXX this is a temporary hack; see hurdmalloc.h
  151. routines += hurdmalloc
  152. # Binary compatibility for libc.so.0.2[GLIBC_2.0].
  153. ifeq ($(build-shared),yes)
  154. routines += compat-20
  155. endif
  156. shared-only-routines = compat-20
  157. # For each of the $(inline-headers), generate a trivial source
  158. # file that will #include it to define its inline functions as real functions.
  159. $(inlines:%=$(objpfx)%.c): $(objpfx)%-inlines.c: %.h
  160. (h="`echo $(subst /,_,$*) | tr '[a-z]' '[A-Z]'`"; \
  161. echo "#define _$${h}_H_EXTERN_INLINE /* Define real function. */"; \
  162. echo "#define _$${h}_H_HIDDEN_DEF /* Declare hidden definition. */"; \
  163. echo '#include "$<"') > $@-new
  164. mv -f $@-new $@
  165. generated += $(inlines:=.c)
  166. # Avoid ssp before TLS is initialized.
  167. CFLAGS-hurdstartup.o = $(no-stack-protector)
  168. CFLAGS-RPC_exec_startup_get_info.o = $(no-stack-protector)
  169. # Make it simpler to unwind over INTR_MSG_TRAP
  170. CFLAGS-intr-msg.o = -fno-omit-frame-pointer
  171. CFLAGS-intr-msg.os = -fno-omit-frame-pointer
  172. # Make generated headers compatible with all support standards
  173. migheaderpipe := | sed -e 's/\<ino64_t\>/__ino64_t/' -e 's/\<loff_t\>/__loff_t/'
  174. include ../mach/Machrules
  175. libhurduser-routines += RPC_gsync_wait_intr
  176. include ../Rules
  177. # intr-rpc.defs defines the INTR_INTERFACE macro to make the generated RPC
  178. # stubs import <hurd/signal.h> and #define __mach_msg to
  179. # _hurd_intr_rpc_mach_msg.
  180. user-MIGFLAGS += -imacros intr-rpc.defs
  181. # The special exc server for sigthread faults uses a special prefix.
  182. MIGFLAGS-faultexc = -prefix _hurdsig_fault_
  183. # We need this static dependency to get faultexc.h generated the first time.
  184. $(objpfx)hurdfault.o $(objpfx)hurdfault.d: \
  185. $(objpfx)faultexc_server.h $(objpfx)faultexc_server.c