home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / src / amiga / dbmalloc-1.14-src.lha / dbmalloc-1.14 / Makefile.in < prev    next >
Encoding:
Makefile  |  1995-01-12  |  7.9 KB  |  306 lines

  1. #
  2. #  (c) Copyright 1990, 1991, 1992 Conor P. Cahill (uunet!virtech!cpcahil).  
  3. #  This software may be distributed freely as long as the following conditions
  4. #  are met:
  5. #          * the distribution, or any derivative thereof, may not be
  6. #           included as part of a commercial product
  7. #         * full source code is provided including this copyright
  8. #         * there is no charge for the software itself (there may be
  9. #           a minimal charge for the copying or distribution effort)
  10. #         * this copyright notice is not modified or removed from any
  11. #           source file
  12. #
  13. #
  14. # $Id: Makefile,v 1.39 1992/08/22 16:27:13 cpcahil Exp $
  15. #
  16. # This is the Makefile for the malloc debugging library
  17. #
  18. # NOTE: while most porting changes are made here, the malloc.h file
  19. #       may require hand editing (mostly the DATATYPE and SIZETYPE
  20. #    typedefs) because of system wierdities.
  21. #
  22. # Useful targets:
  23. #
  24. #    all        make all programs/libs in the local directory
  25. #    install        install updated programs/libs
  26. #    frcinstall    install all programs/libs
  27. #    tests        build tests
  28. #    runtests    build and run all tests
  29. #    clean        clean up after yourself
  30. #    fullclean    clean up everything (including configure stuff)
  31. #
  32. # NOTE: there are several other targets used by myself for souce code
  33. # maintenance related functions.  These are probably specific to my system
  34. # and may not do what they are supposed to do in a different environment.
  35. # Therefore, unless you know what you are doing, I would suggest not running
  36. # them (hence why they are not documented here).
  37. #
  38. # And now, onto a few definitions that you may need to alter
  39. #
  40. # The following defines may be added as necessary to the CFLAGS definition:
  41. #
  42. # -DANSI_NULLS      if you want to allow passing of NULL pointers to realloc
  43. #            and/or free (as ANSI does) even if the library is
  44. #            compiled by a non-ANSI compiler.
  45. # -DNO_ANSI_NULLS     if you DON'T want to allow passing of NULL pointers to
  46. #            realloc and/or free, even if the library is compiled by
  47. #            an ANSI conforming compiler.
  48. # -DDONT_USE_ASM    don't use ASM speedups when replacing system memcpy
  49. #            and/or memset routines
  50. # -DCTYPE_SUPPORT=x    where x is one of the following
  51. #
  52. #                1 - use plain-jane ctype.h which is only valid
  53. #                    for the ansii character set (DEFAULT)
  54. #                2 - use POSIX setlocal() to setup the character
  55. #                    set definitions
  56. #                3 - use C library islower() & toupper()
  57. #                    functions
  58. #
  59. # NOTE: if you add any flags other than the above to the CFLAGS, you might want
  60. #    to add a similar arguement in the Config.flags file.  However, you
  61. #     should remember that the malloc.h configuration will depend upon these
  62. #    settings and you could have a problem if you attempt to use the file
  63. #    in a compile session that doesn't include these flags.
  64. #
  65.  
  66. srcdir =    @srcdir@
  67. VPATH =        @srcdir@
  68.  
  69. prefix =    @prefix@
  70. exec_prefix =    @exec_prefix@
  71.  
  72. bindir =    $(exec_prefix)/bin
  73. libdir =    $(exec_prefix)/lib
  74. incdir =    $(prefix)/include
  75. infodir =    $(prefix)/info
  76.  
  77. INSTALL =    @INSTALL@
  78. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  79. INSTALL_DATA =    @INSTALL_DATA@
  80.  
  81. SHELL =        /bin/sh
  82. CC =        @CC@
  83. AR =        ar
  84. RM =        rm
  85. RANLIB =    @RANLIB@
  86. DEFS =        @DEFS@
  87. LIBS =        @LIBS@
  88. CFLAGS =    @CFLAGS@
  89. LDFLAGS =    @LDFLAGS@
  90.  
  91. INCLUDES =    -I. -I$(srcdir)
  92. OUR_CFLAGS =    $(DEFS) $(INCLUDES) $(CFLAGS)
  93.  
  94. .c.o:
  95.         $(CC) -c $(OUR_CFLAGS) $<
  96. #
  97. # miscellaneous commands
  98. #
  99. # NOTE: if you change CC to a non-K&R compiler be sure to read the 
  100. #       PROBLEMS file first.
  101. #
  102. CPROTO=/gnu/bin/cproto
  103. LINT=lint
  104. NROFF=nroff
  105. SHARCMD=makekit -p -m -nmallocshar.
  106.  
  107. LIB =        libdbmalloc.a
  108. LINTLIB =    llib-ldbmal.ln
  109.  
  110. #
  111. # You shouldn't have to modify anything below this line
  112. #
  113.  
  114. LIBSRCS=    malloc.c datamc.c datams.c dgmalloc.c fill.c free.c realloc.c \
  115.         calloc.c string.c mcheck.c mchain.c memory.c tostring.c    \
  116.         m_perror.c m_init.c mallopt.c dump.c stack.c xmalloc.c    \
  117.         xheap.c malign.c size.c abort.c leak.c sbrk.c
  118.  
  119. LIBOBJS=    $(LIBSRCS:.c=.o)
  120.  
  121.  
  122. SRCS =        $(LIBSRCS) testmalloc.c testmem.c testerr.c teststack.c cctest.c
  123. HDRS =        malloc.h.org mallocin.h debug.h tostring.h
  124.  
  125. BUILDFILES =    malloc.man prototypes.h 
  126.  
  127. MANSRCFILES =    patchlevel README PROBLEMS CHANGES Buildpatch minipatch Makefile \
  128.         malloc.3 malloc.man $(SRCS) $(HDRS) prototypes.h \
  129.         Configure Config.flags Runtests testerr.base
  130.  
  131. SRCFILES =    MANIFEST $(MANSRCFILES)
  132.  
  133. TESTS =        testmalloc testmem testerr teststack
  134.  
  135. all :        $(LIB) tests
  136.  
  137. install :    $(LIBINSTDIR)/$(LIB) $(INCINSTDIR)/malloc.h \
  138.         $(MANINSTDIR)/$(MANINSTNAME)
  139.  
  140. frcinstall :    rminstall install
  141.  
  142. rminstall:
  143.         rm -f $(LIBINSTDIR)/$(LIB) $(INCINSTDIR)/malloc.h \
  144.         $(MANINSTDIR)/$(MANINSTNAME)
  145.  
  146. $(LIBINSTDIR)/$(LIB): $(LIB)
  147.         -rm -f $@.old
  148.         -mv -f $@ $@.old
  149.         cp $? $@
  150.         @-if test -s $(RANLIB); then $(RANLIB) $@; \
  151.              else if test -s /bin/ranlib; then /bin/ranlib $@; \
  152.          else if test -s /gnu/bin/ranlib; then /gnu/bin/ranlib $@; \
  153.          else exit 0; fi; fi; fi
  154.         -chmod 644 $@
  155.         -rm -f $@.old
  156.  
  157. $(INCINSTDIR)/malloc.h: malloc.h
  158.         -rm -f $@.old
  159.         -mv -f $@ $@.old
  160.         cp $? $@
  161.         -chmod 644 $@
  162.         -rm -f $@.old
  163.     
  164. $(MANINSTDIR)/$(MANINSTNAME): $(MANINSTVER)
  165.         -rm -f $@.old
  166.         -mv -f $@ $@.old
  167.         cp $? $@
  168.         -chmod 644 $@
  169.         -rm -f $@.old
  170.  
  171. tests:        $(TESTS)
  172.  
  173. #
  174. # runtests - target for building and running the tests.  Note that we 
  175. # run testmalloc with fill_area disabled.  This is because testmalloc is
  176. # a malloc exerciser and we just want to see if we broke malloc, not verify
  177. # that the test doesn't overwrite memory (since it doesn't).
  178. #
  179.  
  180. runtests :    tests
  181.         @echo "Running all of the test programs.  This may take a while so"
  182.         @echo "please be patient.  Note that you won't see any output unless"
  183.         @echo "a test fails....."
  184.         ./Runtests
  185.  
  186. clean :  
  187.         rm -f $(TESTS) pgm cctest $(LIB) *.o *.ln Runtests.out malloc.h \
  188.         sysdefs.h
  189.  
  190. fullclean :    clean
  191.         rm -f .configure .configure.[sO] *.O core cscope.out tags
  192.  
  193. sharfile :    $(SRCFILES) CHECKSUMS
  194.         $(SHARCMD)
  195.  
  196. CHECKSUMS :    $(SRCFILES)
  197.         echo "SYSV sums:\n" > CHECKSUMS
  198.         sum $(SRCFILES) >> CHECKSUMS
  199.         echo "\nBSD sums (generated using sum -r on SYSV system):\n" >>CHECKSUMS
  200.         sum -r $(SRCFILES) >> CHECKSUMS
  201.  
  202. MANIFEST :    $(MANSRCFILES)    
  203.         $(SHARCMD) -x
  204.         chmod -w MANIFEST
  205.     
  206. $(LIB) :    $(LIBOBJS)
  207.         $(RM) -f $@
  208.         $(AR) crv $@ $(LIBOBJS)
  209.         $(RANLIB) $@
  210.  
  211. $(LINTLIB) :    $(LIBSRCS)
  212.         $(LINT) -x -v -o dbmal $(LIBSRCS)
  213.  
  214. #
  215. # stuff for building the nroffed version of the manual page
  216. #
  217.  
  218. man :        malloc.man
  219.  
  220. malloc.man :    malloc.3
  221.         rm -f malloc.man
  222.         $(NROFF) -man malloc.3 | col -b > malloc.man
  223.  
  224. #
  225. # stuff for building the test programs
  226. #
  227.  
  228. testmalloc :    $(LIB) testmalloc.o
  229.         $(CC) $(CFLAGS) -o $@ testmalloc.o $(LIB)
  230.  
  231. testmem :    $(LIB) testmem.o
  232.         $(CC) $(CFLAGS) -o $@ testmem.o $(LIB)
  233.  
  234. teststack :    $(LIB) teststack.o
  235.         $(CC) $(CFLAGS) -o $@ teststack.o $(LIB)
  236.  
  237. testerr :    $(LIB) testerr.o
  238.         $(CC) $(CFLAGS) -o $@ testerr.o $(LIB)
  239.  
  240. #
  241. # misc stuff for source code maintenance
  242. #
  243.  
  244. lint :    
  245.         $(LINT) $(CFLAGS) $(SRCS)
  246.  
  247. proto :
  248.         rm -f prototypes.h
  249.         make prototypes.h
  250.  
  251. prototypes.h :    $(LIBSRCS) $(HDRS) malloc.h
  252.         @if [ ! -s $(CPROTO) ]; then \
  253.             echo "Need cproto to rebuild prototypes file";\
  254.             exit 1; \
  255.         else \
  256.             exit 0; \
  257.         fi
  258.         -rm -f prototypes.h
  259.         cp /dev/null prototypes.h
  260.         $(CPROTO) -Dforce_cproto_to_use_defines -D__STDC__ \
  261.              -DDONT_USE_ASM -m__stdcargs -f4 $(LIBSRCS) \
  262.              | sed -e "s/const/CONST/g" > prototypes.new
  263.         mv prototypes.new prototypes.h
  264.         chmod -w prototypes.h
  265.     
  266. patch :        $(SRCFILES)
  267.         sh Buildpatch $(SRCFILES)
  268.  
  269. srclist :
  270.         @echo $(SRCFILES)
  271.  
  272. rcsclean :    $(BUILDFILES)
  273.         -rcsclean -q $(SRCFILES)
  274.         -ls $(SRCFILES) 2>/dev/null > files.list
  275.         -rcs -i -t/dev/null `cat files.list` 2>/dev/null
  276.         @set -e; \
  277.         echo "files to be checked in: `cat files.list`"; \
  278.         echo "\n\tMessage: \c"; \
  279.         read message; \
  280.         echo ""; \
  281.         rcs -q -l `cat files.list`; \
  282.         ci -m"$$message" `cat files.list`; \
  283.         co -u $(SRCFILES)
  284.  
  285. #
  286. # special rules for building datams.o and datamc.o
  287. #
  288.  
  289. datams.o :    datams.c malloc.h mallocin.h sysdefs.h
  290. datamc.o :    datamc.c malloc.h mallocin.h sysdefs.h
  291.  
  292. #
  293. # include file dependencies
  294. #
  295.  
  296. $(LIBOBJS) :    malloc.h mallocin.h sysdefs.h
  297.  
  298. testerr.o :    malloc.h sysdefs.h
  299. testmalloc.o :    malloc.h sysdefs.h
  300. testmem.o :    malloc.h sysdefs.h
  301. tostring.o :    tostring.h sysdefs.h
  302. malloc.o :    tostring.h sysdefs.h
  303. dump.o :    tostring.h sysdefs.h
  304.