From 4d952dfe7756644a4e7f92081906fd7d4194209c Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Thu, 21 Nov 2002 06:06:22 +0000 Subject: Improve malloc debugging support. --- libc/stdlib/malloc/Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'libc/stdlib/malloc/Makefile') diff --git a/libc/stdlib/malloc/Makefile b/libc/stdlib/malloc/Makefile index 97527621b..d722d1dc3 100644 --- a/libc/stdlib/malloc/Makefile +++ b/libc/stdlib/malloc/Makefile @@ -27,6 +27,16 @@ include $(TOPDIR)Rules.mak # calloc.c can be found at uClibc/libc/stdlib/calloc.c CSRC = malloc.c free.c realloc.c memalign.c \ heap_alloc.c heap_alloc_at.c heap_free.c + +# Turn on malloc debugging if requested +ifeq ($(UCLIBC_MALLOC_DEBUGGING),y) +CSRC += malloc_debug.c heap_debug.c +CFLAGS += -DMALLOC_DEBUGGING -DHEAP_DEBUGGING +ifeq ($(UCLIBC_UCLINUX_BROKEN_MUNMAP),y) +CFLAGS += -DMALLOC_MMB_DEBUGGING +endif +endif + COBJS=$(patsubst %.c,%.o, $(CSRC)) OBJS=$(COBJS) @@ -37,10 +47,10 @@ $(LIBC): ar-target ar-target: $(OBJS) $(AR) $(ARFLAGS) $(LIBC) $(OBJS) -$(COBJS): %.o : %.c +# Depend on uClinux_config.h to cache changes in __UCLIBC_MALLOC_DEBUGGING__ +$(COBJS): %.o : %.c ../../../include/bits/uClibc_config.h $(CC) $(CFLAGS) -c $< -o $@ $(STRIPTOOL) -x -R .note -R .comment $*.o clean: rm -f *.[oa] *~ core - -- cgit v1.2.3