Misc changes to accept setenv.bat; Add UG-2864AMBAG01 reverse landscape support

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5326 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2012-11-09 22:37:52 +00:00
parent 80f8563f4d
commit de47b5e4cf
4 changed files with 218 additions and 149 deletions

256
Makefile
View file

@ -33,7 +33,7 @@
#
############################################################################
TOPDIR := ${shell pwd | sed -e 's/ /\\ /g'}
TOPDIR := ${shell pwd | sed -e 's/ /\\ /g'}
-include ${TOPDIR}/.config
-include ${TOPDIR}/tools/Config.mk
-include ${TOPDIR}/Make.defs
@ -49,21 +49,21 @@ endif
# Default tools
ifeq ($(DIRLINK),)
DIRLINK = $(TOPDIR)/tools/link.sh
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
DIRLINK = $(TOPDIR)/tools/link.sh
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
endif
# This define is passed as EXTRADEFINES for kernel-mode builds. It is also passed
# during PASS1 (but not PASS2) context and depend targets.
KDEFINE = ${shell $(TOPDIR)/tools/define.sh $(CC) __KERNEL__}
KDEFINE = ${shell $(TOPDIR)/tools/define.sh $(CC) __KERNEL__}
# Process architecture and board-specific directories
ARCH_DIR = arch/$(CONFIG_ARCH)
ARCH_SRC = $(ARCH_DIR)/src
ARCH_INC = $(ARCH_DIR)/include
BOARD_DIR = configs/$(CONFIG_ARCH_BOARD)
ARCH_DIR = arch/$(CONFIG_ARCH)
ARCH_SRC = $(ARCH_DIR)/src
ARCH_INC = $(ARCH_DIR)/include
BOARD_DIR = configs/$(CONFIG_ARCH_BOARD)
# Add-on directories. These may or may not be in place in the
# NuttX source tree (they must be specifically installed)
@ -74,22 +74,22 @@ BOARD_DIR = configs/$(CONFIG_ARCH_BOARD)
# a Makefile is found at the path provided by CONFIG_APPS_DIR
ifeq ($(CONFIG_APPS_DIR),)
CONFIG_APPS_DIR = ../apps
CONFIG_APPS_DIR = ../apps
endif
APPDIR := ${shell if [ -r $(CONFIG_APPS_DIR)/Makefile ]; then echo "$(CONFIG_APPS_DIR)"; fi}
APPDIR := ${shell if [ -r $(CONFIG_APPS_DIR)/Makefile ]; then echo "$(CONFIG_APPS_DIR)"; fi}
# All add-on directories.
#
# NUTTX_ADDONS is the list of directories built into the NuttX kernel.
# USER_ADDONS is the list of directories that will be built into the user application
NUTTX_ADDONS := $(NX_DIR)
USER_ADDONS :=
NUTTX_ADDONS := $(NX_DIR)
USER_ADDONS :=
ifeq ($(CONFIG_NUTTX_KERNEL),y)
USER_ADDONS += $(APPDIR)
USER_ADDONS += $(APPDIR)
else
NUTTX_ADDONS += $(APPDIR)
NUTTX_ADDONS += $(APPDIR)
endif
# Lists of build directories.
@ -106,37 +106,37 @@ endif
# be cleaned to prevent garbarge from collecting in them when changing
# configurations.
NONFSDIRS = sched $(ARCH_SRC) $(NUTTX_ADDONS)
FSDIRS = fs drivers binfmt
CONTEXTDIRS = $(APPDIR)
USERDIRS =
NONFSDIRS = sched $(ARCH_SRC) $(NUTTX_ADDONS)
FSDIRS = fs drivers binfmt
CONTEXTDIRS = $(APPDIR)
USERDIRS =
ifeq ($(CONFIG_NUTTX_KERNEL),y)
NONFSDIRS += syscall
CONTEXTDIRS += syscall
USERDIRS += syscall lib mm $(USER_ADDONS)
NONFSDIRS += syscall
CONTEXTDIRS += syscall
USERDIRS += syscall lib mm $(USER_ADDONS)
ifeq ($(CONFIG_HAVE_CXX),y)
USERDIRS += libxx
USERDIRS += libxx
endif
else
NONFSDIRS += lib mm
OTHERDIRS += syscall $(USER_ADDONS)
NONFSDIRS += lib mm
OTHERDIRS += syscall $(USER_ADDONS)
ifeq ($(CONFIG_HAVE_CXX),y)
NONFSDIRS += libxx
NONFSDIRS += libxx
else
OTHERDIRS += libxx
OTHERDIRS += libxx
endif
endif
ifeq ($(CONFIG_NX),y)
NONFSDIRS += graphics
CONTEXTDIRS += graphics
NONFSDIRS += graphics
CONTEXTDIRS += graphics
else
OTHERDIRS += graphics
OTHERDIRS += graphics
endif
# CLEANDIRS are the directories that will clean in. These are
@ -147,29 +147,29 @@ endif
# USERDEPDIRS. If NuttX and applications are built separately (CONFIG_NUTTX_KERNEL),
# then this holds only the directories containing user files.
CLEANDIRS = $(NONFSDIRS) $(FSDIRS) $(USERDIRS) $(OTHERDIRS)
KERNDEPDIRS = $(NONFSDIRS)
USERDEPDIRS = $(USERDIRS)
CLEANDIRS = $(NONFSDIRS) $(FSDIRS) $(USERDIRS) $(OTHERDIRS)
KERNDEPDIRS = $(NONFSDIRS)
USERDEPDIRS = $(USERDIRS)
# 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)
KERNDEPDIRS += fs
KERNDEPDIRS += fs
endif
KERNDEPDIRS += drivers
KERNDEPDIRS += drivers
endif
else
KERNDEPDIRS += $(FSDIRS)
KERNDEPDIRS += $(FSDIRS)
endif
# Add networking directories to KERNDEPDIRS and CLEANDIRS
ifeq ($(CONFIG_NET),y)
KERNDEPDIRS += net
KERNDEPDIRS += net
endif
CLEANDIRS += net
CLEANDIRS += net
#
# Extra objects used in the final link.
@ -179,7 +179,7 @@ CLEANDIRS += net
# be created). If the pass1 obect is an archive, it could go anywhere.
ifeq ($(CONFIG_BUILD_2PASS),y)
EXTRA_OBJS += $(CONFIG_PASS1_OBJECT)
EXTRA_OBJS += $(CONFIG_PASS1_OBJECT)
endif
# NUTTXLIBS is the list of NuttX libraries that is passed to the
@ -189,18 +189,18 @@ endif
# USERLIBS is the list of libraries used to build the final user-space
# application
NUTTXLIBS = sched/libsched$(LIBEXT) $(ARCH_SRC)/libarch$(LIBEXT)
USERLIBS =
NUTTXLIBS = sched/libsched$(LIBEXT) $(ARCH_SRC)/libarch$(LIBEXT)
USERLIBS =
# Add libraries for syscall support. The C library will be needed by
# both the kernel- and user-space builds. For now, the memory manager (mm)
# is placed in user space (only).
ifeq ($(CONFIG_NUTTX_KERNEL),y)
NUTTXLIBS += syscall/libstubs$(LIBEXT) lib/libklib$(LIBEXT)
USERLIBS += syscall/libproxies$(LIBEXT) lib/libulib$(LIBEXT) mm/libmm$(LIBEXT)
NUTTXLIBS += syscall/libstubs$(LIBEXT) lib/libklib$(LIBEXT)
USERLIBS += syscall/libproxies$(LIBEXT) lib/libulib$(LIBEXT) mm/libmm$(LIBEXT)
else
NUTTXLIBS += mm/libmm$(LIBEXT) lib/liblib$(LIBEXT)
NUTTXLIBS += mm/libmm$(LIBEXT) lib/liblib$(LIBEXT)
endif
# Add libraries for C++ support. CXX, CXXFLAGS, and COMPILEXX must
@ -208,9 +208,9 @@ endif
ifeq ($(CONFIG_HAVE_CXX),y)
ifeq ($(CONFIG_NUTTX_KERNEL),y)
USERLIBS += libxx/liblibxx$(LIBEXT)
USERLIBS += libxx/liblibxx$(LIBEXT)
else
NUTTXLIBS += libxx/liblibxx$(LIBEXT)
NUTTXLIBS += libxx/liblibxx$(LIBEXT)
endif
endif
@ -218,44 +218,44 @@ endif
ifneq ($(APPDIR),)
ifeq ($(CONFIG_NUTTX_KERNEL),y)
USERLIBS += $(APPDIR)/libapps$(LIBEXT)
USERLIBS += $(APPDIR)/libapps$(LIBEXT)
else
NUTTXLIBS += $(APPDIR)/libapps$(LIBEXT)
NUTTXLIBS += $(APPDIR)/libapps$(LIBEXT)
endif
endif
# Add libraries for network support
ifeq ($(CONFIG_NET),y)
NUTTXLIBS += net/libnet$(LIBEXT)
NUTTXLIBS += net/libnet$(LIBEXT)
endif
# Add libraries for file system support
ifeq ($(CONFIG_NFILE_DESCRIPTORS),0)
ifneq ($(CONFIG_NSOCKET_DESCRIPTORS),0)
NUTTXLIBS += fs/libfs$(LIBEXT)
NUTTXLIBS += fs/libfs$(LIBEXT)
endif
ifeq ($(CONFIG_NET),y)
NUTTXLIBS += drivers/libdrivers$(LIBEXT)
NUTTXLIBS += drivers/libdrivers$(LIBEXT)
endif
else
NUTTXLIBS += fs/libfs$(LIBEXT) drivers/libdrivers$(LIBEXT) binfmt/libbinfmt$(LIBEXT)
NUTTXLIBS += fs/libfs$(LIBEXT) drivers/libdrivers$(LIBEXT) binfmt/libbinfmt$(LIBEXT)
endif
# Add libraries for the NX graphics sub-system
ifneq ($(NX_DIR),)
NUTTXLIBS += $(NX_DIR)/libnx$(LIBEXT)
NUTTXLIBS += $(NX_DIR)/libnx$(LIBEXT)
endif
ifeq ($(CONFIG_NX),y)
NUTTXLIBS += graphics/libgraphics$(LIBEXT)
NUTTXLIBS += graphics/libgraphics$(LIBEXT)
endif
# This is the name of the final target (relative to the top level directorty)
BIN = nuttx$(EXEEXT)
BIN = nuttx$(EXEEXT)
all: $(BIN)
.PHONY: context clean_context check_context export subdir_clean clean subdir_distclean distclean apps_clean apps_distclean
@ -286,7 +286,7 @@ endif
ifeq ($(NEED_MATH_H),y)
include/math.h: include/nuttx/math.h
@cp -f include/nuttx/math.h include/math.h
$(Q) cp -f include/nuttx/math.h include/math.h
else
include/math.h:
endif
@ -299,7 +299,7 @@ endif
ifeq ($(CONFIG_ARCH_FLOAT_H),y)
include/float.h: include/nuttx/float.h
@cp -f include/nuttx/float.h include/float.h
$(Q) cp -f include/nuttx/float.h include/float.h
else
include/float.h:
endif
@ -311,7 +311,7 @@ endif
ifeq ($(CONFIG_ARCH_STDARG_H),y)
include/stdarg.h: include/nuttx/stdarg.h
@cp -f include/nuttx/stdarg.h include/stdarg.h
$(Q) cp -f include/nuttx/stdarg.h include/stdarg.h
else
include/stdarg.h:
endif
@ -321,27 +321,27 @@ endif
# tools/mkversion tool is built and used to create include/nuttx/version.h
tools/mkversion:
@$(MAKE) -C tools -f Makefile.host TOPDIR="$(TOPDIR)" mkversion
$(Q) $(MAKE) -C tools -f Makefile.host TOPDIR="$(TOPDIR)" mkversion
$(TOPDIR)/.version:
@if [ ! -f .version ]; then \
$(Q) if [ ! -f .version ]; then \
echo "No .version file found, creating one"; \
tools/version.sh -v 0.0 -b 0 .version; \
chmod 755 .version; \
fi
include/nuttx/version.h: $(TOPDIR)/.version tools/mkversion
@tools/mkversion $(TOPDIR) > include/nuttx/version.h
$(Q) tools/mkversion $(TOPDIR) > include/nuttx/version.h
# Targets used to build include/nuttx/config.h. Creation of config.h is
# part of the overall NuttX configuration sequence. Notice that the
# tools/mkconfig tool is built and used to create include/nuttx/config.h
tools/mkconfig:
@$(MAKE) -C tools -f Makefile.host TOPDIR="$(TOPDIR)" mkconfig
$(Q) $(MAKE) -C tools -f Makefile.host TOPDIR="$(TOPDIR)" mkconfig
include/nuttx/config.h: $(TOPDIR)/.config tools/mkconfig
@tools/mkconfig $(TOPDIR) > include/nuttx/config.h
$(Q) tools/mkconfig $(TOPDIR) > include/nuttx/config.h
# dirlinks, and helpers
#
@ -353,7 +353,8 @@ include/nuttx/config.h: $(TOPDIR)/.config tools/mkconfig
include/apps: Make.defs
ifneq ($(APPDIR),)
@if [ -d $(TOPDIR)/$(APPDIR)/include ]; then \
@echo "LN: include/apps -> $(APPDIR)/include"
$(Q) if [ -d $(TOPDIR)/$(APPDIR)/include ]; then \
$(DIRLINK) $(TOPDIR)/$(APPDIR)/include include/apps; \
fi
endif
@ -361,30 +362,35 @@ endif
# Link the arch/<arch-name>/include directory to include/arch
include/arch: Make.defs
@$(DIRLINK) $(TOPDIR)/$(ARCH_DIR)/include include/arch
@echo "LN: include/arch -> $(TOPDIR)/$(ARCH_DIR)/include"
$(Q) $(DIRLINK) $(TOPDIR)/$(ARCH_DIR)/include include/arch
# Link the configs/<board-name>/include directory to include/arch/board
include/arch/board: include/arch Make.defs include/arch
@$(DIRLINK) $(TOPDIR)/$(BOARD_DIR)/include include/arch/board
@echo "LN: include/arch/board -> $(TOPDIR)/$(BOARD_DIR)/include"
$(Q) $(DIRLINK) $(TOPDIR)/$(BOARD_DIR)/include include/arch/board
# Link the configs/<board-name>/src dir to arch/<arch-name>/src/board
$(ARCH_SRC)/board: Make.defs
@$(DIRLINK) $(TOPDIR)/$(BOARD_DIR)/src $(ARCH_SRC)/board
@echo "LN: $(ARCH_SRC)/board -> $(TOPDIR)/$(BOARD_DIR)/src"
$(Q) $(DIRLINK) $(TOPDIR)/$(BOARD_DIR)/src $(ARCH_SRC)/board
# Link arch/<arch-name>/include/<chip-name> to arch/<arch-name>/include/chip
$(ARCH_SRC)/chip: Make.defs
ifneq ($(CONFIG_ARCH_CHIP),)
@$(DIRLINK) $(TOPDIR)/$(ARCH_SRC)/$(CONFIG_ARCH_CHIP) $(ARCH_SRC)/chip
@echo "LN: $(ARCH_SRC)/chip -> $(TOPDIR)\$(ARCH_SRC)/$(CONFIG_ARCH_CHIP)"
$(Q) $(DIRLINK) $(TOPDIR)/$(ARCH_SRC)/$(CONFIG_ARCH_CHIP) $(ARCH_SRC)/chip
endif
# Link arch/<arch-name>/src/<chip-name> to arch/<arch-name>/src/chip
include/arch/chip: include/arch Make.defs
ifneq ($(CONFIG_ARCH_CHIP),)
@$(DIRLINK) $(TOPDIR)/$(ARCH_INC)/$(CONFIG_ARCH_CHIP) include/arch/chip
@echo "LN: include/arch/chip -> $(TOPDIR)/$(ARCH_INC)/$(CONFIG_ARCH_CHIP)"
$(Q) $(DIRLINK) $(TOPDIR)/$(ARCH_INC)/$(CONFIG_ARCH_CHIP) include/arch/chip
endif
dirlinks: include/arch include/arch/board include/arch/chip $(ARCH_SRC)/board $(ARCH_SRC)/chip include/apps
@ -397,7 +403,7 @@ dirlinks: include/arch include/arch/board include/arch/chip $(ARCH_SRC)/board $(
# the establishment of symbolic links to configured directories.
context: check_context include/nuttx/config.h include/nuttx/version.h include/math.h include/float.h include/stdarg.h dirlinks
@for dir in $(CONTEXTDIRS) ; do \
$(Q) for dir in $(CONTEXTDIRS) ; do \
$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" context; \
done
@ -407,16 +413,16 @@ context: check_context include/nuttx/config.h include/nuttx/version.h include/ma
# and symbolic links created by the context target.
clean_context:
@rm -f include/nuttx/config.h
@rm -f include/nuttx/version.h
@rm -f include/math.h
@rm -f include/stdarg.h
@$(DIRUNLINK) include/arch/board
@$(DIRUNLINK) include/arch/chip
@$(DIRUNLINK) include/arch
@$(DIRUNLINK) $(ARCH_SRC)/board
@$(DIRUNLINK) $(ARCH_SRC)/chip
@$(DIRUNLINK) include/apps
$(Q) rm -f include/nuttx/config.h
$(Q) rm -f include/nuttx/version.h
$(Q) rm -f include/math.h
$(Q) rm -f include/stdarg.h
$(Q) $(DIRUNLINK) include/arch/board
$(Q) $(DIRUNLINK) include/arch/chip
$(Q) $(DIRUNLINK) include/arch
$(Q) $(DIRUNLINK) $(ARCH_SRC)/board
$(Q) $(DIRUNLINK) $(ARCH_SRC)/chip
$(Q) $(DIRUNLINK) include/apps
# check_context
#
@ -426,7 +432,7 @@ clean_context:
# configuration files have been installed and that NuttX is ready to be built.
check_context:
@if [ ! -e ${TOPDIR}/.config -o ! -e ${TOPDIR}/Make.defs ]; then \
$(Q) if [ ! -e ${TOPDIR}/.config -o ! -e ${TOPDIR}/Make.defs ]; then \
echo "" ; echo "Nuttx has not been configured:" ; \
echo " cd tools; ./configure.sh <target>" ; echo "" ; \
exit 1 ; \
@ -440,53 +446,53 @@ check_context:
# Possible kernel-mode builds
lib/libklib$(LIBEXT): context
@$(MAKE) -C lib TOPDIR="$(TOPDIR)" libklib$(LIBEXT) EXTRADEFINES=$(KDEFINE)
$(Q) $(MAKE) -C lib TOPDIR="$(TOPDIR)" libklib$(LIBEXT) EXTRADEFINES=$(KDEFINE)
sched/libsched$(LIBEXT): context
@$(MAKE) -C sched TOPDIR="$(TOPDIR)" libsched$(LIBEXT) EXTRADEFINES=$(KDEFINE)
$(Q) $(MAKE) -C sched TOPDIR="$(TOPDIR)" libsched$(LIBEXT) EXTRADEFINES=$(KDEFINE)
$(ARCH_SRC)/libarch$(LIBEXT): context
@$(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" libarch$(LIBEXT) EXTRADEFINES=$(KDEFINE)
$(Q) $(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" libarch$(LIBEXT) EXTRADEFINES=$(KDEFINE)
net/libnet$(LIBEXT): context
@$(MAKE) -C net TOPDIR="$(TOPDIR)" libnet$(LIBEXT) EXTRADEFINES=$(KDEFINE)
$(Q) $(MAKE) -C net TOPDIR="$(TOPDIR)" libnet$(LIBEXT) EXTRADEFINES=$(KDEFINE)
fs/libfs$(LIBEXT): context
@$(MAKE) -C fs TOPDIR="$(TOPDIR)" libfs$(LIBEXT) EXTRADEFINES=$(KDEFINE)
$(Q) $(MAKE) -C fs TOPDIR="$(TOPDIR)" libfs$(LIBEXT) EXTRADEFINES=$(KDEFINE)
drivers/libdrivers$(LIBEXT): context
@$(MAKE) -C drivers TOPDIR="$(TOPDIR)" libdrivers$(LIBEXT) EXTRADEFINES=$(KDEFINE)
$(Q) $(MAKE) -C drivers TOPDIR="$(TOPDIR)" libdrivers$(LIBEXT) EXTRADEFINES=$(KDEFINE)
binfmt/libbinfmt$(LIBEXT): context
@$(MAKE) -C binfmt TOPDIR="$(TOPDIR)" libbinfmt$(LIBEXT) EXTRADEFINES=$(KDEFINE)
$(Q) $(MAKE) -C binfmt TOPDIR="$(TOPDIR)" libbinfmt$(LIBEXT) EXTRADEFINES=$(KDEFINE)
graphics/libgraphics$(LIBEXT): context
@$(MAKE) -C graphics TOPDIR="$(TOPDIR)" libgraphics$(LIBEXT) EXTRADEFINES=$(KDEFINE)
$(Q) $(MAKE) -C graphics TOPDIR="$(TOPDIR)" libgraphics$(LIBEXT) EXTRADEFINES=$(KDEFINE)
syscall/libstubs$(LIBEXT): context
@$(MAKE) -C syscall TOPDIR="$(TOPDIR)" libstubs$(LIBEXT) EXTRADEFINES=$(KDEFINE)
$(Q) $(MAKE) -C syscall TOPDIR="$(TOPDIR)" libstubs$(LIBEXT) EXTRADEFINES=$(KDEFINE)
# Possible user-mode builds
lib/libulib$(LIBEXT): context
@$(MAKE) -C lib TOPDIR="$(TOPDIR)" libulib$(LIBEXT)
$(Q) $(MAKE) -C lib TOPDIR="$(TOPDIR)" libulib$(LIBEXT)
libxx/liblibxx$(LIBEXT): context
@$(MAKE) -C libxx TOPDIR="$(TOPDIR)" liblibxx$(LIBEXT)
$(Q) $(MAKE) -C libxx TOPDIR="$(TOPDIR)" liblibxx$(LIBEXT)
mm/libmm$(LIBEXT): context
@$(MAKE) -C mm TOPDIR="$(TOPDIR)" libmm$(LIBEXT) EXTRADEFINES=$(KDEFINE)
$(Q) $(MAKE) -C mm TOPDIR="$(TOPDIR)" libmm$(LIBEXT) EXTRADEFINES=$(KDEFINE)
$(APPDIR)/libapps$(LIBEXT): context
@$(MAKE) -C $(APPDIR) TOPDIR="$(TOPDIR)" libapps$(LIBEXT)
$(Q) $(MAKE) -C $(APPDIR) TOPDIR="$(TOPDIR)" libapps$(LIBEXT)
syscall/libproxies$(LIBEXT): context
@$(MAKE) -C syscall TOPDIR="$(TOPDIR)" libproxies$(LIBEXT)
$(Q) $(MAKE) -C syscall TOPDIR="$(TOPDIR)" libproxies$(LIBEXT)
# Possible non-kernel builds
lib/liblib$(LIBEXT): context
@$(MAKE) -C lib TOPDIR="$(TOPDIR)" liblib$(LIBEXT)
$(Q) $(MAKE) -C lib TOPDIR="$(TOPDIR)" liblib$(LIBEXT)
# pass1 and pass2
#
@ -502,46 +508,46 @@ pass1deps: context pass1dep $(USERLIBS)
pass1: pass1deps
ifeq ($(CONFIG_BUILD_2PASS),y)
@if [ -z "$(CONFIG_PASS1_BUILDIR)" ]; then \
$(Q) if [ -z "$(CONFIG_PASS1_BUILDIR)" ]; then \
echo "ERROR: CONFIG_PASS1_BUILDIR not defined"; \
exit 1; \
fi
@if [ ! -d "$(CONFIG_PASS1_BUILDIR)" ]; then \
$(Q) if [ ! -d "$(CONFIG_PASS1_BUILDIR)" ]; then \
echo "ERROR: CONFIG_PASS1_BUILDIR does not exist"; \
exit 1; \
fi
@if [ ! -f "$(CONFIG_PASS1_BUILDIR)/Makefile" ]; then \
$(Q) if [ ! -f "$(CONFIG_PASS1_BUILDIR)/Makefile" ]; then \
echo "ERROR: No Makefile in CONFIG_PASS1_BUILDIR"; \
exit 1; \
fi
@$(MAKE) -C $(CONFIG_PASS1_BUILDIR) TOPDIR="$(TOPDIR)" LINKLIBS="$(NUTTXLIBS)" USERLIBS="$(USERLIBS)" "$(CONFIG_PASS1_TARGET)"
$(Q) $(MAKE) -C $(CONFIG_PASS1_BUILDIR) TOPDIR="$(TOPDIR)" LINKLIBS="$(NUTTXLIBS)" USERLIBS="$(USERLIBS)" "$(CONFIG_PASS1_TARGET)"
endif
pass2deps: context pass2dep $(NUTTXLIBS)
pass2: pass2deps
@$(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" EXTRA_OBJS="$(EXTRA_OBJS)" LINKLIBS="$(NUTTXLIBS)" EXTRADEFINES=$(KDEFINE) $(BIN)
@if [ -w /tftpboot ] ; then \
$(Q) $(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" EXTRA_OBJS="$(EXTRA_OBJS)" LINKLIBS="$(NUTTXLIBS)" EXTRADEFINES=$(KDEFINE) $(BIN)
$(Q) if [ -w /tftpboot ] ; then \
cp -f $(BIN) /tftpboot/$(BIN).${CONFIG_ARCH}; \
fi
ifeq ($(CONFIG_RRLOAD_BINARY),y)
@echo "MK: $(BIN).rr"
@$(TOPDIR)/tools/mkimage.sh --Prefix $(CROSSDEV) $(BIN) $(BIN).rr
@if [ -w /tftpboot ] ; then \
$(Q) $(TOPDIR)/tools/mkimage.sh --Prefix $(CROSSDEV) $(BIN) $(BIN).rr
$(Q) if [ -w /tftpboot ] ; then \
cp -f $(BIN).rr /tftpboot/$\(BIN).rr.$(CONFIG_ARCH); \
fi
endif
ifeq ($(CONFIG_INTELHEX_BINARY),y)
@echo "CP: $(BIN).hex"
@$(OBJCOPY) $(OBJCOPYARGS) -O ihex $(BIN) $(BIN).hex
$(Q) $(OBJCOPY) $(OBJCOPYARGS) -O ihex $(BIN) $(BIN).hex
endif
ifeq ($(CONFIG_MOTOROLA_SREC),y)
@echo "CP: $(BIN).srec"
@$(OBJCOPY) $(OBJCOPYARGS) -O srec $(BIN) $(BIN).srec
$(Q) $(OBJCOPY) $(OBJCOPYARGS) -O srec $(BIN) $(BIN).srec
endif
ifeq ($(CONFIG_RAW_BINARY),y)
@echo "CP: $(BIN).bin"
@$(OBJCOPY) $(OBJCOPYARGS) -O binary $(BIN) $(BIN).bin
$(Q) $(OBJCOPY) $(OBJCOPYARGS) -O binary $(BIN) $(BIN).bin
endif
# $(BIN)
@ -568,12 +574,12 @@ download: $(BIN)
# pass2dep: Create pass2 build dependencies
pass1dep: context
@for dir in $(USERDEPDIRS) ; do \
$(Q) for dir in $(USERDEPDIRS) ; do \
$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" depend ; \
done
pass2dep: context
@for dir in $(KERNDEPDIRS) ; do \
$(Q) for dir in $(KERNDEPDIRS) ; do \
$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" EXTRADEFINES=$(KDEFINE) depend; \
done
@ -585,13 +591,13 @@ pass2dep: context
# misc/tools/README.txt for additional information.
config:
@APPSDIR=${CONFIG_APPS_DIR} conf Kconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} conf Kconfig
oldconfig:
@APPSDIR=${CONFIG_APPS_DIR} conf --oldconfig Kconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} conf --oldconfig Kconfig
menuconfig:
@APPSDIR=${CONFIG_APPS_DIR} mconf Kconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} mconf Kconfig
# export
#
@ -602,7 +608,7 @@ menuconfig:
# that the archiver is 'ar'
export: pass2deps
@tools/mkexport.sh -w$(WINTOOL) -t "$(TOPDIR)" -l "$(NUTTXLIBS)"
$(Q) tools/mkexport.sh -w$(WINTOOL) -t "$(TOPDIR)" -l "$(NUTTXLIBS)"
# General housekeeping targets: dependencies, cleaning, etc.
#
@ -617,23 +623,23 @@ export: pass2deps
depend: pass1dep pass2dep
subdir_clean:
@for dir in $(CLEANDIRS) ; do \
$(Q) for dir in $(CLEANDIRS) ; do \
if [ -e $$dir/Makefile ]; then \
$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" clean ; \
fi \
done
@$(MAKE) -C tools -f Makefile.host TOPDIR="$(TOPDIR)" clean
@$(MAKE) -C mm -f Makefile.test TOPDIR="$(TOPDIR)" clean
$(Q) $(MAKE) -C tools -f Makefile.host TOPDIR="$(TOPDIR)" clean
$(Q) $(MAKE) -C mm -f Makefile.test TOPDIR="$(TOPDIR)" clean
ifeq ($(CONFIG_BUILD_2PASS),y)
@$(MAKE) -C $(CONFIG_PASS1_BUILDIR) TOPDIR="$(TOPDIR)" clean
$(Q) $(MAKE) -C $(CONFIG_PASS1_BUILDIR) TOPDIR="$(TOPDIR)" clean
endif
clean: subdir_clean
@rm -f $(BIN) nuttx.* mm_test *.map _SAVED_APPS_config *~
@rm -f nuttx-export*
$(Q) rm -f $(BIN) nuttx.* mm_test *.map _SAVED_APPS_config *~
$(Q) rm -f nuttx-export*
subdir_distclean:
@for dir in $(CLEANDIRS) ; do \
$(Q) for dir in $(CLEANDIRS) ; do \
if [ -e $$dir/Makefile ]; then \
$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" distclean ; \
fi \
@ -641,9 +647,9 @@ subdir_distclean:
distclean: clean subdir_distclean clean_context
ifeq ($(CONFIG_BUILD_2PASS),y)
@$(MAKE) -C $(CONFIG_PASS1_BUILDIR) TOPDIR="$(TOPDIR)" distclean
$(Q) $(MAKE) -C $(CONFIG_PASS1_BUILDIR) TOPDIR="$(TOPDIR)" distclean
endif
@rm -f Make.defs setenv.sh .config .config.old
$(Q) rm -f Make.defs setenv.sh .config .config.old
# Application housekeeping targets. The APPDIR variable refers to the user
# application directory. A sample apps/ directory is included with NuttX,
@ -663,19 +669,19 @@ endif
apps_clean:
ifneq ($(APPDIR),)
@$(MAKE) -C "$(TOPDIR)/$(APPDIR)" TOPDIR="$(TOPDIR)" clean
$(Q) $(MAKE) -C "$(TOPDIR)/$(APPDIR)" TOPDIR="$(TOPDIR)" clean
endif
apps_distclean:
ifneq ($(APPDIR),)
@if [ -r "$(TOPDIR)/$(APPDIR)/.config" ]; then \
$(Q) if [ -r "$(TOPDIR)/$(APPDIR)/.config" ]; then \
cp "$(TOPDIR)/$(APPDIR)/.config" _SAVED_APPS_config || \
{ echo "Copy of $(APPDIR)/.config failed" ; exit 1 ; } \
else \
rm -f _SAVED_APPS_config; \
fi
@$(MAKE) -C "$(TOPDIR)/$(APPDIR)" TOPDIR="$(TOPDIR)" distclean
@if [ -r _SAVED_APPS_config ]; then \
$(Q) $(MAKE) -C "$(TOPDIR)/$(APPDIR)" TOPDIR="$(TOPDIR)" distclean
$(Q) if [ -r _SAVED_APPS_config ]; then \
mv _SAVED_APPS_config "$(TOPDIR)/$(APPDIR)/.config" || \
{ echo "Copy of _SAVED_APPS_config failed" ; exit 1 ; } \
fi