Makefile 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org>
  4. #
  5. # This program is free software; you can redistribute it and/or modify it under
  6. # the terms of the GNU Library General Public License as published by the Free
  7. # Software Foundation; either version 2 of the License, or (at your option) any
  8. # later version.
  9. #
  10. # This program is distributed in the hope that it will be useful, but WITHOUT
  11. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  12. # FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
  13. # details.
  14. #
  15. # You should have received a copy of the GNU Library General Public License
  16. # along with this program; if not, write to the Free Software Foundation, Inc.,
  17. # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. TOPDIR=../../
  19. include $(TOPDIR)Rules.mak
  20. DIRS=
  21. ifeq ($(UCLIBC_HAS_STRING_GENERIC_OPT),y)
  22. DIRS += generic
  23. endif
  24. ifeq ($(UCLIBC_HAS_STRING_ARCH_OPT),y)
  25. ifeq ($(TARGET_ARCH),$(wildcard $(TARGET_ARCH)))
  26. DIRS += $(TARGET_ARCH)
  27. endif
  28. endif
  29. ALL_SUBDIRS = generic arm frv i386 sh64 powerpc mips
  30. MSRC= wstring.c
  31. MOBJ= basename.o bcopy.o bzero.o dirname.o ffs.o memccpy.o memchr.o memcmp.o \
  32. memcpy.o memmove.o mempcpy.o memrchr.o memset.o rawmemchr.o stpcpy.o \
  33. stpncpy.o strcasecmp.o strcasestr.o strcat.o strchrnul.o strchr.o \
  34. strcmp.o strcpy.o strcspn.o strdup.o strlen.o strncasecmp.o strncat.o \
  35. strncmp.o strncpy.o strndup.o strnlen.o strpbrk.o strrchr.o strsep.o \
  36. strspn.o strstr.o strtok.o strtok_r.o strerror.o _susv3_strerror_r.o \
  37. _string_syserrmsgs.o _glibc_strerror_r.o \
  38. _string_syssigmsgs.o sys_siglist.o strsignal.o psignal.o \
  39. __xpg_basename.o strlcat.o strlcpy.o sys_errlist.o memmem.o
  40. MOBJW= wcscasecmp.o wcscat.o wcschrnul.o wcschr.o wcscmp.o wcscpy.o wcscspn.o \
  41. wcsdup.o wcslen.o wcsncasecmp.o wcsncat.o wcsncmp.o wcsncpy.o \
  42. wcsnlen.o wcspbrk.o wcsrchr.o wcsspn.o wcsstr.o wcstok.o wmemchr.o \
  43. wmemcmp.o wmemcpy.o wmemmove.o wmempcpy.o wmemset.o wcpcpy.o wcpncpy.o \
  44. __wcslcpy.o \
  45. wcsxfrm.o strxfrm.o # wcscoll strcoll.o
  46. MOBJx=
  47. MOBJWx=
  48. ifeq ($(UCLIBC_HAS_XLOCALE),y)
  49. MOBJx += strcasecmp_l.o strncasecmp_l.o
  50. MOBJWx += wcscasecmp_l.o wcsncasecmp_l.o wcsxfrm_l.o strxfrm_l.o
  51. endif
  52. #ffsl ffsll
  53. OBJS=$(MOBJ) $(MOBJx)
  54. ifeq ($(UCLIBC_HAS_WCHAR),y)
  55. OBJS += $(MOBJW) $(MOBJWx)
  56. endif
  57. OBJ_LIST=../obj.string
  58. all: $(OBJ_LIST) subdirs
  59. $(OBJ_LIST): $(OBJS)
  60. echo $(patsubst %, string/%, $(OBJS)) > $(OBJ_LIST)
  61. $(MOBJ): $(MSRC)
  62. $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
  63. $(STRIPTOOL) -x -R .note -R .comment $*.o
  64. $(MOBJx): $(MSRC)
  65. $(CC) $(CFLAGS) -DL_$* -D__UCLIBC_DO_XLOCALE $< -c -o $*.o
  66. $(STRIPTOOL) -x -R .note -R .comment $*.o
  67. $(MOBJW): $(MSRC)
  68. $(CC) $(CFLAGS) -DWANT_WIDE -DL_$* $< -c -o $*.o
  69. $(STRIPTOOL) -x -R .note -R .comment $*.o
  70. $(MOBJWx): $(MSRC)
  71. $(CC) $(CFLAGS) -DWANT_WIDE -DL_$* -D__UCLIBC_DO_XLOCALE $< -c -o $*.o
  72. $(STRIPTOOL) -x -R .note -R .comment $*.o
  73. $(COBJS): %.o : %.c
  74. $(CC) $(CFLAGS) -c $< -o $@
  75. $(STRIPTOOL) -x -R .note -R .comment $*.o
  76. clean: subdirs_clean
  77. $(RM) *.[oa] *~ core
  78. subdirs: $(patsubst %, _dir_%, $(DIRS))
  79. subdirs_clean: $(patsubst %, _dirclean_%, $(ALL_SUBDIRS))
  80. $(patsubst %, _dir_%, $(DIRS)) : $(OBJS)
  81. $(MAKE) -C $(patsubst _dir_%, %, $@)
  82. $(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy
  83. $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
  84. .PHONY: dummy