summaryrefslogtreecommitdiff
path: root/nuttx/mm/Makefile
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-03-08 22:01:50 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-03-08 22:01:50 +0000
commitf2c129b281fc8fa30eccb9b34df534f954ee3c47 (patch)
treea5ff5a1a0415f7fabf66180ccb432243740f4d74 /nuttx/mm/Makefile
parent5e160bcf59441ce40088ca089cbeb4461a0b0d6a (diff)
downloadnuttx-f2c129b281fc8fa30eccb9b34df534f954ee3c47.tar.gz
nuttx-f2c129b281fc8fa30eccb9b34df534f954ee3c47.tar.bz2
nuttx-f2c129b281fc8fa30eccb9b34df534f954ee3c47.zip
up_addregion should use kmm_addregion; move garbage kmm*.c file to mm/. for now
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5721 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/mm/Makefile')
-rw-r--r--nuttx/mm/Makefile72
1 files changed, 61 insertions, 11 deletions
diff --git a/nuttx/mm/Makefile b/nuttx/mm/Makefile
index da41f9f57..4b7412b43 100644
--- a/nuttx/mm/Makefile
+++ b/nuttx/mm/Makefile
@@ -1,7 +1,7 @@
############################################################################
# mm/Makefile
#
-# Copyright (C) 2007, 2012 Gregory Nutt. All rights reserved.
+# Copyright (C) 2007, 2012, 2013 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -35,22 +35,29 @@
-include $(TOPDIR)/Make.defs
-ASRCS =
-CSRCS = mm_initialize.c mm_sem.c mm_addfreechunk.c mm_size2ndx.c mm_shrinkchunk.c \
- mm_malloc.c mm_zalloc.c mm_calloc.c mm_realloc.c \
- mm_memalign.c mm_free.c mm_mallinfo.c
+ASRCS =
+CSRCS = mm_initialize.c mm_sem.c mm_addfreechunk.c mm_size2ndx.c
+CSRCS += mm_shrinkchunk.c mm_malloc.c mm_zalloc.c mm_calloc.c mm_realloc.c
+CSRCS += mm_memalign.c mm_free.c mm_mallinfo.c
+
+ifeq ($(CONFIG_NUTTX_KERNEL),y)
+CSRCS += kmm_initialize.c kmm_addregion.c kmm_semaphore.c
+CSRCS += kmm_kmalloc.c kmm_kzalloc.c kmm_krealloc.c kmm_kfree.c
+endif
ifeq ($(CONFIG_GRAN),y)
-CSRCS += mm_graninit.c mm_granalloc.c mm_granfree.c mm_grancritical.c
+CSRCS += mm_graninit.c mm_granalloc.c mm_granfree.c mm_grancritical.c
endif
-AOBJS = $(ASRCS:.S=$(OBJEXT))
-COBJS = $(CSRCS:.c=$(OBJEXT))
+AOBJS = $(ASRCS:.S=$(OBJEXT))
+COBJS = $(CSRCS:.c=$(OBJEXT))
-SRCS = $(ASRCS) $(CSRCS)
-OBJS = $(AOBJS) $(COBJS)
+SRCS = $(ASRCS) $(CSRCS)
+OBJS = $(AOBJS) $(COBJS)
-BIN = libmm$(LIBEXT)
+UBIN = libumm$(LIBEXT)
+KBIN = libkmm$(LIBEXT)
+BIN = libmm$(LIBEXT)
all: $(BIN)
@@ -63,14 +70,57 @@ $(COBJS): %$(OBJEXT): %.c
$(BIN): $(OBJS)
$(call ARCHIVE, $@, $(OBJS))
+ifneq ($(BIN),$(UBIN))
+.userlib:
+ $(Q) $(MAKE) $(UBIN) BIN=$(UBIN) TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES)
+ $(Q) touch .userlib
+
+$(UBIN): kclean .userlib
+endif
+
+ifneq ($(BIN),$(KBIN))
+.kernlib:
+ $(Q) $(MAKE) $(KBIN) BIN=$(KBIN) TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES)
+ $(Q) touch .kernlib
+
+$(KBIN): uclean .kernlib
+endif
+
.depend: Makefile $(SRCS)
$(Q) $(MKDEP) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@
depend: .depend
+# Clean Targets:
+# Clean user-mode temporary files (retaining the UBIN binary)
+
+uclean:
+ifneq ($(OBJEXT),)
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+ $(Q) if exist .userlib ]; then del *$(OBJEXT)
+else
+ $(Q) ( if [ -f .userlib ]; then rm -f *$(OBJEXT); fi )
+endif
+endif
+ $(call DELFILE, .userlib)
+
+# Clean kernel-mode temporary files (retaining the KBIN binary)
+
+kclean:
+ifneq ($(OBJEXT),)
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+ $(Q) if exist .kernlib ]; then del *$(OBJEXT)
+else
+ $(Q) ( if [ -f .kernlib ]; then rm -f *$(OBJEXT); fi )
+endif
+endif
+ $(call DELFILE, .kernlib)
+
clean:
$(call DELFILE, $(BIN))
+ $(call DELFILE, $(UBIN))
+ $(call DELFILE, $(KBIN))
$(call CLEAN)
distclean: clean