A few more build fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5340 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
bf8f1e986c
commit
fbdc3246fd
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user