summaryrefslogtreecommitdiff
path: root/libc/stdlib/malloc/Makefile
diff options
context:
space:
mode:
authorMiles Bader <miles@lsi.nec.co.jp>2002-11-21 06:06:22 +0000
committerMiles Bader <miles@lsi.nec.co.jp>2002-11-21 06:06:22 +0000
commit4d952dfe7756644a4e7f92081906fd7d4194209c (patch)
tree3ae59605aa27796cd2f1bc7d9bb852d3cb588a83 /libc/stdlib/malloc/Makefile
parentac6d271cf95d6994c88ff8dcc096b98f33c50644 (diff)
Improve malloc debugging support.
Diffstat (limited to 'libc/stdlib/malloc/Makefile')
-rw-r--r--libc/stdlib/malloc/Makefile14
1 files changed, 12 insertions, 2 deletions
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
-