diff options
Diffstat (limited to 'apps/examples/elf/tests/hello/Makefile')
-rw-r--r-- | apps/examples/elf/tests/hello/Makefile | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/apps/examples/elf/tests/hello/Makefile b/apps/examples/elf/tests/hello/Makefile index 07f97bee9..a5fc71e31 100644 --- a/apps/examples/elf/tests/hello/Makefile +++ b/apps/examples/elf/tests/hello/Makefile @@ -1,7 +1,7 @@ ############################################################################ # examples/elf/tests/hello/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 = hello 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)) |