home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / glibc-1.06 / malloc / Makefile < prev    next >
Encoding:
Makefile  |  1993-05-14  |  3.0 KB  |  98 lines

  1. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  2. # This file is part of the GNU C Library.
  3.  
  4. # The GNU C Library is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU Library General Public License as
  6. # published by the Free Software Foundation; either version 2 of the
  7. # License, or (at your option) any later version.
  8.  
  9. # The GNU C Library is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. # Library General Public License for more details.
  13.  
  14. # You should have received a copy of the GNU Library General Public
  15. # License along with the GNU C Library; see the file COPYING.LIB.  If
  16. # not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. # Cambridge, MA 02139, USA.
  18.  
  19. #
  20. #    Makefile for malloc routines
  21. #
  22. subdir    := malloc
  23.  
  24. all: 
  25.  
  26. dist-headers := malloc.h
  27. headers := $(dist-headers) obstack.h
  28.  
  29. # Things which get pasted together into gmalloc.c.
  30. gmalloc-routines := malloc free cfree realloc calloc morecore memalign valloc
  31. # Things to include in the standalone distribution.
  32. dist-routines = $(gmalloc-routines) \
  33.         mcheck mtrace mstats vm-limit ralloc
  34. routines = $(dist-routines) obstack
  35.  
  36. # Frob these guys' copying notices.
  37. gpl2lgpl := obstack.c obstack.h vm-limit.c mem-limits.h ralloc.c
  38.  
  39. install-lib := libmcheck.a
  40.  
  41. distribute := mcheck-init.c OChangeLog TODO \
  42.           malloc/gmalloc-head.c dist-README dist-Makefile \
  43.           mtrace.awk mem-limits.h getpagesize.h
  44.  
  45. # These should be removed by `make clean'.
  46. extra-objs = mcheck-init.o libmcheck.a
  47.  
  48.  
  49. # Make the standalone malloc distribution.
  50. malloc-dist := README COPYING.LIB Makefile ChangeLog OChangeLog \
  51.            $(addsuffix .c,$(dist-routines)) $(dist-headers) \
  52.            getpagesize.h mem-limits.h gmalloc.c \
  53.            gmalloc-head.c mtrace.awk
  54. %.uu: %
  55.     uuencode $< < $< > $@-tmp
  56.     mv $@-tmp $@
  57. %.Z: %
  58.     compress -c $< > $@-tmp
  59.     mv $@-tmp $@
  60. %.z: %
  61.     gzip -9 -c $< > $@-tmp
  62.     mv $@-tmp $@
  63.  
  64. malloc.tar: $(addprefix malloc/,$(malloc-dist))
  65.     tar cho$(verbose)f $@ $^
  66.  
  67. malloc/ChangeLog: ../ChangeLog
  68.     changelog-extract --regexp 'malloc/.*' < $< > $@.new
  69.     (echo ''; echo 'Find older changes in OChangeLog.') >> $@.new
  70.     chmod a-w $@.new
  71.     mv $@.new $@
  72.  
  73. malloc/Makefile: dist-Makefile Makefile
  74.     sed -e 's,<GMALLOC-SOURCES>,$(addsuffix .c,$(gmalloc-routines)),' \
  75.         -e 's,<DIST-SOURCES>,$(addsuffix .c,$(dist-routines)),' \
  76.         -e 's,<DIST-OBJECTS>,$(addsuffix .o,$(dist-routines)),' \
  77.         -e 's,<DIST-HEADERS>,$(dist-headers),' < $< > $@-tmp
  78.     mv -f $@-tmp $@
  79. # Make it unwritable to avoid accidentally changing the file,
  80. # since it is generated and any changes would be lost.
  81.     chmod a-w $@
  82. malloc/gmalloc.c: malloc/Makefile \
  83.           $(addprefix malloc/,$(headers) \
  84.                             $(addsuffix .c,$(dist-routines)))
  85.     $(MAKE) -C malloc gmalloc.c
  86. malloc/README: dist-README
  87.     @rm -f $@
  88.     cp $< $@
  89. malloc/%: %
  90.     @rm -f $@
  91.     cp $< $@
  92.  
  93. include ../Rules
  94.  
  95. $(objpfx)libmcheck.a: $(objpfx)mcheck-init.o
  96.     -rm -f $@
  97.     ln $< $@
  98.