From e3872c255c376176d377b0cb03ceedfe4b487242 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 26 Mar 2007 22:14:28 +0000 Subject: Add a directory to hold board-specific drivers git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@151 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/Makefile | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'nuttx/Makefile') diff --git a/nuttx/Makefile b/nuttx/Makefile index 34cc90910..69ad07da2 100644 --- a/nuttx/Makefile +++ b/nuttx/Makefile @@ -80,12 +80,21 @@ include/arch/board: Make.defs include/arch fi @ln -s $(TOPDIR)/$(BOARD_DIR)/include include/arch/board -context: check_context include/nuttx/config.h include/arch include/arch/board +$(ARCH_SRC)/board: Make.defs + @if [ -e $(ARCH_SRC)/board ]; then \ + if [ -h $(ARCH_SRC)/board ]; then \ + rm -f $(ARCH_SRC)/board ; \ + else \ + echo "$(ARCH_SRC)/board exists but is not a symbolic link" ; \ + exit 1 ; \ + fi ; \ + fi + @ln -s $(TOPDIR)/$(BOARD_DIR)/src $(ARCH_SRC)/board + +context: check_context include/nuttx/config.h include/arch include/arch/board $(ARCH_SRC)/board clean_context: - rm -f include/nuttx/config.h - rm -f include/arch - rm -f include/arch/board + rm -f include/nuttx/config.h include/arch include/arch/board $(ARCH_SRC)/board check_context: @if [ ! -e ${TOPDIR}/.config -o ! -e ${TOPDIR}/Make.defs ]; then \ @@ -123,19 +132,26 @@ depend: $(MAKE) -C $$dir TOPDIR=$(TOPDIR) depend ; \ done -clean: +subdir_clean: @for dir in $(SUBDIRS) ; do \ - $(MAKE) -C $$dir TOPDIR=$(TOPDIR) clean ; \ + if [ -e $$dir/Makefile ]; then \ + $(MAKE) -C $$dir TOPDIR=$(TOPDIR) clean ; \ + fi \ done $(MAKE) -C tools -f Makefile.mkconfig TOPDIR=$(TOPDIR) clean $(MAKE) -C mm -f Makefile.test TOPDIR=$(TOPDIR) clean + +clean: subdir_clean rm -f $(BIN) $(BIN).* mm_test *.map *~ -distclean: clean clean_context +subdir_distclean: @for dir in $(SUBDIRS) ; do \ - $(MAKE) -C $$dir TOPDIR=$(TOPDIR) distclean ; \ + if [ -e $$dir/Makefile ]; then \ + $(MAKE) -C $$dir TOPDIR=$(TOPDIR) distclean ; \ + fi \ done - $(MAKE) -C examples/$(CONFIG_EXAMPLE) TOPDIR=$(TOPDIR) distclean + +distclean: clean subdir_distclean clean_context rm -f Make.defs setenv.sh .config -- cgit v1.2.3