Makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. DIRS:=
  26. ifeq ($(MALLOC),y)
  27. DIRS+=malloc
  28. endif
  29. ifeq ($(MALLOC_930716),y)
  30. DIRS+=malloc-930716
  31. endif
  32. MSRC = stdlib.c
  33. MOBJ = abs.o labs.o atoi.o atol.o strtol.o strtoul.o _stdlib_strto_l.o \
  34. qsort.o bsearch.o
  35. MOBJ += llabs.o atoll.o strtoll.o strtoull.o _stdlib_strto_ll.o
  36. ifeq ($(UCLIBC_HAS_FLOATS),y)
  37. MOBJ += atof.o
  38. endif
  39. ifeq ($(UCLIBC_HAS_WCHAR),y)
  40. MOBJ += mblen.o mbtowc.o wctomb.o mbstowcs.o wcstombs.o \
  41. _stdlib_mb_cur_max.o
  42. endif
  43. MSRC2=atexit.c
  44. MOBJ2=atexit.o on_exit.o __exit_handler.o exit.o
  45. CSRC = abort.c getenv.c mkdtemp.c mktemp.c realpath.c mkstemp.c mkstemp64.c \
  46. rand.c random.c random_r.c setenv.c system.c div.c ldiv.c getpt.c \
  47. ptsname.c grantpt.c unlockpt.c gcvt.c drand48.c drand48-iter.c \
  48. drand48_r.c erand48.c erand48_r.c jrand48.c jrand48_r.c lrand48.c \
  49. lrand48_r.c mrand48.c mrand48_r.c nrand48.c nrand48_r.c rand_r.c \
  50. srand48.c srand48_r.c calloc.c valloc.c
  51. ifeq ($(UCLIBC_HAS_FLOATS),y)
  52. CSRC += strtod.c strtof.c strtold.c
  53. endif
  54. COBJS=$(patsubst %.c,%.o, $(CSRC))
  55. OBJS=$(MOBJ) $(MOBJ2) $(COBJS)
  56. all: $(OBJS) $(LIBC)
  57. $(LIBC): ar-target subdirs
  58. ar-target: $(OBJS)
  59. $(AR) $(ARFLAGS) $(LIBC) $(OBJS)
  60. $(MOBJ): $(MSRC)
  61. $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
  62. $(STRIPTOOL) -x -R .note -R .comment $*.o
  63. $(MOBJ2): $(MSRC2)
  64. $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
  65. $(STRIPTOOL) -x -R .note -R .comment $*.o
  66. $(COBJS): %.o : %.c
  67. $(CC) $(CFLAGS) -c $< -o $@
  68. $(STRIPTOOL) -x -R .note -R .comment $*.o
  69. $(OBJ): Makefile
  70. subdirs: $(patsubst %, _dir_%, $(DIRS))
  71. subdirs_clean: $(patsubst %, _dirclean_%, $(ALL_SUBDIRS))
  72. $(patsubst %, _dir_%, $(DIRS)) : dummy
  73. $(MAKE) -C $(patsubst _dir_%, %, $@)
  74. $(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy
  75. $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
  76. clean: subdirs_clean
  77. rm -f *.[oa] *~ core
  78. .PHONY: dummy