summaryrefslogtreecommitdiffstats
path: root/apps/Makefile
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-01 14:30:43 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-01 14:30:43 +0000
commit37701ac70a3047f8f161628e6f59dfacc185233f (patch)
treea9e1ace6553b36b63ca53dbda5853204841cc10d /apps/Makefile
parentf56ab8abdd81316f1c6d7430359179062724cebf (diff)
Remove .built_always
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3449 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/Makefile')
-rw-r--r--apps/Makefile42
1 files changed, 12 insertions, 30 deletions
diff --git a/apps/Makefile b/apps/Makefile
index e4e51caa8c..f440827b03 100644
--- a/apps/Makefile
+++ b/apps/Makefile
@@ -45,60 +45,42 @@ APPDIR = ${shell pwd}
SUBDIRS = namedapp 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. NOTE that namedapp is always
-# in the list of applications to be built
-
-BUILTIN_APPS_BUILT = namedapp/.built_always
-BUILTIN_APPS_DIR = namedapp
-
# CONFIGURED_APPS is the list of all configured built-in directories/built action
# It is created by the configured appconfig file (a copy of which appears in this
-# directoy as .config)
+# directory as .config)
CONFIGURED_APPS =
-include .config
-# AVAILABLE_APPS is the list of currently available application directories. It
+# BUILTIN_APPS_DIR is the list of currently available application directories. It
# is the same as CONFIGURED_APPS, but filtered to exclude any non-existent apps
+# namedapp is always in the list of applications to be built
-AVAILABLE_APPS =
-
-define ADD_AVAILABLE
-AVAILABLE_APPS += ${shell DIR=`echo $1 | cut -d'=' -f1`; if [ -r $$DIR/Makefile ]; then echo "$1"; fi}
-endef
+BUILTIN_APPS_DIR = namedapp
-define BUILTIN_ADD_APP
-BUILTIN_APPS_DIR += ${shell echo $1 | cut -d'=' -f1}
-endef
+# Create the list of available applications (BUILTIN_APPS_DIR)
-define BUILTIN_ADD_BUILT
-BUILTIN_APPS_BUILT += ${shell echo $1 | sed -e "s:=:/:g"}
+define ADD_BUILTIN
+BUILTIN_APPS_DIR += ${shell if [ -r $1/Makefile ]; then echo "$1"; fi}
endef
-# (1) Create the list of available applications (AVAILABLE_APPS), (2) Add each
-# available app to the list of to build (BUILTIN_APPS_DIR), and (3) Add the
-# "built" indication for each app (BUILTIN_APPS_BUILT).
-
-$(foreach BUILTIN, $(CONFIGURED_APPS), $(eval $(call ADD_AVAILABLE,$(BUILTIN))))
-$(foreach APP, $(AVAILABLE_APPS), $(eval $(call BUILTIN_ADD_APP,$(APP))))
-$(foreach BUILT, $(AVAILABLE_APPS), $(eval $(call BUILTIN_ADD_BUILT,$(BUILT))))
+$(foreach BUILTIN, $(CONFIGURED_APPS), $(eval $(call ADD_BUILTIN,$(BUILTIN))))
# The final build target
-BIN = libapps$(LIBEXT)
+BIN = libapps$(LIBEXT)
# Build targets
all: $(BIN)
-.PHONY: $(BUILTIN_APPS_BUILT) context depend clean distclean
+.PHONY: $(BUILTIN_APPS_DIR) context depend clean distclean
-$(BUILTIN_APPS_BUILT):
+$(BUILTIN_APPS_DIR):
@for dir in $(BUILTIN_APPS_DIR) ; do \
$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR); \
done
-$(BIN): $(BUILTIN_APPS_BUILT)
+$(BIN): $(BUILTIN_APPS_DIR)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )