Makefile 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000 by Lineo, inc.
  4. # Copyright (C) 2000,2001 Erik Andersen <andersen@uclibc.org>
  5. #
  6. # This program is free software; you can redistribute it and/or modify it under
  7. # the terms of the GNU Library General Public License as published by the Free
  8. # Software Foundation; either version 2 of the License, or (at your option) any
  9. # later version.
  10. #
  11. # This program is distributed in the hope that it will be useful, but WITHOUT
  12. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  13. # FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
  14. # details.
  15. #
  16. # You should have received a copy of the GNU Library General Public License
  17. # along with this program; if not, write to the Free Software Foundation, Inc.,
  18. # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. #
  20. # Derived in part from the Linux-8086 C library, the GNU C Library, and several
  21. # other sundry sources. Files within this library are copyright by their
  22. # respective copyright holders.
  23. TOPDIR=../../
  24. include $(TOPDIR)Rules.mak
  25. ifeq ($(UCLIBC_HAS_THREADS),y)
  26. CFLAGS += $(PTINC)
  27. endif
  28. ALL_SUBDIRS = rpc
  29. DIRS =
  30. ifeq ($(UCLIBC_HAS_RPC),y)
  31. DIRS += rpc
  32. endif
  33. MSRC := addr.c
  34. MOBJ := inet_aton.o inet_addr.o inet_ntoa.o inet_makeaddr.o inet_lnaof.o \
  35. inet_netof.o
  36. MSRC2 := resolv.c
  37. MOBJ2 := encodeh.o decodeh.o encoded.o decoded.o lengthd.o encodeq.o \
  38. decodeq.o lengthq.o encodea.o decodea.o encodep.o decodep.o \
  39. formquery.o dnslookup.o resolveaddress.o opennameservers.o \
  40. closenameservers.o resolvename.o gethostbyname.o res_init.o \
  41. res_query.o gethostbyaddr.o read_etc_hosts_r.o get_hosts_byname_r.o \
  42. get_hosts_byaddr_r.o gethostbyname2.o getnameinfo.o gethostent.o \
  43. gethostbyname_r.o gethostbyname2_r.o gethostbyaddr_r.o \
  44. res_comp.o ns_name.o
  45. MSRC3 := socketcalls.c
  46. MOBJ3 := accept.o bind.o connect.o getpeername.o getsockname.o getsockopt.o \
  47. listen.o recv.o recvfrom.o recvmsg.o send.o sendmsg.o sendto.o \
  48. setsockopt.o shutdown.o socket.o socketpair.o
  49. CSRC := getservice.c getproto.c hostid.c getnetent.c getnetbynm.c getnetbyad.c \
  50. inet_net.c ntop.c herror.c if_nametoindex.c gai_strerror.c getaddrinfo.c \
  51. in6_addr.c ether_addr.c ntohl.c
  52. COBJ := $(patsubst %.c,%.o, $(CSRC))
  53. OBJS := $(MOBJ) $(MOBJ2) $(MOBJ3) $(COBJ)
  54. OBJ_LIST := ../obj.inet
  55. all: $(OBJ_LIST) subdirs
  56. $(OBJ_LIST): $(OBJS)
  57. $(STRIPTOOL) -x -R .note -R .comment $^
  58. echo $(patsubst %, inet/%, $^) > $@
  59. $(MOBJ): $(MSRC)
  60. $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
  61. $(MOBJ2): $(MSRC2)
  62. $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
  63. $(MOBJ3): $(MSRC3)
  64. $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
  65. $(COBJ): %.o : %.c
  66. $(CC) $(CFLAGS) -c $< -o $@
  67. clean: subdirs_clean
  68. $(RM) *.o *~ core
  69. subdirs: $(patsubst %, _dir_%, $(DIRS))
  70. subdirs_clean: $(patsubst %, _dirclean_%, $(ALL_SUBDIRS))
  71. $(patsubst %, _dir_%, $(DIRS)) : dummy
  72. $(MAKE) -C $(patsubst _dir_%, %, $@)
  73. $(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy
  74. $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
  75. .PHONY: dummy