9
0
Fork 0

More build fixes

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@3407 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2011-03-20 22:07:56 +00:00
parent 12595c6ca3
commit e43d5dd837
52 changed files with 243 additions and 142 deletions

View File

@ -10,4 +10,7 @@
* Makefile -- Makefile cosmetics (I am slowly adding the Darjeeling JVM)
* Make.defs -- New file adds common make definitions for applications.
* hello/Makefile -- Now uses new Make.defs definitions. Added README.txt.
* apps/poweroff -- New application to turn off board power.
* apps/poweroff -- New application to turn off board power.
* Moved NSH library, netutils, and examples from the nuttx/ directory to
the apps/ directory
* Moved exec_nuttapp machinery into the nuttapp/ directory.

View File

@ -36,6 +36,6 @@
define REGISTER
@echo "Register: $1"
@echo "{ .name = \"$1\", .priority = $2, .stacksize = $3, .main = $4 }," >> "$(APPDIR)/exec_nuttapp_list.h"
@echo "EXTERN int $4(int argc, char *argv[]);" >> "$(APPDIR)/exec_nuttapp_proto.h"
@echo "{ .name = \"$1\", .priority = $2, .stacksize = $3, .main = $4 }," >> "$(APPDIR)/nuttapp/exec_nuttapp_list.h"
@echo "EXTERN int $4(int argc, char *argv[]);" >> "$(APPDIR)/nuttapp/exec_nuttapp_proto.h"
endef

View File

@ -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

View File

@ -48,7 +48,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -81,7 +81,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -48,7 +48,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -81,7 +81,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -50,7 +50,7 @@ CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS)
OBJS = $(AOBJS) $(COBJS) $(CXXOBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -98,7 +98,7 @@ $(BIN): chkcxx $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -48,7 +48,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -81,7 +81,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -48,7 +48,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -81,7 +81,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -48,7 +48,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -81,7 +81,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -48,7 +48,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -81,7 +81,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -54,7 +54,7 @@ TARG_COBJS = $(TARG_CSRCS:.c=$(OBJEXT))
TARG_SRCS = $(TARG_ASRCS) $(TARG_CSRCS)
TARG_OBJS = $(TARG_AOBJS) $(TARG_COBJS)
TARG_BIN = ../../libapps$(LIBEXT)
TARG_BIN = $(APPDIR)/libapps$(LIBEXT)
HOSTCFLAGS += -DCONFIG_EXAMPLE_NETTEST_HOST=1
ifeq ($(CONFIG_EXAMPLE_NETTEST_SERVER),y)

View File

@ -48,7 +48,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -81,7 +81,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -48,7 +48,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -81,7 +81,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -51,7 +51,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -84,7 +84,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -48,7 +48,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -86,7 +86,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -88,7 +88,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -121,7 +121,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -55,7 +55,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -88,7 +88,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -48,7 +48,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -81,7 +81,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -48,7 +48,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -81,7 +81,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -48,7 +48,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -97,7 +97,7 @@ $(BIN): romfs_testdir.h $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -48,7 +48,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -81,7 +81,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
@make -f Makefile.host clean TOPDIR=$(TOPDIR) APPDIR=$(APPDIR)

View File

@ -48,7 +48,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -81,7 +81,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -48,7 +48,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -84,7 +84,7 @@ $(BIN): headers $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
@make -C content clean TOPDIR=$(TOPDIR) APPDIR=$(APPDIR) CROSSDEV=$(CROSSDEV)
$(call CLEAN)

View File

@ -54,7 +54,7 @@ TARG_COBJS = $(TARG_CSRCS:.c=$(OBJEXT))
TARG_SRCS = $(TARG_ASRCS) $(TARG_CSRCS)
TARG_OBJS = $(TARG_AOBJS) $(TARG_COBJS)
TARG_BIN = ../../libapps$(LIBEXT)
TARG_BIN = $(APPDIR)/libapps$(LIBEXT)
HOSTCFLAGS += -DCONFIG_EXAMPLE_UDP_HOST=1
ifeq ($(CONFIG_EXAMPLE_UDP_SERVER),y)

View File

@ -48,7 +48,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -81,7 +81,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -48,7 +48,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -81,9 +81,9 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
@(MAKE) -f Makefile.host clean TOPDIR=$(TOPDIR) APPDIR=$(APPDIR)
@$(MAKE) -f Makefile.host clean TOPDIR=$(TOPDIR) APPDIR=$(APPDIR)
distclean: clean
@rm -f Make.dep .depend

View File

@ -39,7 +39,7 @@
-include $(TOPDIR)/Make.defs
SRC = host.c
BIN = host
BIN = host$(EXEEXT)
DEFINES =
ifeq ($(CONFIG_EXAMPLES_USBSERIAL_INONLY),y)
@ -55,12 +55,13 @@ ifeq ($(CONFIG_EXAMPLES_USBSERIAL_ONLYBIG),y)
DEFINES += -DCONFIG_EXAMPLES_USBSERIAL_ONLYBIG=1
endif
all: $(BIN)$(EXEEXT)
all: $(BIN)
$(BIN)$(EXEEXT): $(SRC)
$(BIN): $(SRC)
@$(HOSTCC) $(HOSTCFLAGS) $(DEFINES) $^ -o $@
clean:
@rm -f $(BIN) *~ .*.swp *.o
$(call CLEAN)

View File

@ -48,7 +48,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -81,7 +81,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -48,7 +48,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -81,7 +81,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
@make -f Makefile.host clean TOPDIR=$(TOPDIR) APPDIR=$(APPDIR)

View File

@ -49,7 +49,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -82,7 +82,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -52,7 +52,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -86,7 +86,7 @@ endif
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -52,7 +52,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -86,7 +86,7 @@ endif
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -52,7 +52,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -86,7 +86,7 @@ endif
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -52,7 +52,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -86,7 +86,7 @@ endif
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -52,7 +52,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -86,7 +86,7 @@ endif
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -54,7 +54,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -88,7 +88,7 @@ endif
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -52,7 +52,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -113,7 +113,7 @@ endif
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -61,7 +61,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -93,7 +93,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -52,7 +52,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -86,7 +86,7 @@ endif
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -52,7 +52,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -86,7 +86,7 @@ endif
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -73,7 +73,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -102,14 +102,14 @@ $(BIN): $(OBJS)
$(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
# Register application
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean
@rm -f Make.dep .depend
-include Make.dep

95
apps/nuttapp/Makefile Normal file
View File

@ -0,0 +1,95 @@
############################################################################
# apps/nshlib/Makefile
#
# Copyright (C) 2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
# NSH Library
# Source and object files
ASRCS =
CSRCS = exec_nuttapp.c
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
VPATH =
# Build Targets
all: .built
.PHONY: depend .depend clean distclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
$(COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
$(BIN): $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
@touch .built
.built: $(BIN)
.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 $@
depend: .depend
clean:
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean
@rm -f Make.dep .depend
@rm -f exec_nuttapp_list.h
@rm -f exec_nuttapp_proto.h
-include Make.dep

View File

@ -33,6 +33,8 @@
#
############################################################################
-include $(TOPDIR)/.config # Current configuration
# Sub-directories
SUBDIRS = free hello poweroff ramtron sdcard
@ -42,17 +44,20 @@ all: nothing
nothing:
define DOMAKE
@(MAKE) -C $1 $2 TOPDIR="$(TOPDIR) APPDIR=$(APPDIR)"
endef
depend:
$(foreach DIR, $(SUBDIRS), $(eval $(call DOMAKE,$(DIR),depend)))
@for dir in $(SUBDIRS) ; do \
$(MAKE) -C $$dir depend TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR); \
done
clean:
$(foreach DIR, $(SUBDIRS), $(eval $(call DOMAKE,$(DIR),clean)))
@for dir in $(SUBDIRS) ; do \
$(MAKE) -C $$dir clean TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR); \
done
distclean: clean
$(foreach DIR, $(SUBDIRS), $(eval $(call DOMAKE,$(DIR),distclean)))
@for dir in $(SUBDIRS) ; do \
$(MAKE) -C $$dir distclean TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR); \
done
-include Make.dep

View File

@ -61,7 +61,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -95,7 +95,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -61,7 +61,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -95,7 +95,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -61,7 +61,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -95,7 +95,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -61,7 +61,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -95,7 +95,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -61,7 +61,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
@ -95,7 +95,7 @@ $(BIN): $(OBJS)
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
@rm -f *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -349,7 +349,7 @@ endif
download: $(BIN)
$(call DOWNLOAD, $<)
depend:
depend: context
@for dir in $(MAKEDIRS) ; do \
$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" depend ; \
done

View File

@ -118,8 +118,25 @@ fi
# Check for the apps/ dir in the usual place if appdir was not provided
if [ -z "${appdir}" ]; then
# Check for a version file
unset CONFIG_NUTTX_VERSION
if [ -x "${TOPDIR}/.version" ]; then
source "${TOPDIR}/.version"
fi
# Check for an unversioned apps/ directory
if [ -d "${TOPDIR}/../apps" ]; then
appdir="../apps"
else
# Check for a versioned apps/ directory
if [ -d "${TOPDIR}/../apps-${CONFIG_NUTTX_VERSION}" ]; then
appdir="../apps-${CONFIG_NUTTX_VERSION}"
fi
fi
fi

View File

@ -132,11 +132,15 @@ if [ -f ${ZIP_NAME} ] ; then
{ echo "rm ${ZIP_NAME} failed!" ; exit 1 ; }
fi
# Write a version file
# Write a version file. The syntax of file is such that it may be sourced
# by a bash script or included by a Makefile
echo "CONFIG_NUTTX_VERSION=\"${VERSION}\" >${NUTTX}/.version
echo "#!/bin/bash" >${NUTTX}/.version
echo "" >>${NUTTX}/.version
echo "CONFIG_NUTTX_VERSION=\"${VERSION}\" >>${NUTTX}/.version
chmod 755 ${NUTTX}/.version
# Then zip it
# Then zip-up the directories
${TAR} ${TAR_NAME} nuttx-${VERSION}/nuttx nuttx-${VERSION}/apps || \
{ echo "tar of ${TAR_NAME} failed!" ; exit 1 ; }