The ELF loader is basically functional (needs more testing)

git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5265 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2012-10-27 00:04:47 +00:00
parent 7bc6a69f46
commit 1f1319f25b
25 changed files with 291 additions and 298 deletions
+21 -15
View File
@@ -39,29 +39,29 @@ include $(APPDIR)/Make.defs
# ELF Example
ASRCS =
CSRCS = elf_main.c
ASRCS =
CSRCS = elf_main.c symtab.c
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
ifeq ($(WINTOOL),y)
BIN = "${shell cygpath -w $(APPDIR)/libapps$(LIBEXT)}"
BIN = "${shell cygpath -w $(APPDIR)/libapps$(LIBEXT)}"
else
BIN = "$(APPDIR)/libapps$(LIBEXT)"
BIN = "$(APPDIR)/libapps$(LIBEXT)"
endif
ROOTDEPPATH = --dep-path .
ROOTDEPPATH = --dep-path . --dep-path tests
# Common build
# Build targets
VPATH =
VPATH = tests
all: .built
.PHONY: headers clean_tests clean depend disclean
.PHONY: really_build clean_tests clean depend disclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
@@ -69,15 +69,21 @@ $(AOBJS): %$(OBJEXT): %.S
$(COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
headers:
@$(MAKE) -C tests TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV)
# This is a little messy. The build is broken into two pieces: (1) the
# tests/ subdir build that auto-generates several files, and (2) the real
# build. This is done because we need a fresh build context after auto-
# generating the source files.
.built: headers $(OBJS)
really_build: $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $(BIN), $${obj}); \
done ; )
@touch .built
.built:
@$(MAKE) -C tests TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV)
@$(MAKE) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" really_build
context:
# We can't make dependencies in this directory because the required