summaryrefslogtreecommitdiff
path: root/apps/examples/elf/tests/errno/Makefile
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-08-29 07:20:07 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-08-29 07:20:07 -0600
commit1280639f2eb423c3e6210441a36c96761cd07560 (patch)
tree904f52c432c65a10d5d8c56a1ca7a4dba6664d0d /apps/examples/elf/tests/errno/Makefile
parentaa61bf9998f4b6e8d6002a94037c54773387ea81 (diff)
downloadpx4-nuttx-1280639f2eb423c3e6210441a36c96761cd07560.tar.gz
px4-nuttx-1280639f2eb423c3e6210441a36c96761cd07560.tar.bz2
px4-nuttx-1280639f2eb423c3e6210441a36c96761cd07560.zip
The ELF test/example has been extended so the individual ELF test programs can link against the SYSCALL library (if it is available) or against the C library to eliminate or minimize the need for symbol tables (2014-8-29).
Diffstat (limited to 'apps/examples/elf/tests/errno/Makefile')
-rw-r--r--apps/examples/elf/tests/errno/Makefile36
1 files changed, 33 insertions, 3 deletions
diff --git a/apps/examples/elf/tests/errno/Makefile b/apps/examples/elf/tests/errno/Makefile
index ca2f34bf9..44e50744b 100644
--- a/apps/examples/elf/tests/errno/Makefile
+++ b/apps/examples/elf/tests/errno/Makefile
@@ -1,7 +1,7 @@
############################################################################
-# examples/elf/tests/hello/Makefile
+# examples/elf/tests/errno/Makefile
#
-# Copyright (C) 2012 Gregory Nutt. All rights reserved.
+# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -35,6 +35,36 @@
-include $(TOPDIR)/Make.defs
+ifeq ($(WINTOOL),y)
+NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}"
+else
+NUTTXLIB = "$(TOPDIR)$(DELIM)lib"
+endif
+
+LIBPATH =
+ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y)
+LDELFFLAGS += -Bstatic
+LIBPATH += -L $(NUTTXLIB)
+else
+ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y)
+LDELFFLAGS += -Bstatic
+LIBPATH += -L $(NUTTXLIB)
+endif
+endif
+
+LIBS =
+ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y)
+ifeq ($(CONFIG_NUTTX_KERNEL),y)
+LIBS += -luc
+else
+LIBS += -lc
+endif
+endif
+
+ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y)
+LIBS += -lproxies
+endif
+
BIN = errno
SRCS = $(BIN).c
@@ -48,7 +78,7 @@ $(OBJS): %.o: %.c
$(BIN): $(OBJS)
@echo "LD: $<"
- $(Q) $(LD) $(LDELFFLAGS) -o $@ $^
+ $(Q) $(LD) $(LDELFFLAGS) $(LIBPATH) -o $@ $^ $(LIBS)
clean:
$(call DELFILE, $(BIN))