diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-11-12 01:54:54 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-11-12 01:54:54 +0000 |
commit | dd91ab3f35500a0a13a7dced870ea5c6f9ad3765 (patch) | |
tree | 2f38b418f4df4610fc87f117e7e8be9996710da0 | |
parent | 96e153c0d29b1ab3657948e280faa25e864b28c5 (diff) | |
download | px4-nuttx-dd91ab3f35500a0a13a7dced870ea5c6f9ad3765.tar.gz px4-nuttx-dd91ab3f35500a0a13a7dced870ea5c6f9ad3765.tar.bz2 px4-nuttx-dd91ab3f35500a0a13a7dced870ea5c6f9ad3765.zip |
A few more build fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5340 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | apps/netutils/uiplib/uiplib.c | 5 | ||||
-rw-r--r-- | nuttx/arch/8051/src/Makefile | 6 | ||||
-rw-r--r-- | nuttx/arch/arm/src/Makefile | 21 | ||||
-rw-r--r-- | nuttx/arch/avr/src/Makefile | 22 | ||||
-rw-r--r-- | nuttx/arch/hc/src/Makefile | 21 | ||||
-rw-r--r-- | nuttx/arch/mips/src/Makefile | 21 | ||||
-rw-r--r-- | nuttx/arch/rgmp/src/Makefile | 4 | ||||
-rw-r--r-- | nuttx/arch/sh/src/Makefile | 23 | ||||
-rw-r--r-- | nuttx/arch/sim/src/Makefile | 14 | ||||
-rw-r--r-- | nuttx/arch/x86/src/Makefile | 21 | ||||
-rw-r--r-- | nuttx/tools/Config.mk | 2 |
11 files changed, 90 insertions, 70 deletions
diff --git a/apps/netutils/uiplib/uiplib.c b/apps/netutils/uiplib/uiplib.c index 32ffaeb06..50182efe1 100644 --- a/apps/netutils/uiplib/uiplib.c +++ b/apps/netutils/uiplib/uiplib.c @@ -45,6 +45,7 @@ #include <stdint.h> #include <stdbool.h> +#include <string.h> #include <debug.h> #include <nuttx/net/uip/uip.h> @@ -103,7 +104,7 @@ bool uiplib_hwmacconv(const char *hwstr, uint8_t *hw) unsigned char i; unsigned char j; - if (strlen(hwstr)!=17) + if (strlen(hwstr) != 17) { return false; } @@ -121,6 +122,7 @@ bool uiplib_hwmacconv(const char *hwstr, uint8_t *hw) { return false; } + if (c == ':' || c == 0) { *hw = tmp; @@ -144,6 +146,7 @@ bool uiplib_hwmacconv(const char *hwstr, uint8_t *hw) { return false; } + ++hwstr; } while(c != ':' && c != 0); diff --git a/nuttx/arch/8051/src/Makefile b/nuttx/arch/8051/src/Makefile index 8a7aaa937..f228b4697 100644 --- a/nuttx/arch/8051/src/Makefile +++ b/nuttx/arch/8051/src/Makefile @@ -60,7 +60,7 @@ LINKSSRCS = up_head.S LINKASRCS = $(LINKSSRCS:.S=$(ASMEXT)) LINKOBJS = $(LINKASRCS:$(ASMEXT)=$(OBJEXT)) LINKLIBS ?= -LDPATHS = -L"$(TOPDIR)/lib" +LIBPATHS = -L"$(TOPDIR)/lib" LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS))) TESTSRCS = up_irqtest.c @@ -171,7 +171,7 @@ board/libboard$(LIBEXT): pass1.hex: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS) board/libboard$(LIBEXT) @echo "LD: $@" - @"$(CC)" $(LDFLAGS) $(LDPATHS) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \ + @"$(CC)" $(LDFLAGS) $(LIBPATHS) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \ $(LDLIBS) -llibboard$(LIBEXT) $(SDCCLIBS) -o $@ @rm -f up_mem.h @rm -f up_allocateheap$(OBJEXT) libarch$(LIBEXT) @@ -179,7 +179,7 @@ pass1.hex: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS) board/libboard$(LIBE nuttx.hex: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS) @echo "LD: $@" - @"$(CC)" $(LDFLAGS) $(LDPATHS) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \ + @"$(CC)" $(LDFLAGS) $(LIBPATHS) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \ $(LDLIBS) -llibboard$(LIBEXT) $(SDCCLIBS) -o $@ nuttx$(EXEEXT): pass1.hex nuttx.hex diff --git a/nuttx/arch/arm/src/Makefile b/nuttx/arch/arm/src/Makefile index 6a1dcd5d1..fb8d3932d 100644 --- a/nuttx/arch/arm/src/Makefile +++ b/nuttx/arch/arm/src/Makefile @@ -78,30 +78,33 @@ EXTRA_LIBPATHS ?= LINKLIBS ?= ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BOARDMAKE = $(dir "$(TOPDIR)\arch\$(CONFIG_ARCH)\src\board\Makefile") + BOARDMAKE = ${shell if exist "$(TOPDIR)\arch\$(CONFIG_ARCH)\src\board\Makefile" (echo "y")} LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)\lib"}" -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)\arch\$(CONFIG_ARCH)\src\board"}" endif else - BOARDMAKE = $(dir "$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board/Makefile") + BOARDMAKE = ${shell if [ -r "$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board/Makefile" ]; then echo "y"; fi} ifeq ($(WINTOOL),y) LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/lib"}" -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board"}" endif else LIBPATHS += -L"$(TOPDIR)/lib" -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) LIBPATHS += -L"$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board" endif endif endif LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS))) +ifeq ($(BOARDMAKE),y) + LDLIBS += -lboard +endif LIBGCC = "${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}" GCC_LIBDIR := ${shell dirname $(LIBGCC)} @@ -128,7 +131,7 @@ nuttx: $(HEAD_OBJ) board/libboard$(LIBEXT) $(Q) echo "LD: nuttx" $(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \ -o $(NUTTX)$(EXEEXT) $(HEAD_OBJ) $(EXTRA_OBJS) \ - --start-group $(LDLIBS) -lboard $(EXTRA_LIBS) $(LIBGCC) --end-group + --start-group $(LDLIBS) $(EXTRA_LIBS) $(LIBGCC) --end-group $(Q) $(NM) $(NUTTX)$(EXEEXT) | \ grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \ sort > $(TOPDIR)/System.map @@ -150,7 +153,7 @@ endif # Dependencies .depend: Makefile chip/Make.defs $(SRCS) -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" depend endif $(Q) $(MKDEP) --dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR) \ @@ -160,14 +163,14 @@ endif depend: .depend clean: -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) $(MAKE) -C board TOPDIR="$(TOPDIR)" clean endif $(Q) rm -f libarch$(LIBEXT) *~ .*.swp $(call CLEAN) distclean: clean -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean endif $(Q) rm -f Make.dep .depend diff --git a/nuttx/arch/avr/src/Makefile b/nuttx/arch/avr/src/Makefile index 8d9184a5d..cd4e9012d 100644 --- a/nuttx/arch/avr/src/Makefile +++ b/nuttx/arch/avr/src/Makefile @@ -79,31 +79,33 @@ EXTRA_LIBS ?= LINKLIBS ?= ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BOARDMAKE = $(dir "$(TOPDIR)\arch\$(CONFIG_ARCH)\src\board\Makefile") + BOARDMAKE = ${shell if exist "$(TOPDIR)\arch\$(CONFIG_ARCH)\src\board\Makefile" (echo "y")} LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)\lib"}" -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)\arch\$(CONFIG_ARCH)\src\board"}" endif else - BOARDMAKE = $(dir "$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board/Makefile") + BOARDMAKE = ${shell if [ -r "$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board/Makefile" ]; then echo "y"; fi} ifeq ($(WINTOOL),y) LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/lib"}" -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board"}" endif else LIBPATHS += -L"$(TOPDIR)/lib" -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) LIBPATHS += -L"$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board" endif endif endif LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS))) - +ifeq ($(BOARDMAKE),y) + LDLIBS += -lboard +endif LIBGCC = "${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}" @@ -128,7 +130,7 @@ board/libboard$(LIBEXT): nuttx: $(HEAD_OBJ) board/libboard$(LIBEXT) @echo "LD: nuttx" $(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) -o $(NUTTX)$(EXEEXT) $(HEAD_OBJ) $(EXTRA_OBJS) \ - --start-group $(LDLIBS) -lboard $(EXTRA_LIBS) $(LIBGCC) --end-group + --start-group $(LDLIBS) $(EXTRA_LIBS) $(LIBGCC) --end-group $(Q) $(NM) $(NUTTX)$(EXEEXT) | \ grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \ sort > $(TOPDIR)/System.map @@ -146,7 +148,7 @@ export_head: board/libboard$(LIBEXT) $(HEAD_OBJ) # Dependencies .depend: Makefile chip/Make.defs $(SRCS) -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" depend endif $(Q) $(MKDEP) --dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR) \ @@ -156,14 +158,14 @@ endif depend: .depend clean: -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" clean endif $(Q) rm -f libarch$(LIBEXT) *~ .*.swp $(call CLEAN) distclean: clean -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean endif $(Q) rm -f Make.dep .depend diff --git a/nuttx/arch/hc/src/Makefile b/nuttx/arch/hc/src/Makefile index e1675d217..7a3e9d032 100644 --- a/nuttx/arch/hc/src/Makefile +++ b/nuttx/arch/hc/src/Makefile @@ -72,30 +72,33 @@ EXTRA_LIBS ?= LINKLIBS ?= ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BOARDMAKE = $(dir "$(TOPDIR)\arch\$(CONFIG_ARCH)\src\board\Makefile") + BOARDMAKE = ${shell if exist "$(TOPDIR)\arch\$(CONFIG_ARCH)\src\board\Makefile" (echo "y")} LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)\lib"}" -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)\arch\$(CONFIG_ARCH)\src\board"}" endif else - BOARDMAKE = $(dir "$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board/Makefile") + BOARDMAKE = ${shell if [ -r "$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board/Makefile" ]; then echo "y"; fi} ifeq ($(WINTOOL),y) LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/lib"}" -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board"}" endif else LIBPATHS += -L"$(TOPDIR)/lib" -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) LIBPATHS += -L"$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board" endif endif endif LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS))) +ifeq ($(BOARDMAKE),y) + LDLIBS += -lboard +endif LIBGCC = "${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}" @@ -119,7 +122,7 @@ board/libboard$(LIBEXT): nuttx: $(HEAD_OBJ) board/libboard$(LIBEXT) $(Q) echo "LD: nuttx" $(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) -o $(NUTTX)$(EXEEXT) $(HEAD_OBJ) \ - --start-group $(LDLIBS) -lboard $(EXTRA_LIBS) $(LIBGCC) --end-group + --start-group $(LDLIBS) $(EXTRA_LIBS) $(LIBGCC) --end-group $(Q) $(NM) $(NUTTX)$(EXEEXT) | \ grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \ sort > $(TOPDIR)/System.map @@ -137,7 +140,7 @@ export_head: board/libboard$(LIBEXT) $(HEAD_OBJ) # Dependencies .depend: Makefile chip/Make.defs $(SRCS) -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" depend endif $(Q) $(MKDEP) --dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR) \ @@ -147,14 +150,14 @@ endif depend: .depend clean: -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" clean endif $(Q) rm -f libarch$(LIBEXT) *~ .*.swp $(call CLEAN) distclean: clean -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean endif $(Q) rm -f Make.dep .depend diff --git a/nuttx/arch/mips/src/Makefile b/nuttx/arch/mips/src/Makefile index dd9aa3ed5..8d02ac59c 100644 --- a/nuttx/arch/mips/src/Makefile +++ b/nuttx/arch/mips/src/Makefile @@ -69,30 +69,33 @@ EXTRA_LIBS ?= LINKLIBS ?= ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BOARDMAKE = $(dir "$(TOPDIR)\arch\$(CONFIG_ARCH)\src\board\Makefile") + BOARDMAKE = ${shell if exist "$(TOPDIR)\arch\$(CONFIG_ARCH)\src\board\Makefile" (echo "y")} LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)\lib"}" -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)\arch\$(CONFIG_ARCH)\src\board"}" endif else - BOARDMAKE = $(dir "$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board/Makefile") + BOARDMAKE := ${shell if [ -r "$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board/Makefile" ]; then echo "y"; fi} ifeq ($(WINTOOL),y) LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/lib"}" -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board"}" endif else LIBPATHS += -L"$(TOPDIR)/lib" -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) LIBPATHS += -L"$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board" endif endif endif LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS))) +ifeq ($(BOARDMAKE),y) + LDLIBS += -lboard +endif LIBGCC = "${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}" @@ -117,7 +120,7 @@ board/libboard$(LIBEXT): nuttx: $(HEAD_OBJ) board/libboard$(LIBEXT) @echo "LD: nuttx" $(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) -o $(NUTTX)$(EXEEXT) $(HEAD_OBJ) $(EXTRA_OBJS) \ - --start-group $(LDLIBS) -lboard $(EXTRA_LIBS) $(LIBGCC) --end-group + --start-group $(LDLIBS) $(EXTRA_LIBS) $(LIBGCC) --end-group $(Q) $(NM) $(NUTTX)$(EXEEXT) | \ grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \ sort > $(TOPDIR)/System.map @@ -135,7 +138,7 @@ export_head: board/libboard$(LIBEXT) $(HEAD_OBJ) # Dependencies .depend: Makefile chip/Make.defs $(SRCS) -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" depend endif $(Q) $(MKDEP) --dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR) \ @@ -145,14 +148,14 @@ endif depend: .depend clean: -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" clean endif $(Q) rm -f libarch$(LIBEXT) *~ .*.swp $(call CLEAN) distclean: clean -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean endif $(Q) rm -f Make.dep .depend diff --git a/nuttx/arch/rgmp/src/Makefile b/nuttx/arch/rgmp/src/Makefile index d63804156..4df7a9ce6 100644 --- a/nuttx/arch/rgmp/src/Makefile +++ b/nuttx/arch/rgmp/src/Makefile @@ -54,7 +54,7 @@ LINKOBJS = $(LINKSRCS:.c=$(OBJEXT)) LDFLAGS += -T$(RGMPLKSCPT) LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS))) -LDPATHS += -L"$(TOPDIR)/lib -L$(RGMPLIBDIR) +LIBPATHS += -L"$(TOPDIR)/lib" -L$(RGMPLIBDIR) LDLIBS += -lrgmp $(shell "$(CC)" -print-libgcc-file-name) all: libarch$(LIBEXT) @@ -77,7 +77,7 @@ libarch$(LIBEXT): $(OBJS) nuttx$(EXEEXT): $(LINKOBJS) @echo "LD: nuttx$(EXEEXT)" - @$(LD) $(LDFLAGS) $(LDPATHS) $(LINKOBJS) --start-group $(LDLIBS) $(EXTRA_LIBS) --end-group -o $(TOPDIR)/$@ + @$(LD) $(LDFLAGS) $(LIBPATHS) $(LINKOBJS) --start-group $(LDLIBS) $(EXTRA_LIBS) --end-group -o $(TOPDIR)/$@ @$(OBJDUMP) -S $(TOPDIR)/$@ > $(TOPDIR)/nuttx.asm @$(NM) -n $(TOPDIR)/$@ > $(TOPDIR)/nuttx.sym @$(OBJCOPY) -S -O binary $(TOPDIR)/$@ nuttx.img diff --git a/nuttx/arch/sh/src/Makefile b/nuttx/arch/sh/src/Makefile index 9447606a1..d6f3ed634 100644 --- a/nuttx/arch/sh/src/Makefile +++ b/nuttx/arch/sh/src/Makefile @@ -55,30 +55,33 @@ EXTRA_LIBS ?= LINKLIBS ?= ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BOARDMAKE = $(dir "$(TOPDIR)\arch\$(CONFIG_ARCH)\src\board\Makefile") + BOARDMAKE = ${shell if exist "$(TOPDIR)\arch\$(CONFIG_ARCH)\src\board\Makefile" (echo "y")} LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)\lib"}" -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)\arch\$(CONFIG_ARCH)\src\board"}" endif else - BOARDMAKE = $(dir "$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board/Makefile") + BOARDMAKE = ${shell if [ -r "$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board/Makefile" ]; then echo "y"; fi} ifeq ($(WINTOOL),y) LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/lib"}" -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board"}" endif else LIBPATHS += -L"$(TOPDIR)/lib" -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) LIBPATHS += -L"$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board" endif endif endif LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS))) +ifeq ($(BOARDMAKE),y) + LDLIBS += -lboard +endif LIBGCC = ${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name} @@ -102,8 +105,8 @@ board/libboard$(LIBEXT): nuttx: $(HEAD_OBJ) board/libboard$(LIBEXT) @echo "LD: nuttx" - $(Q) $(LD) --entry=__start $(LDFLAGS) $(LDPATHS) -L$(BOARDMAKE) -o $(TOPDIR)/$@ $(HEAD_OBJ) \ - --start-group $(LDLIBS) -lboard $(EXTRA_LIBS) $(LIBGCC) --end-group + $(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) -o $(TOPDIR)/$@ $(HEAD_OBJ) \ + --start-group $(LDLIBS) $(EXTRA_LIBS) $(LIBGCC) --end-group $(Q) $(NM) $(TOPDIR)/$@ | \ grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \ sort > $(TOPDIR)/System.map @@ -121,7 +124,7 @@ export_head: board/libboard$(LIBEXT) $(HEAD_OBJ) # Dependencies .depend: Makefile chip/Make.defs $(SRCS) -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" depend endif $(Q) $(MKDEP) --dep-path chip --dep-path common "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep @@ -130,14 +133,14 @@ endif depend: .depend clean: -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" clean endif $(Q) rm -f libarch$(LIBEXT) *~ .*.swp $(call CLEAN) distclean: clean -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean endif $(Q) rm -f Make.dep .depend diff --git a/nuttx/arch/sim/src/Makefile b/nuttx/arch/sim/src/Makefile index 4841abd50..d46defe13 100644 --- a/nuttx/arch/sim/src/Makefile +++ b/nuttx/arch/sim/src/Makefile @@ -127,14 +127,14 @@ endif # Most are provided by LINKLIBS on the MAKE command line LINKLIBS ?= -LIBPATHS += -L"$(TOPDIR)/lib" -LIBPATHS += -Lboard -LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS))) +RELLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS))) +RELPATHS += -L"$(TOPDIR)/lib" # Add the board-specific library and directory -LDPATHS += -L board -LDLIBS += -lboard +LIBPATHS += -L board +RELPATHS += -L board +RELLIBS += -lboard # Make targets begin here @@ -178,7 +178,7 @@ Cygwin-names.dat: nuttx-names.dat nuttx.rel : libarch$(LIBEXT) board/libboard$(LIBEXT) $(HOSTOS)-names.dat $(LINKOBJS) $(Q) echo "LD: nuttx.rel" - $(Q) $(LD) -r $(LDLINKFLAGS) $(LDPATHS) $(EXTRA_LIBPATHS) -o $@ $(REQUIREDOBJS) --start-group $(LDLIBS) $(EXTRA_LIBS) --end-group + $(Q) $(LD) -r $(LDLINKFLAGS) $(RELPATHS) $(EXTRA_LIBPATHS) -o $@ $(REQUIREDOBJS) --start-group $(RELLIBS) $(EXTRA_LIBS) --end-group $(Q) $(OBJCOPY) --redefine-syms=$(HOSTOS)-names.dat $@ # Generate the final NuttX binary by linking the host-specific objects with the NuttX @@ -186,7 +186,7 @@ nuttx.rel : libarch$(LIBEXT) board/libboard$(LIBEXT) $(HOSTOS)-names.dat $(LINKO nuttx$(EXEEXT): cleanrel nuttx.rel $(HOSTOBJS) $(Q) echo "LD: nuttx$(EXEEXT)" - $(Q) "$(CC)" $(CCLINKFLAGS) $(LDPATHS) -o $(TOPDIR)/$@ nuttx.rel $(HOSTOBJS) $(DRVLIB) $(STDLIBS) + $(Q) "$(CC)" $(CCLINKFLAGS) $(LIBPATHS) -o $(TOPDIR)/$@ nuttx.rel $(HOSTOBJS) $(DRVLIB) $(STDLIBS) $(Q) $(NM) $(TOPDIR)/$@ | \ grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \ sort > $(TOPDIR)/System.map diff --git a/nuttx/arch/x86/src/Makefile b/nuttx/arch/x86/src/Makefile index a979593ee..9e9abb9e2 100644 --- a/nuttx/arch/x86/src/Makefile +++ b/nuttx/arch/x86/src/Makefile @@ -69,30 +69,33 @@ EXTRA_LIBS ?= LINKLIBS ?= ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BOARDMAKE = $(dir "$(TOPDIR)\arch\$(CONFIG_ARCH)\src\board\Makefile") + BOARDMAKE = ${shell if exist "$(TOPDIR)\arch\$(CONFIG_ARCH)\src\board\Makefile" (echo "y")} LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)\lib"}" -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)\arch\$(CONFIG_ARCH)\src\board"}" endif else - BOARDMAKE = $(dir "$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board/Makefile") + BOARDMAKE = ${shell if [ -r "$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board/Makefile" ]; then echo "y"; fi} ifeq ($(WINTOOL),y) LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/lib"}" -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board"}" endif else LIBPATHS += -L"$(TOPDIR)/lib" -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) LIBPATHS += -L"$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board" endif endif endif LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS))) +ifeq ($(BOARDMAKE),y) + LDLIBS += -lboard +endif LIBGCC = "${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}" @@ -125,7 +128,7 @@ board/libboard$(LIBEXT): nuttx$(EXEEXT): $(HEAD_OBJ) board/libboard$(LIBEXT) @echo "LD: nuttx$(EXEEXT)" $(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) -o $(NUTTX)$(EXEEXT) $(HEAD_OBJ) $(EXTRA_OBJS) \ - --start-group $(LDLIBS) -lboard $(EXTRA_LIBS) $(LIBGCC) --end-group + --start-group $(LDLIBS) $(EXTRA_LIBS) $(LIBGCC) --end-group $(Q) $(NM) $(NUTTX)$(EXEEXT) | \ grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \ sort > $(TOPDIR)/System.map @@ -143,7 +146,7 @@ export_head: board/libboard$(LIBEXT) $(HEAD_OBJ) # Dependencies .depend: Makefile chip/Make.defs $(SRCS) -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" depend endif $(Q) $(MKDEP) --dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR) \ @@ -153,14 +156,14 @@ endif depend: .depend clean: -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" clean endif $(Q) rm -f libarch$(LIBEXT) *~ .*.swp $(call CLEAN) distclean: clean -ifdef BOARDMAKE +ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean endif $(Q) rm -f Make.dep .depend diff --git a/nuttx/tools/Config.mk b/nuttx/tools/Config.mk index 84643b8cc..06a312fc5 100644 --- a/nuttx/tools/Config.mk +++ b/nuttx/tools/Config.mk @@ -71,7 +71,7 @@ endef else define ARCHIVE @echo "AR: $2" - $(Q) $(AR) $1 $(subst ",,$(2)) || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; } + $(Q) $(AR) $1 $(subst ",,$(2)) || { echo "$(AR) $1 FAILED!" ; exit 1 ; } endef endif |