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:
parent
9ea1d98999
commit
9b9c8f5f30
44
Makefile
44
Makefile
|
@ -101,7 +101,7 @@ endif
|
|||
# USERDIRS - When NuttX is build is a monolithic kernel, this provides the
|
||||
# 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
|
||||
NETFSDIRS = fs drivers
|
||||
CONTEXTDIRS = $(APPDIR)
|
||||
|
@ -110,7 +110,9 @@ USERDIRS =
|
|||
ifeq ($(CONFIG_NUTTX_KERNEL),y)
|
||||
NONFSDIRS += syscall
|
||||
CONTEXTDIRS += syscall
|
||||
USERDIRS += syscall $(USER_ADDONS)
|
||||
USERDIRS += syscall lib $(USER_ADDONS)
|
||||
else
|
||||
NONFSDIRS += lib
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_NX),y)
|
||||
|
@ -120,28 +122,33 @@ endif
|
|||
|
||||
# CLEANDIRS are the directories that will clean in. These are
|
||||
# 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)
|
||||
MAKEDIRS = $(NONFSDIRS)
|
||||
CLEANDIRS = $(NONFSDIRS) $(FSDIRS) $(USERDIRS)
|
||||
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_NET),y)
|
||||
ifneq ($(CONFIG_NSOCKET_DESCRIPTORS),0)
|
||||
MAKEDIRS += fs
|
||||
KERNDEPDIRS += fs
|
||||
endif
|
||||
MAKEDIRS += drivers
|
||||
KERNDEPDIRS += drivers
|
||||
endif
|
||||
else
|
||||
MAKEDIRS += $(FSDIRS)
|
||||
KERNDEPDIRS += $(FSDIRS)
|
||||
endif
|
||||
|
||||
# Add networking directories to MAKEDIRS and CLEANDIRS
|
||||
# Add networking directories to KERNDEPDIRS and CLEANDIRS
|
||||
|
||||
ifeq ($(CONFIG_NET),y)
|
||||
MAKEDIRS += net
|
||||
KERNDEPDIRS += net
|
||||
endif
|
||||
CLEANDIRS += net
|
||||
|
||||
|
@ -341,7 +348,7 @@ syscall/libproxies$(LIBEXT): context
|
|||
# is an archive. Exactly what is performed during pass1 or what it generates
|
||||
# is unknown to this makefule unless CONFIG_PASS1_OBJECT is defined.
|
||||
|
||||
pass1deps: context depend $(USERLIBS)
|
||||
pass1deps: context pass1dep $(USERLIBS)
|
||||
|
||||
pass1: pass1deps
|
||||
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)"
|
||||
endif
|
||||
|
||||
pass2deps: context depend $(NUTTXLIBS)
|
||||
pass2deps: context pass2dep $(NUTTXLIBS)
|
||||
|
||||
pass2: pass2deps
|
||||
@$(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" EXTRA_OBJS="$(EXTRA_OBJS)" LINKLIBS="$(NUTTXLIBS)" $(BIN)
|
||||
|
@ -397,11 +404,18 @@ $(BIN): pass1deps pass2deps pass1 pass2
|
|||
download: $(BIN)
|
||||
$(call DOWNLOAD, $<)
|
||||
|
||||
depend: context
|
||||
@for dir in $(MAKEDIRS) ; do \
|
||||
pass1dep: context
|
||||
@for dir in $(USERDEPDIRS) ; do \
|
||||
$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" depend ; \
|
||||
done
|
||||
|
||||
pass2dep: context
|
||||
@for dir in $(KERNDEPDIRS) ; do \
|
||||
$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" depend ; \
|
||||
done
|
||||
|
||||
depend: pass1dep pass2dep
|
||||
|
||||
subdir_clean:
|
||||
@for dir in $(CLEANDIRS) ; do \
|
||||
if [ -e $$dir/Makefile ]; then \
|
||||
|
|
|
@ -324,7 +324,13 @@ must be is one of the following:
|
|||
are built separately. This build requires a special make command; not
|
||||
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:
|
||||
Configures the NuttShell (nsh) located at examples/nsh. The
|
||||
|
|
|
@ -67,8 +67,6 @@ all: $(TOPDIR)/nuttx_user.elf $(TOPDIR)/User.map $(BOARD_INCLUDE)/user_map.h
|
|||
|
||||
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)
|
||||
|
||||
$(TOPDIR)/nuttx_user.elf: nuttx_user.elf
|
||||
|
|
|
@ -61,6 +61,7 @@ BIN1 = libproxies$(LIBEXT)
|
|||
BIN2 = libstubs$(LIBEXT)
|
||||
|
||||
all: $(BIN1) $(BIN2)
|
||||
.PHONY: context depend clean distclean
|
||||
|
||||
$(AOBJS): %$(OBJEXT): %.S
|
||||
$(call ASSEMBLE, $<, $@)
|
||||
|
@ -88,12 +89,13 @@ depend: .depend
|
|||
$(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 stubs; $(MKSYSCALL) -s $(CSVFILE);)
|
||||
@touch $@
|
||||
|
||||
context: .context
|
||||
context: $(MKSYSCALL) .context
|
||||
|
||||
clean:
|
||||
@rm -f $(BIN1) $(BIN2) *~ .*.swp
|
||||
|
|
Loading…
Reference in New Issue