blob: a4d3c49e6495fc8f6176bf8b4b4c4b3eddf196dc [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001# Makefile for uClibc
2#
3# Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
4#
5# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
6#
7
8subdirs += libc/inet
9
10include $(top_srcdir)libc/inet/rpc/Makefile.in
11
12INET_DIR := $(top_srcdir)libc/inet
13INET_OUT := $(top_builddir)libc/inet
14
15CFLAGS-inet := -DRESOLVER="\"resolv.c\""
16CSRC-y :=
17# des uses ntohl
18CSRC-$(findstring y,$(UCLIBC_HAS_CRYPT_IMPL)$(UCLIBC_HAS_IPV4)$(UCLIBC_HAS_IPV6)) += ntohl.c
19CSRC-$(findstring y,$(UCLIBC_HAS_IPV4)$(UCLIBC_HAS_IPV6)) += \
20 getservice.c getproto.c getnet.c hostid.c \
21 inet_net.c herror.c if_index.c gai_strerror.c getaddrinfo.c \
22 ifaddrs.c ntop.c
23CSRC-$(UCLIBC_HAS_IPV6) += in6_addr.c
24# multi source addr.c
25CSRC-$(findstring y,$(UCLIBC_HAS_IPV4)$(UCLIBC_HAS_IPV6)) += \
26 inet_aton.c inet_addr.c inet_ntoa.c inet_makeaddr.c \
27 inet_lnaof.c inet_netof.c
28# multi source resolv.c
29CSRC-$(findstring y,$(UCLIBC_HAS_IPV4)$(UCLIBC_HAS_IPV6)) += \
30 encodeh.c decodeh.c encoded.c decoded.c \
31 encodeq.c encodea.c \
32 read_etc_hosts_r.c \
33 dnslookup.c opennameservers.c closenameservers.c \
34 getnameinfo.c \
35 gethostent.c gethostent_r.c
36CSRC-$(findstring y,$(UCLIBC_HAS_IPV4)$(UCLIBC_HAS_IPV6)) += \
37 get_hosts_byaddr_r.c get_hosts_byname_r.c \
38 gethostbyaddr_r.c gethostbyname_r.c gethostbyname2_r.c \
39 gethostbyaddr.c gethostbyname.c gethostbyname2.c
40CSRC-$(findstring y,$(UCLIBC_HAS_RESOLVER_SUPPORT)) += \
41 ns_netint.c ns_parse.c res_data.c \
42 res_init.c res_query.c res_comp.c ns_name.c \
43 _res_state.c
44## # unused ATM
45## CSRC-y += encodep.c decodep.c formquery.c
46
47# multi source socketcalls.c
48socketcalls_CSRC-y += \
49 accept.c bind.c connect.c getpeername.c getsockname.c \
50 getsockopt.c listen.c recv.c recvfrom.c recvmsg.c send.c sendmsg.c \
51 sendto.c setsockopt.c shutdown.c socket.c socketpair.c
52socketcalls_CSRC-$(UCLIBC_LINUX_SPECIFIC) += accept4.c
53CSRC-$(UCLIBC_HAS_SOCKET) += $(socketcalls_CSRC-y) opensock.c
54
55CSRC-$(findstring y,$(UCLIBC_HAS_SOCKET)$(UCLIBC_HAS_IPV4)$(UCLIBC_HAS_IPV6)) += ethers.c ether_addr.c
56
57INET_SRC := $(patsubst %.c,$(INET_DIR)/%.c,$(CSRC-y))
58INET_OBJ := $(patsubst %.c,$(INET_OUT)/%.o,$(CSRC-y))
59
60libc-y += $(INET_OBJ)
61
62objclean-y += CLEAN_libc/inet
63
64CLEAN_libc/inet:
65 $(do_rm) $(addprefix $(INET_OUT)/*., o os)