Makefile 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. #
  15. # Sub-makefile for inet portion of the library.
  16. #
  17. subdir := inet
  18. include ../Makeconfig
  19. headers := \
  20. $(wildcard arpa/*.h protocols/*.h) \
  21. bits/in.h \
  22. bits/inet-fortified-decl.h \
  23. bits/inet-fortified.h \
  24. ifaddrs.h \
  25. netinet/ether.h \
  26. netinet/icmp6.h \
  27. netinet/if_ether.h \
  28. netinet/igmp.h \
  29. netinet/in.h \
  30. netinet/in_systm.h \
  31. netinet/ip.h \
  32. netinet/ip6.h \
  33. netinet/tcp.h \
  34. rpc/netdb.h \
  35. # headers
  36. routines := \
  37. bindresvport \
  38. deadline \
  39. ether_aton \
  40. ether_aton_r \
  41. ether_line \
  42. ether_ntoa \
  43. ether_ntoa_r \
  44. getipv4sourcefilter \
  45. getsourcefilter \
  46. herrno \
  47. herrno-loc \
  48. htonl \
  49. htons \
  50. idna \
  51. idna_name_classify \
  52. if_index \
  53. ifaddrs \
  54. in6_addr \
  55. inet6_opt \
  56. inet6_option \
  57. inet6_rth \
  58. inet6_scopeid_pton \
  59. inet_lnaof \
  60. inet_mkadr \
  61. inet_net \
  62. inet_netof \
  63. inet_ntoa \
  64. rcmd \
  65. rexec \
  66. ruserpass \
  67. setipv4sourcefilter \
  68. setsourcefilter \
  69. # routines
  70. install-others = $(inst_sysconfdir)/rpc
  71. aux := check_pf check_native ifreq
  72. tests := \
  73. bug-if1 \
  74. htontest \
  75. test-hnto-types \
  76. test-ifaddrs \
  77. test-inet6_opt \
  78. test_ifindex \
  79. tst-checks \
  80. tst-checks-posix \
  81. tst-ether_aton \
  82. tst-ether_line \
  83. tst-getni1 \
  84. tst-getni2 \
  85. tst-if_index-long \
  86. tst-if_nameindex \
  87. tst-inet6_rth \
  88. tst-network \
  89. tst-ntoa \
  90. tst-sockaddr \
  91. # tests
  92. # tst-deadline must be linked statically so that we can access
  93. # internal functions.
  94. tests-static += tst-deadline
  95. tests-internal += tst-deadline
  96. # tst-idna_name_classify must be linked statically because it tests
  97. # internal functionality.
  98. tests-static += tst-idna_name_classify
  99. tests-internal += tst-idna_name_classify
  100. # tst-inet6_scopeid_pton also needs internal functions but does not
  101. # need to be linked statically.
  102. tests-internal += tst-inet6_scopeid_pton
  103. include ../Rules
  104. LOCALES := en_US.UTF-8 en_US.ISO-8859-1
  105. include ../gen-locales.mk
  106. ifeq ($(have-thread-library),yes)
  107. CFLAGS-rcmd.c += -fexceptions
  108. CFLAGS-either_ntoh.c += -fexceptions
  109. CFLAGS-either_hton.c += -fexceptions
  110. CFLAGS-tst-checks-posix.c += -std=c99
  111. CFLAGS-tst-sockaddr.c += -fno-strict-aliasing
  112. endif
  113. # Install the rpc database file.
  114. $(inst_sysconfdir)/rpc: etc.rpc $(+force)
  115. $(do-install)
  116. ifeq ($(build-static-nss),yes)
  117. CFLAGS += -DSTATIC_NSS
  118. endif
  119. ifeq ($(have-test-clang),yes)
  120. CFLAGS-tst-deadline.c += -Wno-ignored-attributes
  121. endif
  122. # The test uses dlopen indirectly and would otherwise load system
  123. # objects.
  124. tst-idna_name_classify-ENV = \
  125. LD_LIBRARY_PATH=$(ld-library-path):$(common-objpfx):$(common-objpfx)elf
  126. $(objpfx)tst-idna_name_classify.out: $(gen-locales)