Makefile 2.6 KB

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