summaryrefslogtreecommitdiff
path: root/apps/Makefile
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-03-20 22:07:56 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-03-20 22:07:56 +0000
commit60051cba0cf424e01ef2eda09816ee8945867b6d (patch)
tree506ffc7c368b1b0756a12099b0f2401e56ea4496 /apps/Makefile
parentf6f8f750c7a25d123dc6f20902b38bcda1c95963 (diff)
downloadnuttx-60051cba0cf424e01ef2eda09816ee8945867b6d.tar.gz
nuttx-60051cba0cf424e01ef2eda09816ee8945867b6d.tar.bz2
nuttx-60051cba0cf424e01ef2eda09816ee8945867b6d.zip
More build fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3407 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/Makefile')
-rw-r--r--apps/Makefile58
1 files changed, 17 insertions, 41 deletions
diff --git a/apps/Makefile b/apps/Makefile
index 76eeb1e92..be7b9f6be 100644
--- a/apps/Makefile
+++ b/apps/Makefile
@@ -41,15 +41,16 @@ APPDIR = ${shell pwd}
# Application Directories
# SUBDIRS is the list of all directories containing Makefiles. It is used
-# only for cleaning.
+# only for cleaning. nuttapp must always be the first in the list.
-SUBDIRS = nshlib netutils examples vsn
+SUBDIRS = nuttapp nshlib netutils examples vsn
-# we use a non-existing .built_always to guarantee that Makefile
-# always walks into the sub-directories and asks for build
+# We use a non-existing .built_always to guarantee that Makefile always walks
+# into the sub-directories and asks for build. NOTE that nuttapp is always
+# in the list of applications to be built
-BUILTIN_APPS_BUILT =
-BUILTIN_APPS_DIR =
+BUILTIN_APPS_BUILT = nuttapp/.built_always
+BUILTIN_APPS_DIR = nuttapp
ifeq ($(CONFIG_BUILTIN_APPS),y)
@@ -89,69 +90,44 @@ $(foreach BUILT, $(AVAILABLE_APPS), $(eval $(call BUILTIN_ADD_BUILT,$(BUILT))))
endif
-# Source and object files
+# The final build target
-ASRCS =
-CSRCS = exec_nuttapp.c
+BIN = libapps$(LIBEXT)
-AOBJS = $(ASRCS:.S=$(OBJEXT))
-COBJS = $(CSRCS:.c=$(OBJEXT))
+# Build targets
-SRCS = $(ASRCS) $(CSRCS)
-OBJS = $(AOBJS) $(COBJS)
+all: $(BIN)
+.PHONY: $(BUILTIN_APPS_BUILT) .depend depend clean distclean
-BIN = libapps$(LIBEXT)
-
-ROOTDEPPATH = --dep-path .
-VPATH =
-
-all: $(BIN)
-.PHONY: .depend depend clean distclean
-
-$(AOBJS): %$(OBJEXT): %.S
- $(call ASSEMBLE, $<, $@)
-
-$(COBJS): %$(OBJEXT): %.c
- $(call COMPILE, $<, $@)
-
$(BUILTIN_APPS_BUILT):
@for dir in $(BUILTIN_APPS_DIR) ; do \
$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR); \
done
-$(BIN): $(OBJS) $(BUILTIN_APPS_BUILT)
+$(BIN): $(BUILTIN_APPS_BUILT)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
.depend: Makefile $(SRCS)
- @echo "/* List of application requirements, generated during make depend. */" > exec_nuttapp_list.h
- @echo "/* List of application entry points, generated during make depend. */" > exec_nuttapp_proto.h
- @$(MKDEP) $(ROOTDEPPATH) \
- $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
- @touch $@
@for dir in $(BUILTIN_APPS_DIR) ; do \
rm -f $$dir/.depend ; \
$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR) depend ; \
done
+ @touch $@
depend: .depend
clean:
- @rm -f $(BIN) *~ .*.swp *.o libapps.a
- $(call CLEAN)
@for dir in $(SUBDIRS) ; do \
$(MAKE) -C $$dir clean TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR); \
done
+ @rm -f $(BIN) *~ .*.swp *.o
+ $(call CLEAN)
distclean: clean
- @rm -f .config
- @rm -f Make.dep .depend
- @rm -f exec_nuttapp_list.h
- @rm -f exec_nuttapp_proto.h
@for dir in $(SUBDIRS) ; do \
$(MAKE) -C $$dir distclean TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR); \
done
-
--include Make.dep
+ @rm -f .config .depend