summaryrefslogtreecommitdiff
path: root/apps/examples/elf/Makefile
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-10-27 00:04:47 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-10-27 00:04:47 +0000
commit1ba327bd1c3e895675e7ab504af1064635fdf282 (patch)
tree615048fb87a55a2421efe353d061d0ded0d8eebf /apps/examples/elf/Makefile
parentf1c2ce14060e4442dd59f6fa89e02b23c2d3989d (diff)
downloadpx4-nuttx-1ba327bd1c3e895675e7ab504af1064635fdf282.tar.gz
px4-nuttx-1ba327bd1c3e895675e7ab504af1064635fdf282.tar.bz2
px4-nuttx-1ba327bd1c3e895675e7ab504af1064635fdf282.zip
The ELF loader is basically functional (needs more testing)
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5265 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/examples/elf/Makefile')
-rw-r--r--apps/examples/elf/Makefile36
1 files changed, 21 insertions, 15 deletions
diff --git a/apps/examples/elf/Makefile b/apps/examples/elf/Makefile
index 23a6bcb6f..ea483e7a1 100644
--- a/apps/examples/elf/Makefile
+++ b/apps/examples/elf/Makefile
@@ -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