arch/../src/Makefiles now use only libraries in lib/
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5333 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
98361244f0
commit
6de9634620
@ -3601,4 +3601,5 @@
|
|||||||
additional logic is needed in the arch/*/src/Makefile's as well. Right
|
additional logic is needed in the arch/*/src/Makefile's as well. Right
|
||||||
now that logic generate multiple library paths, all pointing to the lib/
|
now that logic generate multiple library paths, all pointing to the lib/
|
||||||
directory.
|
directory.
|
||||||
|
* arch/*/src/Makefile: Now uses only the libraries in lib/
|
||||||
|
|
||||||
|
6
Makefile
6
Makefile
@ -252,7 +252,7 @@ endif
|
|||||||
|
|
||||||
# LINKLIBS derives from NUTTXLIBS and is simply the same list with the subdirectory removed
|
# LINKLIBS derives from NUTTXLIBS and is simply the same list with the subdirectory removed
|
||||||
|
|
||||||
LINKLIBS = $(patsubst lib/,,$(NUTTXLIBS))
|
LINKLIBS = $(patsubst lib/%,%,$(NUTTXLIBS))
|
||||||
|
|
||||||
# This is the name of the final target (relative to the top level directorty)
|
# This is the name of the final target (relative to the top level directorty)
|
||||||
|
|
||||||
@ -566,13 +566,13 @@ ifeq ($(CONFIG_BUILD_2PASS),y)
|
|||||||
echo "ERROR: No Makefile in CONFIG_PASS1_BUILDIR"; \
|
echo "ERROR: No Makefile in CONFIG_PASS1_BUILDIR"; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
fi
|
fi
|
||||||
$(Q) $(MAKE) -C $(CONFIG_PASS1_BUILDIR) TOPDIR="$(TOPDIR)" LINKLIBS="$(NUTTXLIBS)" USERLIBS="$(USERLIBS)" "$(CONFIG_PASS1_TARGET)"
|
$(Q) $(MAKE) -C $(CONFIG_PASS1_BUILDIR) TOPDIR="$(TOPDIR)" LINKLIBS="$(LINKLIBS)" USERLIBS="$(USERLIBS)" "$(CONFIG_PASS1_TARGET)"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
pass2deps: context pass2dep $(NUTTXLIBS)
|
pass2deps: context pass2dep $(NUTTXLIBS)
|
||||||
|
|
||||||
pass2: pass2deps
|
pass2: pass2deps
|
||||||
$(Q) $(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" EXTRA_OBJS="$(EXTRA_OBJS)" LINKLIBS="$(NUTTXLIBS)" EXTRADEFINES=$(KDEFINE) $(BIN)
|
$(Q) $(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" EXTRA_OBJS="$(EXTRA_OBJS)" LINKLIBS="$(LINKLIBS)" EXTRADEFINES=$(KDEFINE) $(BIN)
|
||||||
$(Q) if [ -w /tftpboot ] ; then \
|
$(Q) if [ -w /tftpboot ] ; then \
|
||||||
cp -f $(BIN) /tftpboot/$(BIN).${CONFIG_ARCH}; \
|
cp -f $(BIN) /tftpboot/$(BIN).${CONFIG_ARCH}; \
|
||||||
fi
|
fi
|
||||||
|
@ -35,51 +35,51 @@
|
|||||||
|
|
||||||
-include $(TOPDIR)/Make.defs
|
-include $(TOPDIR)/Make.defs
|
||||||
|
|
||||||
CFLAGS += -I$(TOPDIR)/sched
|
CFLAGS += -I$(TOPDIR)/sched
|
||||||
ASFLAGS = -x -j -g -l -s -p
|
ASFLAGS = -x -j -g -l -s -p
|
||||||
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -D__ASSEMBLY__
|
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -D__ASSEMBLY__
|
||||||
|
|
||||||
SSRCS =
|
SSRCS =
|
||||||
ASRCS = $(SSRCS:.S=$(ASMEXT))
|
ASRCS = $(SSRCS:.S=$(ASMEXT))
|
||||||
AOBJS = $(ASRCS:$(ASMEXT)=$(OBJEXT))
|
AOBJS = $(ASRCS:$(ASMEXT)=$(OBJEXT))
|
||||||
CSRCS = up_initialize.c up_idle.c up_interruptcontext.c \
|
CSRCS = up_initialize.c up_idle.c up_interruptcontext.c \
|
||||||
up_initialstate.c up_unblocktask.c up_blocktask.c \
|
up_initialstate.c up_unblocktask.c up_blocktask.c \
|
||||||
up_releasepending.c up_reprioritizertr.c \
|
up_releasepending.c up_reprioritizertr.c \
|
||||||
up_exit.c up_assert.c up_allocateheap.c \
|
up_exit.c up_assert.c up_allocateheap.c \
|
||||||
up_irq.c up_savecontext.c up_restorecontext.c \
|
up_irq.c up_savecontext.c up_restorecontext.c \
|
||||||
up_timerisr.c up_putc.c up_debug.c up_delay.c
|
up_timerisr.c up_putc.c up_debug.c up_delay.c
|
||||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||||
SRCS = $(SSRCS) $(CSRCS)
|
SRCS = $(SSRCS) $(CSRCS)
|
||||||
OBJS = $(AOBJS) $(COBJS)
|
OBJS = $(AOBJS) $(COBJS)
|
||||||
|
|
||||||
SDCCLIBDIR = /usr/local/share/sdcc/lib/large-stack-auto
|
SDCCLIBDIR = /usr/local/share/sdcc/lib/large-stack-auto
|
||||||
SDCCPATH = -L$(SDCCLIBDIR)
|
SDCCPATH = -L$(SDCCLIBDIR)
|
||||||
SDCCLIBS = -llibfloat.lib -llibint.lib -lliblong.lib -llibmysdcc.lib -lmcs51.lib
|
SDCCLIBS = -llibfloat.lib -llibint.lib -lliblong.lib -llibmysdcc.lib -lmcs51.lib
|
||||||
|
|
||||||
LINKSSRCS = up_head.S
|
LINKSSRCS = up_head.S
|
||||||
LINKASRCS = $(LINKSSRCS:.S=$(ASMEXT))
|
LINKASRCS = $(LINKSSRCS:.S=$(ASMEXT))
|
||||||
LINKOBJS = $(LINKASRCS:$(ASMEXT)=$(OBJEXT))
|
LINKOBJS = $(LINKASRCS:$(ASMEXT)=$(OBJEXT))
|
||||||
LINKLIBS =
|
LINKLIBS ?=
|
||||||
LDPATHES = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
LDPATHS = -L"$(TOPDIR)/lib"
|
||||||
LDLIBS = $(addprefix -l,$(notdir $(LINKLIBS)))
|
LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS)))
|
||||||
|
|
||||||
TESTSRCS = up_irqtest.c
|
TESTSRCS = up_irqtest.c
|
||||||
TESTOBJS = $(TESTSRCS:.c=$(OBJEXT))
|
TESTOBJS = $(TESTSRCS:.c=$(OBJEXT))
|
||||||
TESTLINKOBJS = up_head$(OBJEXT)
|
TESTLINKOBJS = up_head$(OBJEXT)
|
||||||
TESTEXTRAOBJS = up_savecontext$(OBJEXT) up_restorecontext$(OBJEXT)
|
TESTEXTRAOBJS = up_savecontext$(OBJEXT) up_restorecontext$(OBJEXT)
|
||||||
|
|
||||||
BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
|
BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
|
||||||
|
|
||||||
IRAM_SIZE = 0x100
|
IRAM_SIZE = 0x100
|
||||||
DEF_STACK_BASE = 0x24
|
DEF_STACK_BASE = 0x24
|
||||||
LDFLAGS += --model-large --nostdlib \
|
LDFLAGS += --model-large --nostdlib \
|
||||||
--data-loc $(DEF_STACK_BASE) --iram-size $(IRAM_SIZE) \
|
--data-loc $(DEF_STACK_BASE) --iram-size $(IRAM_SIZE) \
|
||||||
--code-loc 0x2100 --code-size 0x5f40 \
|
--code-loc 0x2100 --code-size 0x5f40 \
|
||||||
--xram-loc $(IRAM_SIZE) --xram-size 0x1f00
|
--xram-loc $(IRAM_SIZE) --xram-size 0x1f00
|
||||||
|
|
||||||
DEPSRCS = $(SRCS) $(LINKSSRCS)
|
DEPSRCS = $(SRCS) $(LINKSSRCS)
|
||||||
|
|
||||||
HEAP1_BASE = ${shell \
|
HEAP1_BASE = ${shell \
|
||||||
if [ -e pass1.mem ]; then \
|
if [ -e pass1.mem ]; then \
|
||||||
cat pass1.mem | grep "EXTERNAL RAM" | \
|
cat pass1.mem | grep "EXTERNAL RAM" | \
|
||||||
sed -e "s/[ ][ ]*/ /g" | cut -d' ' -f5 ; \
|
sed -e "s/[ ][ ]*/ /g" | cut -d' ' -f5 ; \
|
||||||
@ -87,8 +87,8 @@ HEAP1_BASE = ${shell \
|
|||||||
echo $(IRAM_SIZE) ; \
|
echo $(IRAM_SIZE) ; \
|
||||||
fi \
|
fi \
|
||||||
}
|
}
|
||||||
DEF_HEAP2_BASE = 0x6000
|
DEF_HEAP2_BASE = 0x6000
|
||||||
HEAP2_BASE = ${shell \
|
HEAP2_BASE = ${shell \
|
||||||
if [ -e pass1.mem ]; then \
|
if [ -e pass1.mem ]; then \
|
||||||
cat pass1.mem | grep "ROM/EPROM/FLASH" | \
|
cat pass1.mem | grep "ROM/EPROM/FLASH" | \
|
||||||
sed -e "s/[ ][ ]*/ /g" | cut -d' ' -f4 ; \
|
sed -e "s/[ ][ ]*/ /g" | cut -d' ' -f4 ; \
|
||||||
@ -96,7 +96,7 @@ HEAP2_BASE = ${shell \
|
|||||||
echo $(DEF_HEAP2_BASE) ; \
|
echo $(DEF_HEAP2_BASE) ; \
|
||||||
fi \
|
fi \
|
||||||
}
|
}
|
||||||
STACK_BASE = ${shell \
|
STACK_BASE = ${shell \
|
||||||
if [ -e pass1.mem ]; then \
|
if [ -e pass1.mem ]; then \
|
||||||
cat pass1.mem | grep "Stack starts" | \
|
cat pass1.mem | grep "Stack starts" | \
|
||||||
cut -d' ' -f4 ; \
|
cut -d' ' -f4 ; \
|
||||||
@ -173,7 +173,7 @@ board/libboard$(LIBEXT):
|
|||||||
|
|
||||||
pass1.hex: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS) board/libboard$(LIBEXT)
|
pass1.hex: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS) board/libboard$(LIBEXT)
|
||||||
@echo "LD: $@"
|
@echo "LD: $@"
|
||||||
@$(CC) $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \
|
@$(CC) $(LDFLAGS) $(LDPATHS) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \
|
||||||
$(LDLIBS) -llibboard$(LIBEXT) $(SDCCLIBS) -o $@
|
$(LDLIBS) -llibboard$(LIBEXT) $(SDCCLIBS) -o $@
|
||||||
@rm -f up_mem.h
|
@rm -f up_mem.h
|
||||||
@rm -f up_allocateheap$(OBJEXT) libarch$(LIBEXT)
|
@rm -f up_allocateheap$(OBJEXT) libarch$(LIBEXT)
|
||||||
@ -181,7 +181,7 @@ pass1.hex: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS) board/libboard$(LIBE
|
|||||||
|
|
||||||
nuttx.hex: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS)
|
nuttx.hex: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS)
|
||||||
@echo "LD: $@"
|
@echo "LD: $@"
|
||||||
@$(CC) $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \
|
@$(CC) $(LDFLAGS) $(LDPATHS) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \
|
||||||
$(LDLIBS) -llibboard$(LIBEXT) $(SDCCLIBS) -o $@
|
$(LDLIBS) -llibboard$(LIBEXT) $(SDCCLIBS) -o $@
|
||||||
|
|
||||||
nuttx$(EXEEXT): pass1.hex nuttx.hex
|
nuttx$(EXEEXT): pass1.hex nuttx.hex
|
||||||
|
@ -74,16 +74,17 @@ LDFLAGS += $(ARCHSCRIPT)
|
|||||||
|
|
||||||
EXTRA_LIBS ?=
|
EXTRA_LIBS ?=
|
||||||
EXTRA_LIBPATHS ?=
|
EXTRA_LIBPATHS ?=
|
||||||
|
LINKLIBS ?=
|
||||||
|
|
||||||
LINKLIBS =
|
|
||||||
ifeq ($(WINTOOL),y)
|
ifeq ($(WINTOOL),y)
|
||||||
LIBPATHS = ${shell for path in $(LINKLIBS); do dir=`dirname $(TOPDIR)/$$path`;echo "-L\"`cygpath -w $$dir`\"";done}
|
LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/lib"}"
|
||||||
LIBPATHS += -L"${shell cygpath -w $(BOARDDIR)}"
|
LIBPATHS += -L"${shell cygpath -w $(BOARDDIR)}"
|
||||||
else
|
else
|
||||||
LIBPATHS = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
LIBPATHS += -L"(TOPDIR)/lib"
|
||||||
LIBPATHS += -L"$(BOARDDIR)"
|
LIBPATHS += -L"$(BOARDDIR)"
|
||||||
endif
|
endif
|
||||||
LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS))))
|
|
||||||
|
LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS)))
|
||||||
|
|
||||||
BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
|
BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
|
||||||
|
|
||||||
|
@ -37,61 +37,62 @@
|
|||||||
-include $(TOPDIR)/Make.defs
|
-include $(TOPDIR)/Make.defs
|
||||||
-include chip/Make.defs
|
-include chip/Make.defs
|
||||||
|
|
||||||
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
||||||
ifeq ($(CONFIG_ARCH_AVR32),y)
|
ifeq ($(CONFIG_ARCH_AVR32),y)
|
||||||
ARCH_SUBDIR = avr32
|
ARCH_SUBDIR = avr32
|
||||||
else ifeq ($(CONFIG_ARCH_AVR),y)
|
else ifeq ($(CONFIG_ARCH_AVR),y)
|
||||||
ARCH_SUBDIR = avr
|
ARCH_SUBDIR = avr
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(WINTOOL),y)
|
ifeq ($(WINTOOL),y)
|
||||||
NUTTX = "${shell cygpath -w $(TOPDIR)/nuttx}"
|
NUTTX = "${shell cygpath -w $(TOPDIR)/nuttx}"
|
||||||
INCLUDES += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}"
|
INCLUDES += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}"
|
||||||
INCLUDES += -I "${shell cygpath -w $(ARCH_SRCDIR)/common}"
|
INCLUDES += -I "${shell cygpath -w $(ARCH_SRCDIR)/common}"
|
||||||
INCLUDES += -I "${shell cygpath -w $(ARCH_SRCDIR)/$(ARCH_SUBDIR)}"
|
INCLUDES += -I "${shell cygpath -w $(ARCH_SRCDIR)/$(ARCH_SUBDIR)}"
|
||||||
INCLUDES += -I "${shell cygpath -w $(TOPDIR)/sched}"
|
INCLUDES += -I "${shell cygpath -w $(TOPDIR)/sched}"
|
||||||
else
|
else
|
||||||
NUTTX = "$(TOPDIR)/nuttx"
|
NUTTX = "$(TOPDIR)/nuttx"
|
||||||
INCLUDES += -I "$(ARCH_SRCDIR)/chip"
|
INCLUDES += -I "$(ARCH_SRCDIR)/chip"
|
||||||
INCLUDES += -I "$(ARCH_SRCDIR)/common"
|
INCLUDES += -I "$(ARCH_SRCDIR)/common"
|
||||||
INCLUDES += -I "$(ARCH_SRCDIR)/$(ARCH_SUBDIR)"
|
INCLUDES += -I "$(ARCH_SRCDIR)/$(ARCH_SUBDIR)"
|
||||||
INCLUDES += -I "$(TOPDIR)/sched"
|
INCLUDES += -I "$(TOPDIR)/sched"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CPPFLAGS += $(INCLUDES)
|
CPPFLAGS += $(INCLUDES)
|
||||||
CFLAGS += $(INCLUDES)
|
CFLAGS += $(INCLUDES)
|
||||||
CXXFLAGS += $(INCLUDES)
|
CXXFLAGS += $(INCLUDES)
|
||||||
AFLAGS += $(INCLUDES)
|
AFLAGS += $(INCLUDES)
|
||||||
|
|
||||||
HEAD_OBJ = $(HEAD_ASRC:.S=$(OBJEXT))
|
HEAD_OBJ = $(HEAD_ASRC:.S=$(OBJEXT))
|
||||||
|
|
||||||
ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
|
ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
|
||||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||||
|
|
||||||
CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS)
|
CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS)
|
||||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||||
|
|
||||||
SRCS = $(ASRCS) $(CSRCS)
|
SRCS = $(ASRCS) $(CSRCS)
|
||||||
OBJS = $(AOBJS) $(COBJS)
|
OBJS = $(AOBJS) $(COBJS)
|
||||||
|
|
||||||
LDFLAGS += $(ARCHSCRIPT)
|
LDFLAGS += $(ARCHSCRIPT)
|
||||||
EXTRA_LIBS ?=
|
EXTRA_LIBS ?=
|
||||||
|
LINKLIBS ?=
|
||||||
|
|
||||||
LINKLIBS =
|
|
||||||
ifeq ($(WINTOOL),y)
|
ifeq ($(WINTOOL),y)
|
||||||
LIBPATHS = ${shell for path in $(LINKLIBS); do dir=`dirname $(TOPDIR)/$$path`;echo "-L\"`cygpath -w $$dir`\"";done}
|
LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/lib"}"
|
||||||
LIBPATHS += -L"${shell cygpath -w $(BOARDDIR)}"
|
LIBPATHS += -L"${shell cygpath -w $(BOARDDIR)}"
|
||||||
else
|
else
|
||||||
LIBPATHS = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
LIBPATHS += -L"(TOPDIR)/lib"
|
||||||
LIBPATHS += -L"$(BOARDDIR)"
|
LIBPATHS += -L"$(BOARDDIR)"
|
||||||
endif
|
endif
|
||||||
LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS))))
|
|
||||||
|
|
||||||
BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
|
LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS)))
|
||||||
|
|
||||||
LIBGCC = "${shell $(CC) $(ARCHCPUFLAGS) -print-libgcc-file-name}"
|
BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
|
||||||
|
|
||||||
VPATH = chip:common:$(ARCH_SUBDIR)
|
LIBGCC = "${shell $(CC) $(ARCHCPUFLAGS) -print-libgcc-file-name}"
|
||||||
|
|
||||||
|
VPATH = chip:common:$(ARCH_SUBDIR)
|
||||||
|
|
||||||
all: $(HEAD_OBJ) libarch$(LIBEXT)
|
all: $(HEAD_OBJ) libarch$(LIBEXT)
|
||||||
|
|
||||||
|
@ -36,55 +36,56 @@
|
|||||||
-include $(TOPDIR)/Make.defs
|
-include $(TOPDIR)/Make.defs
|
||||||
-include chip/Make.defs
|
-include chip/Make.defs
|
||||||
|
|
||||||
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
||||||
ifeq ($(CONFIG_ARCH_HC12),y)
|
ifeq ($(CONFIG_ARCH_HC12),y)
|
||||||
ARCH_SUBDIR = hc12
|
ARCH_SUBDIR = hc12
|
||||||
endif
|
endif
|
||||||
ifeq ($(CONFIG_ARCH_HCS12),y)
|
ifeq ($(CONFIG_ARCH_HCS12),y)
|
||||||
ARCH_SUBDIR = hcs12
|
ARCH_SUBDIR = hcs12
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(WINTOOL),y)
|
ifeq ($(WINTOOL),y)
|
||||||
NUTTX = "${shell cygpath -w $(TOPDIR)/nuttx}"
|
NUTTX = "${shell cygpath -w $(TOPDIR)/nuttx}"
|
||||||
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \
|
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \
|
||||||
-I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \
|
-I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \
|
||||||
-I "${shell cygpath -w $(ARCH_SRCDIR)/$(ARCH_SUBDIR)}" \
|
-I "${shell cygpath -w $(ARCH_SRCDIR)/$(ARCH_SUBDIR)}" \
|
||||||
-I "${shell cygpath -w $(TOPDIR)/sched}"
|
-I "${shell cygpath -w $(TOPDIR)/sched}"
|
||||||
else
|
else
|
||||||
NUTTX = $(TOPDIR)/nuttx
|
NUTTX = $(TOPDIR)/nuttx
|
||||||
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common \
|
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common \
|
||||||
-I$(ARCH_SRCDIR)/$(ARCH_SUBDIR) -I$(TOPDIR)/sched
|
-I$(ARCH_SRCDIR)/$(ARCH_SUBDIR) -I$(TOPDIR)/sched
|
||||||
endif
|
endif
|
||||||
|
|
||||||
HEAD_OBJ = $(HEAD_ASRC:.S=$(OBJEXT))
|
HEAD_OBJ = $(HEAD_ASRC:.S=$(OBJEXT))
|
||||||
|
|
||||||
ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
|
ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
|
||||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||||
|
|
||||||
CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS)
|
CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS)
|
||||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||||
|
|
||||||
SRCS = $(ASRCS) $(CSRCS)
|
SRCS = $(ASRCS) $(CSRCS)
|
||||||
OBJS = $(AOBJS) $(COBJS)
|
OBJS = $(AOBJS) $(COBJS)
|
||||||
|
|
||||||
LDFLAGS += $(ARCHSCRIPT)
|
LDFLAGS += $(ARCHSCRIPT)
|
||||||
EXTRA_LIBS ?=
|
EXTRA_LIBS ?=
|
||||||
|
LINKLIBS ?=
|
||||||
|
|
||||||
LINKLIBS =
|
|
||||||
ifeq ($(WINTOOL),y)
|
ifeq ($(WINTOOL),y)
|
||||||
LIBPATHS = ${shell for path in $(LINKLIBS); do dir=`dirname $(TOPDIR)/$$path`;echo "-L\"`cygpath -w $$dir`\"";done}
|
LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/lib"}"
|
||||||
LIBPATHS += -L"${shell cygpath -w $(BOARDDIR)}"
|
LIBPATHS += -L"${shell cygpath -w $(BOARDDIR)}"
|
||||||
else
|
else
|
||||||
LIBPATHS = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
LIBPATHS += -L"(TOPDIR)/lib"
|
||||||
LIBPATHS += -L"$(BOARDDIR)"
|
LIBPATHS += -L"$(BOARDDIR)"
|
||||||
endif
|
endif
|
||||||
LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS))))
|
|
||||||
|
|
||||||
BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
|
LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS)))
|
||||||
|
|
||||||
LIBGCC = "${shell $(CC) $(ARCHCPUFLAGS) -print-libgcc-file-name}"
|
BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
|
||||||
|
|
||||||
VPATH = chip:common:$(ARCH_SUBDIR)
|
LIBGCC = "${shell $(CC) $(ARCHCPUFLAGS) -print-libgcc-file-name}"
|
||||||
|
|
||||||
|
VPATH = chip:common:$(ARCH_SUBDIR)
|
||||||
|
|
||||||
all: $(HEAD_OBJ) libarch$(LIBEXT)
|
all: $(HEAD_OBJ) libarch$(LIBEXT)
|
||||||
.PHONY: board/libboard$(LIBEXT)
|
.PHONY: board/libboard$(LIBEXT)
|
||||||
|
@ -36,52 +36,53 @@
|
|||||||
-include $(TOPDIR)/Make.defs
|
-include $(TOPDIR)/Make.defs
|
||||||
-include chip/Make.defs
|
-include chip/Make.defs
|
||||||
|
|
||||||
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
||||||
ifeq ($(CONFIG_ARCH_MIPS),y)
|
ifeq ($(CONFIG_ARCH_MIPS),y)
|
||||||
ARCH_SUBDIR = mips32
|
ARCH_SUBDIR = mips32
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(WINTOOL),y)
|
ifeq ($(WINTOOL),y)
|
||||||
NUTTX = "${shell cygpath -w $(TOPDIR)/nuttx}"
|
NUTTX = "${shell cygpath -w $(TOPDIR)/nuttx}"
|
||||||
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \
|
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \
|
||||||
-I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \
|
-I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \
|
||||||
-I "${shell cygpath -w $(ARCH_SRCDIR)/$(ARCH_SUBDIR)}" \
|
-I "${shell cygpath -w $(ARCH_SRCDIR)/$(ARCH_SUBDIR)}" \
|
||||||
-I "${shell cygpath -w $(TOPDIR)/sched}"
|
-I "${shell cygpath -w $(TOPDIR)/sched}"
|
||||||
else
|
else
|
||||||
NUTTX = $(TOPDIR)/nuttx
|
NUTTX = $(TOPDIR)/nuttx
|
||||||
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common \
|
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common \
|
||||||
-I$(ARCH_SRCDIR)/$(ARCH_SUBDIR) -I$(TOPDIR)/sched
|
-I$(ARCH_SRCDIR)/$(ARCH_SUBDIR) -I$(TOPDIR)/sched
|
||||||
endif
|
endif
|
||||||
|
|
||||||
HEAD_OBJ = $(HEAD_ASRC:.S=$(OBJEXT))
|
HEAD_OBJ = $(HEAD_ASRC:.S=$(OBJEXT))
|
||||||
|
|
||||||
ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
|
ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
|
||||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||||
|
|
||||||
CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS)
|
CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS)
|
||||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||||
|
|
||||||
SRCS = $(ASRCS) $(CSRCS)
|
SRCS = $(ASRCS) $(CSRCS)
|
||||||
OBJS = $(AOBJS) $(COBJS)
|
OBJS = $(AOBJS) $(COBJS)
|
||||||
|
|
||||||
LDFLAGS += $(ARCHSCRIPT)
|
LDFLAGS += $(ARCHSCRIPT)
|
||||||
EXTRA_LIBS ?=
|
EXTRA_LIBS ?=
|
||||||
|
LINKLIBS ?=
|
||||||
|
|
||||||
LINKLIBS =
|
|
||||||
ifeq ($(WINTOOL),y)
|
ifeq ($(WINTOOL),y)
|
||||||
LIBPATHS = ${shell for path in $(LINKLIBS); do dir=`dirname $(TOPDIR)/$$path`;echo "-L\"`cygpath -w $$dir`\"";done}
|
LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/lib"}"
|
||||||
LIBPATHS += -L"${shell cygpath -w $(BOARDDIR)}"
|
LIBPATHS += -L"${shell cygpath -w $(BOARDDIR)}"
|
||||||
else
|
else
|
||||||
LIBPATHS = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
LIBPATHS += -L"(TOPDIR)/lib"
|
||||||
LIBPATHS += -L"$(BOARDDIR)"
|
LIBPATHS += -L"$(BOARDDIR)"
|
||||||
endif
|
endif
|
||||||
LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS))))
|
|
||||||
|
|
||||||
BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
|
LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS)))
|
||||||
|
|
||||||
LIBGCC = "${shell $(CC) $(ARCHCPUFLAGS) -print-libgcc-file-name}"
|
BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
|
||||||
|
|
||||||
VPATH = chip:common:$(ARCH_SUBDIR)
|
LIBGCC = "${shell $(CC) $(ARCHCPUFLAGS) -print-libgcc-file-name}"
|
||||||
|
|
||||||
|
VPATH = chip:common:$(ARCH_SUBDIR)
|
||||||
|
|
||||||
all: $(HEAD_OBJ) libarch$(LIBEXT)
|
all: $(HEAD_OBJ) libarch$(LIBEXT)
|
||||||
|
|
||||||
|
@ -53,9 +53,8 @@ LINKSRCS = rgmp.c bridge.c
|
|||||||
LINKOBJS = $(LINKSRCS:.c=$(OBJEXT))
|
LINKOBJS = $(LINKSRCS:.c=$(OBJEXT))
|
||||||
|
|
||||||
LDFLAGS += -T$(RGMPLKSCPT)
|
LDFLAGS += -T$(RGMPLKSCPT)
|
||||||
LDPATHS = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS)))
|
||||||
LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS))))
|
LDPATHS += -L"$(TOPDIR)/lib -L$(RGMPLIBDIR)
|
||||||
LDPATHS += -L$(RGMPLIBDIR)
|
|
||||||
LDLIBS += -lrgmp $(shell $(CC) -print-libgcc-file-name)
|
LDLIBS += -lrgmp $(shell $(CC) -print-libgcc-file-name)
|
||||||
|
|
||||||
all: libarch$(LIBEXT)
|
all: libarch$(LIBEXT)
|
||||||
|
@ -36,32 +36,39 @@
|
|||||||
-include $(TOPDIR)/Make.defs
|
-include $(TOPDIR)/Make.defs
|
||||||
-include chip/Make.defs
|
-include chip/Make.defs
|
||||||
|
|
||||||
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
||||||
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(TOPDIR)/sched
|
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(TOPDIR)/sched
|
||||||
|
|
||||||
HEAD_OBJ = $(HEAD_ASRC:.S=$(OBJEXT))
|
HEAD_OBJ = $(HEAD_ASRC:.S=$(OBJEXT))
|
||||||
|
|
||||||
ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
|
ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
|
||||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||||
|
|
||||||
CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS)
|
CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS)
|
||||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||||
|
|
||||||
SRCS = $(ASRCS) $(CSRCS)
|
SRCS = $(ASRCS) $(CSRCS)
|
||||||
OBJS = $(AOBJS) $(COBJS)
|
OBJS = $(AOBJS) $(COBJS)
|
||||||
|
|
||||||
LDFLAGS += $(ARCHSCRIPT)
|
LDFLAGS += $(ARCHSCRIPT)
|
||||||
EXTRA_LIBS ?=
|
EXTRA_LIBS ?=
|
||||||
|
LINKLIBS ?=
|
||||||
|
|
||||||
LINKLIBS =
|
ifeq ($(WINTOOL),y)
|
||||||
LDPATHES = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/lib"}"
|
||||||
LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS))))
|
LIBPATHS += -L"${shell cygpath -w $(BOARDDIR)}"
|
||||||
|
else
|
||||||
|
LIBPATHS += -L"(TOPDIR)/lib"
|
||||||
|
LIBPATHS += -L"$(BOARDDIR)"
|
||||||
|
endif
|
||||||
|
|
||||||
BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
|
LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS)))
|
||||||
|
|
||||||
LIBGCC = ${shell $(CC) $(ARCHCPUFLAGS) -print-libgcc-file-name}
|
BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
|
||||||
|
|
||||||
VPATH = chip:common
|
LIBGCC = ${shell $(CC) $(ARCHCPUFLAGS) -print-libgcc-file-name}
|
||||||
|
|
||||||
|
VPATH = chip:common
|
||||||
|
|
||||||
all: $(HEAD_OBJ) libarch$(LIBEXT)
|
all: $(HEAD_OBJ) libarch$(LIBEXT)
|
||||||
|
|
||||||
@ -83,7 +90,7 @@ board/libboard$(LIBEXT):
|
|||||||
|
|
||||||
nuttx: $(HEAD_OBJ) board/libboard$(LIBEXT)
|
nuttx: $(HEAD_OBJ) board/libboard$(LIBEXT)
|
||||||
@echo "LD: nuttx"
|
@echo "LD: nuttx"
|
||||||
@$(LD) --entry=__start $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) -o $(TOPDIR)/$@ $(HEAD_OBJ) \
|
@$(LD) --entry=__start $(LDFLAGS) $(LDPATHS) -L$(BOARDDIR) -o $(TOPDIR)/$@ $(HEAD_OBJ) \
|
||||||
--start-group $(LDLIBS) -lboard $(EXTRA_LIBS) $(LIBGCC) --end-group
|
--start-group $(LDLIBS) -lboard $(EXTRA_LIBS) $(LIBGCC) --end-group
|
||||||
@$(NM) $(TOPDIR)/$@ | \
|
@$(NM) $(TOPDIR)/$@ | \
|
||||||
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||||
|
@ -40,11 +40,11 @@ CFLAGS += -I$(TOPDIR)/sched
|
|||||||
ASRCS = up_setjmp.S
|
ASRCS = up_setjmp.S
|
||||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||||
CSRCS = up_initialize.c up_idle.c up_interruptcontext.c \
|
CSRCS = up_initialize.c up_idle.c up_interruptcontext.c \
|
||||||
up_initialstate.c up_createstack.c up_usestack.c \
|
up_initialstate.c up_createstack.c up_usestack.c \
|
||||||
up_releasestack.c up_unblocktask.c up_blocktask.c \
|
up_releasestack.c up_unblocktask.c up_blocktask.c \
|
||||||
up_releasepending.c up_reprioritizertr.c \
|
up_releasepending.c up_reprioritizertr.c \
|
||||||
up_exit.c up_schedulesigaction.c up_allocateheap.c \
|
up_exit.c up_schedulesigaction.c up_allocateheap.c \
|
||||||
up_devconsole.c
|
up_devconsole.c
|
||||||
HOSTSRCS = up_stdio.c up_hostusleep.c
|
HOSTSRCS = up_stdio.c up_hostusleep.c
|
||||||
|
|
||||||
ifeq ($(CONFIG_NX_LCDDRIVER),y)
|
ifeq ($(CONFIG_NX_LCDDRIVER),y)
|
||||||
@ -126,9 +126,10 @@ endif
|
|||||||
# Determine which NuttX libraries will need to be linked in
|
# Determine which NuttX libraries will need to be linked in
|
||||||
# Most are provided by LINKLIBS on the MAKE command line
|
# Most are provided by LINKLIBS on the MAKE command line
|
||||||
|
|
||||||
LINKLIBS =
|
LINKLIBS ?=
|
||||||
LDPATHS = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
LIBPATHS += -L"(TOPDIR)/lib"
|
||||||
LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS))))
|
LIBPATHS += -L"$(BOARDDIR)"
|
||||||
|
LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS)))
|
||||||
|
|
||||||
# Add the board-specific library and directory
|
# Add the board-specific library and directory
|
||||||
|
|
||||||
|
@ -36,60 +36,61 @@
|
|||||||
-include $(TOPDIR)/Make.defs
|
-include $(TOPDIR)/Make.defs
|
||||||
-include chip/Make.defs
|
-include chip/Make.defs
|
||||||
|
|
||||||
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
||||||
ifeq ($(CONFIG_ARCH_I486),y)
|
ifeq ($(CONFIG_ARCH_I486),y)
|
||||||
ARCH_SUBDIR = i486
|
ARCH_SUBDIR = i486
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(WINTOOL),y)
|
ifeq ($(WINTOOL),y)
|
||||||
NUTTX = "${shell cygpath -w $(TOPDIR)/nuttx}"
|
NUTTX = "${shell cygpath -w $(TOPDIR)/nuttx}"
|
||||||
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \
|
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \
|
||||||
-I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \
|
-I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \
|
||||||
-I "${shell cygpath -w $(ARCH_SRCDIR)/$(ARCH_SUBDIR)}" \
|
-I "${shell cygpath -w $(ARCH_SRCDIR)/$(ARCH_SUBDIR)}" \
|
||||||
-I "${shell cygpath -w $(TOPDIR)/sched}"
|
-I "${shell cygpath -w $(TOPDIR)/sched}"
|
||||||
else
|
else
|
||||||
NUTTX = $(TOPDIR)/nuttx
|
NUTTX = $(TOPDIR)/nuttx
|
||||||
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common \
|
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common \
|
||||||
-I$(ARCH_SRCDIR)/$(ARCH_SUBDIR) -I$(TOPDIR)/sched
|
-I$(ARCH_SRCDIR)/$(ARCH_SUBDIR) -I$(TOPDIR)/sched
|
||||||
endif
|
endif
|
||||||
|
|
||||||
HEAD_OBJ = $(HEAD_ASRC:.S=$(OBJEXT))
|
HEAD_OBJ = $(HEAD_ASRC:.S=$(OBJEXT))
|
||||||
|
|
||||||
ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
|
ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
|
||||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||||
|
|
||||||
CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS)
|
CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS)
|
||||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||||
|
|
||||||
SRCS = $(ASRCS) $(CSRCS)
|
SRCS = $(ASRCS) $(CSRCS)
|
||||||
OBJS = $(AOBJS) $(COBJS)
|
OBJS = $(AOBJS) $(COBJS)
|
||||||
|
|
||||||
LDFLAGS += $(ARCHSCRIPT)
|
LDFLAGS += $(ARCHSCRIPT)
|
||||||
EXTRA_LIBS ?=
|
EXTRA_LIBS ?=
|
||||||
|
LINKLIBS ?=
|
||||||
|
|
||||||
LINKLIBS =
|
|
||||||
ifeq ($(WINTOOL),y)
|
ifeq ($(WINTOOL),y)
|
||||||
LIBPATHS = ${shell for path in $(LINKLIBS); do dir=`dirname $(TOPDIR)/$$path`;echo "-L\"`cygpath -w $$dir`\"";done}
|
LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/lib"}"
|
||||||
LIBPATHS += -L"${shell cygpath -w $(BOARDDIR)}"
|
LIBPATHS += -L"${shell cygpath -w $(BOARDDIR)}"
|
||||||
else
|
else
|
||||||
LIBPATHS = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
LIBPATHS += -L"(TOPDIR)/lib"
|
||||||
LIBPATHS += -L"$(BOARDDIR)"
|
LIBPATHS += -L"$(BOARDDIR)"
|
||||||
endif
|
endif
|
||||||
LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS))))
|
|
||||||
|
|
||||||
BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
|
LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS)))
|
||||||
|
|
||||||
LIBGCC = "${shell $(CC) $(ARCHCPUFLAGS) -print-libgcc-file-name}"
|
BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
|
||||||
|
|
||||||
|
LIBGCC = "${shell $(CC) $(ARCHCPUFLAGS) -print-libgcc-file-name}"
|
||||||
|
|
||||||
ifeq ($(HOSTOS),FreeBSD)
|
ifeq ($(HOSTOS),FreeBSD)
|
||||||
HOST_ARCH = ${shell uname -m 2>/dev/null || echo "Other"}
|
HOST_ARCH = ${shell uname -m 2>/dev/null || echo "Other"}
|
||||||
ifeq ($(HOST_ARCH),amd64)
|
ifeq ($(HOST_ARCH),amd64)
|
||||||
LDFLAGS += -melf_i386
|
LDFLAGS += -melf_i386
|
||||||
LIBGCC = "/usr/lib32/libgcc.a"
|
LIBGCC = "/usr/lib32/libgcc.a"
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
VPATH = chip:common:$(ARCH_SUBDIR)
|
VPATH = chip:common:$(ARCH_SUBDIR)
|
||||||
|
|
||||||
all: $(HEAD_OBJ) libarch$(LIBEXT)
|
all: $(HEAD_OBJ) libarch$(LIBEXT)
|
||||||
|
|
||||||
|
@ -36,38 +36,38 @@
|
|||||||
-include $(TOPDIR)/Make.defs
|
-include $(TOPDIR)/Make.defs
|
||||||
-include chip/Make.defs
|
-include chip/Make.defs
|
||||||
|
|
||||||
COMPILER = ${shell basename $(CC)}
|
COMPILER = ${shell basename $(CC)}
|
||||||
ARCHSRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
ARCHSRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
||||||
ifeq ($(COMPILER),zneocc.exe)
|
ifeq ($(COMPILER),zneocc.exe)
|
||||||
WARCHSRCDIR := ${shell cygpath -w $(ARCHSRCDIR)}
|
WARCHSRCDIR := ${shell cygpath -w $(ARCHSRCDIR)}
|
||||||
USRINCLUDES = -usrinc:'.;$(WTOPDIR)\sched;$(WARCHSRCDIR);$(WARCHSRCDIR)\common'
|
USRINCLUDES = -usrinc:'.;$(WTOPDIR)\sched;$(WARCHSRCDIR);$(WARCHSRCDIR)\common'
|
||||||
else
|
else
|
||||||
WARCHSRCDIR = $(ARCHSRCDIR)
|
WARCHSRCDIR = $(ARCHSRCDIR)
|
||||||
USRINCLUDES = -I$(TOPDIR)/sched -I$(ARCHSRCDIR) -I$(ARCHSRCDIR)/common
|
USRINCLUDES = -I$(TOPDIR)/sched -I$(ARCHSRCDIR) -I$(ARCHSRCDIR)/common
|
||||||
endif
|
endif
|
||||||
INCLUDES = $(ARCHSTDINCLUDES) $(USRINCLUDES)
|
INCLUDES = $(ARCHSTDINCLUDES) $(USRINCLUDES)
|
||||||
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(INCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(INCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
||||||
CPPFLAGS += -I$(ARCHSRCDIR)
|
CPPFLAGS += -I$(ARCHSRCDIR)
|
||||||
ifeq ($(COMPILER),zneocc.exe)
|
ifeq ($(COMPILER),zneocc.exe)
|
||||||
LDFLAGS += @"${shell cygpath -w $(ARCHSRCDIR)/nuttx.linkcmd}"
|
LDFLAGS += @"${shell cygpath -w $(ARCHSRCDIR)/nuttx.linkcmd}"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
HEAD_ASRC = $(HEAD_SSRC:.S=$(ASMEXT))
|
HEAD_ASRC = $(HEAD_SSRC:.S=$(ASMEXT))
|
||||||
HEAD_OBJ = $(HEAD_SSRC:.S=$(OBJEXT))
|
HEAD_OBJ = $(HEAD_SSRC:.S=$(OBJEXT))
|
||||||
|
|
||||||
SSRCS = $(CHIP_SSRCS) $(CMN_SSRCS)
|
SSRCS = $(CHIP_SSRCS) $(CMN_SSRCS)
|
||||||
ASRCS = $(SSRCS:.S=$(ASMEXT))
|
ASRCS = $(SSRCS:.S=$(ASMEXT))
|
||||||
AOBJS = $(SSRCS:.S=$(OBJEXT))
|
AOBJS = $(SSRCS:.S=$(OBJEXT))
|
||||||
|
|
||||||
CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS)
|
CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS)
|
||||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||||
|
|
||||||
DEPSRCS = $(SSRCS) $(CSRCS)
|
DEPSRCS = $(SSRCS) $(CSRCS)
|
||||||
OBJS = $(AOBJS) $(COBJS)
|
OBJS = $(AOBJS) $(COBJS)
|
||||||
|
|
||||||
BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
|
BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
|
||||||
|
|
||||||
VPATH = chip:common
|
VPATH = chip:common
|
||||||
|
|
||||||
all: $(HEAD_OBJ) libarch$(LIBEXT)
|
all: $(HEAD_OBJ) libarch$(LIBEXT)
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ nuttx.linkcmd: $(LINKCMDTEMPLATE)
|
|||||||
@echo "\"${shell cygpath -w $(TOPDIR)/nuttx}\"= \\" >>nuttx.linkcmd
|
@echo "\"${shell cygpath -w $(TOPDIR)/nuttx}\"= \\" >>nuttx.linkcmd
|
||||||
@echo " \"${shell cygpath -w $(ARCHSRCDIR)/$(HEAD_OBJ)}\", \\" >>nuttx.linkcmd
|
@echo " \"${shell cygpath -w $(ARCHSRCDIR)/$(HEAD_OBJ)}\", \\" >>nuttx.linkcmd
|
||||||
@( for lib in $(LINKLIBS); do \
|
@( for lib in $(LINKLIBS); do \
|
||||||
echo " \"`cygpath -w $(TOPDIR)/$${lib}`\", \\" >>nuttx.linkcmd; \
|
echo " \"`cygpath -w $(TOPDIR)/lib/$${lib}`\", \\" >>nuttx.linkcmd; \
|
||||||
done ; )
|
done ; )
|
||||||
@echo " \"${shell cygpath -w $(ARCHSRCDIR)/board/libboard$(LIBEXT)}\", \\" >>nuttx.linkcmd
|
@echo " \"${shell cygpath -w $(ARCHSRCDIR)/board/libboard$(LIBEXT)}\", \\" >>nuttx.linkcmd
|
||||||
@echo " \"${shell cygpath -w $(ZDSSTDLIBDIR)/chelpld$(LIBEXT)}\", \\" >>nuttx.linkcmd
|
@echo " \"${shell cygpath -w $(ZDSSTDLIBDIR)/chelpld$(LIBEXT)}\", \\" >>nuttx.linkcmd
|
||||||
|
@ -37,49 +37,49 @@
|
|||||||
# Tools
|
# Tools
|
||||||
# CFLAGS, CPPFLAGS, ASFLAGS, LDFLAGS are set in $(TOPDIR)/Make.defs
|
# CFLAGS, CPPFLAGS, ASFLAGS, LDFLAGS are set in $(TOPDIR)/Make.defs
|
||||||
|
|
||||||
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(TOPDIR)/sched
|
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(TOPDIR)/sched
|
||||||
CPPFLAGS += -D__ASSEMBLY__
|
CPPFLAGS += -D__ASSEMBLY__
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
# Files and directories
|
# Files and directories
|
||||||
|
|
||||||
# There should be one head source (.asm file)
|
# There should be one head source (.asm file)
|
||||||
|
|
||||||
HEAD_OBJ = $(HEAD_ASRC:$(ASMEXT)=$(OBJEXT))
|
HEAD_OBJ = $(HEAD_ASRC:$(ASMEXT)=$(OBJEXT))
|
||||||
|
|
||||||
# Assembly sources and objects
|
# Assembly sources and objects
|
||||||
|
|
||||||
ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
|
ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
|
||||||
AOBJS = $(ASRCS:$(ASMEXT)=$(OBJEXT))
|
AOBJS = $(ASRCS:$(ASMEXT)=$(OBJEXT))
|
||||||
|
|
||||||
# C sources and objects
|
# C sources and objects
|
||||||
|
|
||||||
CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS)
|
CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS)
|
||||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||||
|
|
||||||
# All sources and objcts
|
# All sources and objcts
|
||||||
|
|
||||||
SRCS = $(ASRCS) $(CSRCS)
|
SRCS = $(ASRCS) $(CSRCS)
|
||||||
OBJS = $(AOBJS) $(COBJS)
|
OBJS = $(AOBJS) $(COBJS)
|
||||||
|
|
||||||
# Sources that can have dependencies (no .asm files)
|
# Sources that can have dependencies (no .asm files)
|
||||||
|
|
||||||
DEPSRCS = $(CSRCS)
|
DEPSRCS = $(CSRCS)
|
||||||
|
|
||||||
# Directories
|
# Directories
|
||||||
|
|
||||||
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
||||||
BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
|
BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
|
||||||
|
|
||||||
VPATH = chip:common:board
|
VPATH = chip:common:board
|
||||||
|
|
||||||
# Libraries
|
# Libraries
|
||||||
|
|
||||||
LIBGCC = ${shell $(CC) $(ARCHCPUFLAGS) -print-libgcc-file-name}
|
LIBGCC = ${shell $(CC) $(ARCHCPUFLAGS) -print-libgcc-file-name}
|
||||||
|
|
||||||
# Supports dynamic sizing of HEAP.
|
# Supports dynamic sizing of HEAP.
|
||||||
#
|
#
|
||||||
HEAP_BASE = ${shell ./mkhpbase.sh}
|
HEAP_BASE = ${shell ./mkhpbase.sh}
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
# Targets
|
# Targets
|
||||||
@ -152,7 +152,7 @@ pass1.hex: up_mem.h asm_mem.h $(SDCCLIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard
|
|||||||
@echo "-k $(SDCCLIBDIR)" >>pass1.lnk # Path to SDCC z80 library
|
@echo "-k $(SDCCLIBDIR)" >>pass1.lnk # Path to SDCC z80 library
|
||||||
@echo "-l libboard$(LIBEXT)" >>pass1.lnk # Name of board library
|
@echo "-l libboard$(LIBEXT)" >>pass1.lnk # Name of board library
|
||||||
@for LIB in $(LINKLIBS); do \
|
@for LIB in $(LINKLIBS); do \
|
||||||
echo "-l $(TOPDIR)/$$LIB" >> pass1.lnk ;\
|
echo "-l $(TOPDIR)/lib/$$LIB" >> pass1.lnk ;\
|
||||||
done
|
done
|
||||||
@echo "-l myz80.lib" >>pass1.lnk # Name of SDCC z80 library
|
@echo "-l myz80.lib" >>pass1.lnk # Name of SDCC z80 library
|
||||||
ifneq ($(CONFIG_LINKER_START_AREA),)
|
ifneq ($(CONFIG_LINKER_START_AREA),)
|
||||||
@ -185,7 +185,7 @@ nuttx.hex: up_mem.h asm_mem.h $(SDCCLIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard
|
|||||||
@echo "-k $(SDCCLIBDIR)" >>nuttx.lnk # Path to SDCC z80 library
|
@echo "-k $(SDCCLIBDIR)" >>nuttx.lnk # Path to SDCC z80 library
|
||||||
@echo "-l libboard$(LIBEXT)" >>nuttx.lnk # Name of board library
|
@echo "-l libboard$(LIBEXT)" >>nuttx.lnk # Name of board library
|
||||||
@for LIB in $(LINKLIBS); do \
|
@for LIB in $(LINKLIBS); do \
|
||||||
echo "-l $(TOPDIR)/$$LIB" >> nuttx.lnk ;\
|
echo "-l $(TOPDIR)/lib/$$LIB" >> nuttx.lnk ;\
|
||||||
done
|
done
|
||||||
@echo "-l myz80.lib" >>nuttx.lnk # Name of SDCC z80 library
|
@echo "-l myz80.lib" >>nuttx.lnk # Name of SDCC z80 library
|
||||||
ifneq ($(CONFIG_LINKER_START_AREA),)
|
ifneq ($(CONFIG_LINKER_START_AREA),)
|
||||||
|
@ -38,42 +38,42 @@
|
|||||||
|
|
||||||
# Board-specific directory, board library, and application library
|
# Board-specific directory, board library, and application library
|
||||||
|
|
||||||
PASS1_SRCDIR = arch/$(CONFIG_ARCH)/src
|
PASS1_SRCDIR = arch/$(CONFIG_ARCH)/src
|
||||||
PASS1_BOARDDIR = $(PASS1_SRCDIR)/board
|
PASS1_BOARDDIR = $(PASS1_SRCDIR)/board
|
||||||
PASS1_LIBBOARD = $(PASS1_BOARDDIR)/libboard$(LIBEXT)
|
PASS1_LIBBOARD = $(PASS1_BOARDDIR)/libboard$(LIBEXT)
|
||||||
|
|
||||||
# Where is the application library?
|
# Where is the application library?
|
||||||
|
|
||||||
ifneq ($(CONFIG_APPS_DIR),)
|
ifneq ($(CONFIG_APPS_DIR),)
|
||||||
PASS1_LIBAPPS = $(CONFIG_APPS_DIR)/libapps$(LIBEXT)
|
PASS1_LIBAPPS = $(CONFIG_APPS_DIR)/libapps$(LIBEXT)
|
||||||
else
|
else
|
||||||
ifneq ($(APPDIR),)
|
ifneq ($(APPDIR),)
|
||||||
PASS1_LIBAPPS = $(APPDIR)/libapps$(LIBEXT)
|
PASS1_LIBAPPS = $(APPDIR)/libapps$(LIBEXT)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Remove the application library (libapps) from the list of libraries. Add
|
# Remove the application library (libapps) from the list of libraries. Add
|
||||||
# the boad library (liboard)
|
# the boad library (liboard)
|
||||||
|
|
||||||
PASS1_LINKLIBS = $(filter-out $(PASS1_LIBAPPS),$(LINKLIBS))
|
PASS1_LINKLIBS = $(filter-out $(PASS1_LIBAPPS),$(LINKLIBS))
|
||||||
PASS1_LINKLIBS += $(PASS1_LIBBOARD)
|
PASS1_LINKLIBS += $(PASS1_LIBBOARD)
|
||||||
|
|
||||||
# Get the paths to the libraries and the links script path in format that
|
# Get the paths to the libraries and the links script path in format that
|
||||||
# is appropriate for the host OS
|
# is appropriate for the host OS
|
||||||
|
|
||||||
ifeq ($(WINTOOL),y)
|
ifeq ($(WINTOOL),y)
|
||||||
# Windows-native toolchains
|
# Windows-native toolchains
|
||||||
PASS1_LIBPATHS = ${shell for path in $(PASS1_LINKLIBS); do dir=`dirname $(TOPDIR)/$$path`;echo "-L\"`cygpath -w $$dir`\"";done}
|
PASS1_LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/lib"}"
|
||||||
PASS1_LDSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/locked/ld-locked.inc}"
|
PASS1_LDSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/locked/ld-locked.inc}"
|
||||||
else
|
else
|
||||||
# Linux/Cygwin-native toolchain
|
# Linux/Cygwin-native toolchain
|
||||||
PASS1_LIBPATHS = $(addprefix -L$(TOPDIR)/,$(dir $(PASS1_LINKLIBS)))
|
PASS1_LIBPATHS += -L"(TOPDIR)/lib"
|
||||||
PASS1_LDSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/locked/ld-locked.inc
|
PASS1_LDSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/locked/ld-locked.inc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
PASS1_LDFLAGS = -r $(PASS1_LDSCRIPT)
|
PASS1_LDFLAGS = -r $(PASS1_LDSCRIPT)
|
||||||
PASS1_LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(PASS1_LINKLIBS))))
|
PASS1_LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(PASS1_LINKLIBS)))
|
||||||
PASS1_LIBGCC = "${shell $(CC) -print-libgcc-file-name}"
|
PASS1_LIBGCC = "${shell $(CC) -print-libgcc-file-name}"
|
||||||
|
|
||||||
# Targets:
|
# Targets:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user