Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 ($(strip $(INCLUDE_RPC)),true)
  26. DIRS=rpc
  27. else
  28. DIRS=
  29. endif
  30. ALL_SUBDIRS = rpc
  31. MSRC=addr.c
  32. MOBJ=inet_aton.o inet_addr.o inet_ntoa.o inet_makeaddr.o inet_lnaof.o \
  33. inet_netof.o
  34. MSRC2=resolv.c
  35. MOBJ2=encodeh.o decodeh.o encoded.o decoded.o lengthd.o encodeq.o \
  36. decodeq.o lengthq.o encodea.o decodea.o encodep.o decodep.o \
  37. formquery.o dnslookup.o resolveaddress.o resolvemailbox.o \
  38. opennameservers.o closenameservers.o resolvename.o gethostbyname.o\
  39. res_init.o res_query.o gethostbyaddr.o \
  40. get_hosts_byname.o get_hosts_byaddr.o read_etc_hosts.o \
  41. gethostbyname2.o getnameinfo.o
  42. MSRC3=socketcalls.c
  43. MOBJ3= accept.o bind.o connect.o getpeername.o getsockname.o getsockopt.o \
  44. listen.o recv.o recvfrom.o recvmsg.o send.o sendmsg.o sendto.o \
  45. setsockopt.o shutdown.o socket.o socketpair.o
  46. MSRC4=herror.c
  47. MOBJ4=herror.o hstrerror.o
  48. CSRC =getservice.c getproto.c hostid.c getnetent.c getnetbynm.c getnetbyad.c \
  49. inet_net.c ntop.c
  50. COBJS=$(patsubst %.c,%.o, $(CSRC))
  51. OBJS=$(MOBJ) $(MOBJ2) $(MOBJ3) $(MOBJ4) $(COBJS)
  52. all: $(OBJS) $(LIBC)
  53. $(LIBC): ar-target subdirs
  54. ar-target: $(OBJS)
  55. $(AR) $(ARFLAGS) $(LIBC) $(OBJS)
  56. $(MOBJ): $(MSRC)
  57. $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
  58. $(STRIPTOOL) -x -R .note -R .comment $*.o
  59. $(MOBJ2): $(MSRC2)
  60. $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
  61. $(STRIPTOOL) -x -R .note -R .comment $*.o
  62. $(MOBJ3): $(MSRC3)
  63. $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
  64. $(STRIPTOOL) -x -R .note -R .comment $*.o
  65. $(MOBJ4): $(MSRC4)
  66. $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
  67. $(STRIPTOOL) -x -R .note -R .comment $*.o
  68. $(COBJS): %.o : %.c
  69. $(CC) $(CFLAGS) -c $< -o $@
  70. $(STRIPTOOL) -x -R .note -R .comment $*.o
  71. clean: subdirs_clean
  72. rm -f *.[oa] *~ core
  73. subdirs: $(patsubst %, _dir_%, $(DIRS))
  74. subdirs_clean: $(patsubst %, _dirclean_%, $(ALL_SUBDIRS))
  75. $(patsubst %, _dir_%, $(DIRS)) : dummy
  76. $(MAKE) -C $(patsubst _dir_%, %, $@)
  77. $(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy
  78. $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
  79. .PHONY: dummy