Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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=strto_l.c
  28. MOBJ=strtol.o strtoul.o strto_l.o atoi.o atol.o
  29. MSRC1=strto_ll.c
  30. MOBJ1=strtoll.o strtoull.o strto_ll.o atoll.o
  31. MSRC2=atexit.c
  32. MOBJ2=atexit.o exit.o
  33. CSRC = abort.c getenv.c mktemp.c qsort.c realpath.c abs.c bsearch.c \
  34. mkstemp.c putenv.c rand.c random.c setenv.c system.c div.c ldiv.c \
  35. getpt.c ptsname.c grantpt.c unlockpt.c gcvt.c
  36. ifeq ($(HAS_FLOATING_POINT),true)
  37. CSRC += strtod.c
  38. endif
  39. COBJS=$(patsubst %.c,%.o, $(CSRC))
  40. OBJS=$(MOBJ) $(MOBJ2) $(COBJS)
  41. ifeq ($(HAS_LONG_LONG),true)
  42. OBJS += $(MOBJ1)
  43. endif
  44. all: $(OBJS) $(LIBC)
  45. $(LIBC): ar-target subdirs
  46. ar-target: $(OBJS)
  47. $(AR) $(ARFLAGS) $(LIBC) $(OBJS)
  48. $(MOBJ): $(MSRC)
  49. $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
  50. $(STRIPTOOL) -x -R .note -R .comment $*.o
  51. $(MOBJ1): $(MSRC1)
  52. $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
  53. $(STRIPTOOL) -x -R .note -R .comment $*.o
  54. $(MOBJ2): $(MSRC2)
  55. $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
  56. $(STRIPTOOL) -x -R .note -R .comment $*.o
  57. $(COBJS): %.o : %.c
  58. $(CC) $(CFLAGS) -c $< -o $@
  59. $(STRIPTOOL) -x -R .note -R .comment $*.o
  60. $(OBJ): Makefile
  61. subdirs: $(patsubst %, _dir_%, $(DIRS))
  62. subdirs_clean: $(patsubst %, _dirclean_%, $(ALL_SUBDIRS))
  63. $(patsubst %, _dir_%, $(DIRS)) : dummy
  64. $(MAKE) -C $(patsubst _dir_%, %, $@)
  65. $(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy
  66. $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
  67. clean: subdirs_clean
  68. rm -f *.[oa] *~ core
  69. .PHONY: dummy