fix dependencies

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3458 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2011-04-03 16:43:35 +00:00
parent 9ea1d98999
commit 9b9c8f5f30
4 changed files with 40 additions and 20 deletions
+29 -15
View File
@@ -101,7 +101,7 @@ endif
# USERDIRS - When NuttX is build is a monolithic kernel, this provides the # USERDIRS - When NuttX is build is a monolithic kernel, this provides the
# list of directories that must be built # list of directories that must be built
NONFSDIRS = sched lib $(ARCH_SRC) mm $(NUTTX_ADDONS) NONFSDIRS = sched $(ARCH_SRC) mm $(NUTTX_ADDONS)
FSDIRS = fs drivers binfmt FSDIRS = fs drivers binfmt
NETFSDIRS = fs drivers NETFSDIRS = fs drivers
CONTEXTDIRS = $(APPDIR) CONTEXTDIRS = $(APPDIR)
@@ -110,7 +110,9 @@ USERDIRS =
ifeq ($(CONFIG_NUTTX_KERNEL),y) ifeq ($(CONFIG_NUTTX_KERNEL),y)
NONFSDIRS += syscall NONFSDIRS += syscall
CONTEXTDIRS += syscall CONTEXTDIRS += syscall
USERDIRS += syscall $(USER_ADDONS) USERDIRS += syscall lib $(USER_ADDONS)
else
NONFSDIRS += lib
endif endif
ifeq ($(CONFIG_NX),y) ifeq ($(CONFIG_NX),y)
@@ -120,28 +122,33 @@ endif
# CLEANDIRS are the directories that will clean in. These are # CLEANDIRS are the directories that will clean in. These are
# all directories that we know about. # all directories that we know about.
# MAKEDIRS are the directories in which we will build targets # KERNDEPDIRS are the directories in which we will build target dependencies.
# If NuttX and applications are built separately (CONFIG_NUTTX_KERNEL),
# then this holds only the directories containing kernel files.
# USERDEPDIRS. If NuttX and applications are built separately (CONFIG_NUTTX_KERNEL),
# then this holds only the directories containing user files.
CLEANDIRS = $(NONFSDIRS) $(FSDIRS) CLEANDIRS = $(NONFSDIRS) $(FSDIRS) $(USERDIRS)
MAKEDIRS = $(NONFSDIRS) KERNDEPDIRS = $(NONFSDIRS)
USERDEPDIRS = $(USERDIRS)
# Add file system directories to MAKEDIRS (they are already in CLEANDIRS) # Add file system directories to KERNDEPDIRS (they are already in CLEANDIRS)
ifeq ($(CONFIG_NFILE_DESCRIPTORS),0) ifeq ($(CONFIG_NFILE_DESCRIPTORS),0)
ifeq ($(CONFIG_NET),y) ifeq ($(CONFIG_NET),y)
ifneq ($(CONFIG_NSOCKET_DESCRIPTORS),0) ifneq ($(CONFIG_NSOCKET_DESCRIPTORS),0)
MAKEDIRS += fs KERNDEPDIRS += fs
endif endif
MAKEDIRS += drivers KERNDEPDIRS += drivers
endif endif
else else
MAKEDIRS += $(FSDIRS) KERNDEPDIRS += $(FSDIRS)
endif endif
# Add networking directories to MAKEDIRS and CLEANDIRS # Add networking directories to KERNDEPDIRS and CLEANDIRS
ifeq ($(CONFIG_NET),y) ifeq ($(CONFIG_NET),y)
MAKEDIRS += net KERNDEPDIRS += net
endif endif
CLEANDIRS += net CLEANDIRS += net
@@ -341,7 +348,7 @@ syscall/libproxies$(LIBEXT): context
# is an archive. Exactly what is performed during pass1 or what it generates # is an archive. Exactly what is performed during pass1 or what it generates
# is unknown to this makefule unless CONFIG_PASS1_OBJECT is defined. # is unknown to this makefule unless CONFIG_PASS1_OBJECT is defined.
pass1deps: context depend $(USERLIBS) pass1deps: context pass1dep $(USERLIBS)
pass1: pass1deps pass1: pass1deps
ifeq ($(CONFIG_BUILD_2PASS),y) ifeq ($(CONFIG_BUILD_2PASS),y)
@@ -360,7 +367,7 @@ ifeq ($(CONFIG_BUILD_2PASS),y)
@$(MAKE) -C $(CONFIG_PASS1_BUILDIR) TOPDIR="$(TOPDIR)" LINKLIBS="$(NUTTXLIBS)" USERLIBS="$(USERLIBS)" "$(CONFIG_PASS1_TARGET)" @$(MAKE) -C $(CONFIG_PASS1_BUILDIR) TOPDIR="$(TOPDIR)" LINKLIBS="$(NUTTXLIBS)" USERLIBS="$(USERLIBS)" "$(CONFIG_PASS1_TARGET)"
endif endif
pass2deps: context depend $(NUTTXLIBS) pass2deps: context pass2dep $(NUTTXLIBS)
pass2: pass2deps pass2: pass2deps
@$(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" EXTRA_OBJS="$(EXTRA_OBJS)" LINKLIBS="$(NUTTXLIBS)" $(BIN) @$(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" EXTRA_OBJS="$(EXTRA_OBJS)" LINKLIBS="$(NUTTXLIBS)" $(BIN)
@@ -397,11 +404,18 @@ $(BIN): pass1deps pass2deps pass1 pass2
download: $(BIN) download: $(BIN)
$(call DOWNLOAD, $<) $(call DOWNLOAD, $<)
depend: context pass1dep: context
@for dir in $(MAKEDIRS) ; do \ @for dir in $(USERDEPDIRS) ; do \
$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" depend ; \ $(MAKE) -C $$dir TOPDIR="$(TOPDIR)" depend ; \
done done
pass2dep: context
@for dir in $(KERNDEPDIRS) ; do \
$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" depend ; \
done
depend: pass1dep pass2dep
subdir_clean: subdir_clean:
@for dir in $(CLEANDIRS) ; do \ @for dir in $(CLEANDIRS) ; do \
if [ -e $$dir/Makefile ]; then \ if [ -e $$dir/Makefile ]; then \
+7 -1
View File
@@ -324,7 +324,13 @@ must be is one of the following:
are built separately. This build requires a special make command; not are built separately. This build requires a special make command; not
just 'make' but make with the following two arguments: just 'make' but make with the following two arguments:
make pass1 pass2 make pass1 pass2
This is required because in the normal case (just 'make'), make will
create all dependencies then execute the pass1 and pass2 targets. But
this example, pass2 depends on auto-generatd files produced during pass1.
This specall make command ('make pass1 pass2') will make the dependencies
separately for each pass.
nsh: nsh:
Configures the NuttShell (nsh) located at examples/nsh. The Configures the NuttShell (nsh) located at examples/nsh. The
-2
View File
@@ -67,8 +67,6 @@ all: $(TOPDIR)/nuttx_user.elf $(TOPDIR)/User.map $(BOARD_INCLUDE)/user_map.h
nuttx_user.elf: nuttx_user.elf:
@echo "LD: nuttx_user.elf" @echo "LD: nuttx_user.elf"
echo "USER_LDLIBS: $(USER_LDLIBS)"
echo "USER_LIBPATHS: $(USER_LIBPATHS)"
@$(LD) -o $@ $(USER_LDFLAGS) $(USER_LIBPATHS) --start-group $(USER_LDLIBS) --end-group $(USER_LIBGCC) @$(LD) -o $@ $(USER_LDFLAGS) $(USER_LIBPATHS) --start-group $(USER_LDLIBS) --end-group $(USER_LIBGCC)
$(TOPDIR)/nuttx_user.elf: nuttx_user.elf $(TOPDIR)/nuttx_user.elf: nuttx_user.elf
+4 -2
View File
@@ -61,6 +61,7 @@ BIN1 = libproxies$(LIBEXT)
BIN2 = libstubs$(LIBEXT) BIN2 = libstubs$(LIBEXT)
all: $(BIN1) $(BIN2) all: $(BIN1) $(BIN2)
.PHONY: context depend clean distclean
$(AOBJS): %$(OBJEXT): %.S $(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@) $(call ASSEMBLE, $<, $@)
@@ -88,12 +89,13 @@ depend: .depend
$(MKSYSCALL): $(MKSYSCALL):
@$(MAKE) -C $(TOPDIR)/tools -f Makefile.host mksyscall @$(MAKE) -C $(TOPDIR)/tools -f Makefile.host mksyscall
.context: $(MKSYSCALL) syscall.csv .context: syscall.csv
echo "Rebuilding stubs and proxies"
@(cd proxies; $(MKSYSCALL) -p $(CSVFILE);) @(cd proxies; $(MKSYSCALL) -p $(CSVFILE);)
@(cd stubs; $(MKSYSCALL) -s $(CSVFILE);) @(cd stubs; $(MKSYSCALL) -s $(CSVFILE);)
@touch $@ @touch $@
context: .context context: $(MKSYSCALL) .context
clean: clean:
@rm -f $(BIN1) $(BIN2) *~ .*.swp @rm -f $(BIN1) $(BIN2) *~ .*.swp