Makefile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  2. # This file is part of the GNU C Library.
  3. # The GNU C Library is free software; you can redistribute it and/or
  4. # modify it under the terms of the GNU Library General Public License
  5. # as published by the Free Software Foundation; either version 2 of
  6. # the License, or (at your option) any later version.
  7. # The GNU C Library is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. # Library General Public License for more details.
  11. # You should have received a copy of the GNU Library General Public
  12. # License along with the GNU C Library; see the file COPYING.LIB. If
  13. # not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  14. # Cambridge, MA 02139, USA.
  15. # Makefile for standalone distribution of malloc.
  16. # Use this on System V.
  17. #CPPFLAGS = -DUSG
  18. .PHONY: all
  19. all: libmalloc.a gmalloc.o
  20. gmalloc = valloc.c malloc.c free.c cfree.c realloc.c calloc.c morecore.c memalign.c
  21. sources = valloc.c malloc.c free.c cfree.c realloc.c calloc.c morecore.c memalign.c mcheck.c mtrace.c mstats.c vm-limit.c ralloc.c malloc-find.c
  22. objects = valloc.o malloc.o free.o cfree.o realloc.o calloc.o morecore.o memalign.o mcheck.o mtrace.o mstats.o vm-limit.o ralloc.o malloc-find.o
  23. headers = malloc.h
  24. libmalloc.a: $(objects)
  25. ar crv $@ $(objects)
  26. ranlib $@
  27. $(objects): $(headers)
  28. gmalloc.c: gmalloc-head.c $(headers) $(gmalloc) Makefile
  29. cat gmalloc-head.c $(headers) $(gmalloc) > $@-tmp
  30. mv -f $@-tmp $@
  31. # Make it unwritable to avoid accidentally changing the file,
  32. # since it is generated and any changes would be lost.
  33. chmod a-w $@
  34. .c.o:
  35. $(CC) $(CFLAGS) $(CPPFLAGS) -I. -c $< $(OUTPUT_OPTION)
  36. .PHONY: clean realclean malloc-clean malloc-realclean
  37. clean malloc-clean:
  38. -rm -f libmalloc.a *.o core
  39. realclean malloc-realclean: clean
  40. -rm -f TAGS tags *~
  41. # For inside the C library.
  42. malloc.tar malloc.tar.Z: FORCE
  43. $(MAKE) -C .. $@
  44. FORCE: