From 294d526ed22c1aafa8b419f51632f31a673657aa Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 5 Sep 2014 13:59:20 -0600 Subject: Provide library names and paths in apps/import/Make.defs --- apps/examples/elf/tests/errno/Makefile | 14 ++++++-------- apps/examples/elf/tests/hello/Makefile | 14 ++++++-------- apps/examples/elf/tests/helloxx/Makefile | 28 +++++++++++++--------------- apps/examples/elf/tests/longjmp/Makefile | 14 ++++++-------- apps/examples/elf/tests/mutex/Makefile | 14 ++++++-------- apps/examples/elf/tests/pthread/Makefile | 14 ++++++-------- apps/examples/elf/tests/signal/Makefile | 14 ++++++-------- apps/examples/elf/tests/struct/Makefile | 14 ++++++-------- apps/examples/elf/tests/task/Makefile | 14 ++++++-------- apps/import/Make.defs | 15 +++++++++++++++ 10 files changed, 76 insertions(+), 79 deletions(-) diff --git a/apps/examples/elf/tests/errno/Makefile b/apps/examples/elf/tests/errno/Makefile index d0f6f8256..b9029e163 100644 --- a/apps/examples/elf/tests/errno/Makefile +++ b/apps/examples/elf/tests/errno/Makefile @@ -41,28 +41,26 @@ else NUTTXLIB = "$(TOPDIR)$(DELIM)lib" endif -LIBPATH = ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y) LDELFFLAGS += -Bstatic -LIBPATH += -L $(NUTTXLIB) +LDLIBPATH += -L $(NUTTXLIB) else ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y) LDELFFLAGS += -Bstatic -LIBPATH += -L $(NUTTXLIB) +LDLIBPATH += -L $(NUTTXLIB) endif endif -LIBS = ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y) ifeq ($(CONFIG_BUILD_PROTECTED),y) -LIBS += -luc +LDLIBS += -luc else -LIBS += -lc +LDLIBS += -lc endif endif ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y) -LIBS += -lproxies +LDLIBS += -lproxies endif BIN = errno @@ -78,7 +76,7 @@ $(OBJS): %.o: %.c $(BIN): $(OBJS) @echo "LD: $<" - $(Q) $(LD) $(LDELFFLAGS) $(LIBPATH) -o $@ $^ $(LIBS) + $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $^ $(LDLIBS) clean: $(call DELFILE, $(BIN)) diff --git a/apps/examples/elf/tests/hello/Makefile b/apps/examples/elf/tests/hello/Makefile index bcb227979..2fb1fdce4 100644 --- a/apps/examples/elf/tests/hello/Makefile +++ b/apps/examples/elf/tests/hello/Makefile @@ -41,28 +41,26 @@ else NUTTXLIB = "$(TOPDIR)$(DELIM)lib" endif -LIBPATH = ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y) LDELFFLAGS += -Bstatic -LIBPATH += -L $(NUTTXLIB) +LDLIBPATH += -L $(NUTTXLIB) else ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y) LDELFFLAGS += -Bstatic -LIBPATH += -L $(NUTTXLIB) +LDLIBPATH += -L $(NUTTXLIB) endif endif -LIBS = ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y) ifeq ($(CONFIG_BUILD_PROTECTED),y) -LIBS += -luc +LDLIBS += -luc else -LIBS += -lc +LDLIBS += -lc endif endif ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y) -LIBS += -lproxies +LDLIBS += -lproxies endif BIN = hello @@ -78,7 +76,7 @@ $(OBJS): %.o: %.c $(BIN): $(OBJS) @echo "LD: $<" - $(Q) $(LD) $(LDELFFLAGS) $(LIBPATH) -o $@ $^ $(LIBS) + $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $^ $(LDLIBS) clean: $(call DELFILE, $(BIN)) diff --git a/apps/examples/elf/tests/helloxx/Makefile b/apps/examples/elf/tests/helloxx/Makefile index 8882e21a5..f16ef7e6f 100644 --- a/apps/examples/elf/tests/helloxx/Makefile +++ b/apps/examples/elf/tests/helloxx/Makefile @@ -41,28 +41,26 @@ else NUTTXLIB = "$(TOPDIR)$(DELIM)lib" endif -LIBPATH = ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y) LDELFFLAGS += -Bstatic -LIBPATH += -L $(NUTTXLIB) +LDLIBPATH += -L $(NUTTXLIB) else ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y) LDELFFLAGS += -Bstatic -LIBPATH += -L $(NUTTXLIB) +LDLIBPATH += -L $(NUTTXLIB) endif endif -LIBS = ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y) ifeq ($(CONFIG_BUILD_PROTECTED),y) -LIBS += -luc +LDLIBS += -luc else -LIBS += -lc +LDLIBS += -lc endif endif ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y) -LIBS += -lproxies +LDLIBS += -lproxies endif BIN1 = hello++1 @@ -90,8 +88,8 @@ endif SRCS = $(SRCS1) $(SRCS2) $(SRCS3) $(SRCS4) OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) -LIBSTDC_STUBS_DIR = $(TOPDIR)/libxx -LIBSTDC_STUBS_LIB = $(LIBSTDC_STUBS_DIR)/liblibxx.a +LDLIBSTDC_STUBS_DIR = $(TOPDIR)/libxx +LDLIBSTDC_STUBS_LIB = $(LDLIBSTDC_STUBS_DIR)/liblibxx.a all: $(BIN1) $(BIN2) $(BIN3) $(BIN4) @@ -102,8 +100,8 @@ $(OBJS): %.o: %.cpp # This contains libstdc++ stubs to that you can build C++ code # without actually having libstdc++ -$(LIBSTDC_STUBS_LIB): - $(Q) $(MAKE) -C $(LIBSTDC_STUBS_DIR) TOPDIR=$(TOPDIR) +$(LDLIBSTDC_STUBS_LIB): + $(Q) $(MAKE) -C $(LDLIBSTDC_STUBS_DIR) TOPDIR=$(TOPDIR) # BIN1 and BIN2 link just like C code because they contain no # static constructors. BIN1 is equivalent to a C hello world; @@ -112,18 +110,18 @@ $(LIBSTDC_STUBS_LIB): $(BIN1): $(OBJS1) @echo "LD: $<" - $(Q) $(LD) $(LDELFFLAGS) $(LIBPATH) -o $@ $^ $(LIBS) + $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $^ $(LDLIBS) $(BIN2): $(OBJS2) @echo "LD: $<" - $(Q) $(LD) $(LDELFFLAGS) $(LIBPATH) -o $@ $^ $(LIBS) + $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $^ $(LDLIBS) # BIN3 is equivalent to BIN2 except that is uses static initializers ifeq ($(CONFIG_BINFMT_CONSTRUCTORS),y) $(BIN3): $(OBJS3) @echo "LD: $<" - $(Q) $(LD) $(LDELFFLAGS) $(LIBPATH) -o $@ $^ $(LIBS) + $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $^ $(LDLIBS) endif # BIN4 is similar to BIN3 except that it uses the streams code from libstdc++ @@ -132,7 +130,7 @@ endif # #$(BIN4): $(OBJS4) # @echo "LD: $<" -# $(Q) $(LD) $(LDELFFLAGS) $(LIBPATH) -o $@ $^ $(LIBS) +# $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $^ $(LDLIBS) clean: $(call DELFILE, $(BIN1)) diff --git a/apps/examples/elf/tests/longjmp/Makefile b/apps/examples/elf/tests/longjmp/Makefile index 802d84df1..9cc3a9922 100644 --- a/apps/examples/elf/tests/longjmp/Makefile +++ b/apps/examples/elf/tests/longjmp/Makefile @@ -41,28 +41,26 @@ else NUTTXLIB = "$(TOPDIR)$(DELIM)lib" endif -LIBPATH = ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y) LDELFFLAGS += -Bstatic -LIBPATH += -L $(NUTTXLIB) +LDLIBPATH += -L $(NUTTXLIB) else ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y) LDELFFLAGS += -Bstatic -LIBPATH += -L $(NUTTXLIB) +LDLIBPATH += -L $(NUTTXLIB) endif endif -LIBS = ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y) ifeq ($(CONFIG_BUILD_PROTECTED),y) -LIBS += -luc +LDLIBS += -luc else -LIBS += -lc +LDLIBS += -lc endif endif ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y) -LIBS += -lproxies +LDLIBS += -lproxies endif BIN = longjmp @@ -78,7 +76,7 @@ $(OBJS): %.o: %.c $(BIN): $(OBJS) @echo "LD: $<" - $(Q) $(LD) $(LDELFFLAGS) $(LIBPATH) -o $@ $^ $(LIBS) + $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $^ $(LDLIBS) clean: $(call DELFILE, $(BIN)) diff --git a/apps/examples/elf/tests/mutex/Makefile b/apps/examples/elf/tests/mutex/Makefile index 197bb41a9..d7ce09041 100644 --- a/apps/examples/elf/tests/mutex/Makefile +++ b/apps/examples/elf/tests/mutex/Makefile @@ -41,28 +41,26 @@ else NUTTXLIB = "$(TOPDIR)$(DELIM)lib" endif -LIBPATH = ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y) LDELFFLAGS += -Bstatic -LIBPATH += -L $(NUTTXLIB) +LDLIBPATH += -L $(NUTTXLIB) else ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y) LDELFFLAGS += -Bstatic -LIBPATH += -L $(NUTTXLIB) +LDLIBPATH += -L $(NUTTXLIB) endif endif -LIBS = ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y) ifeq ($(CONFIG_BUILD_PROTECTED),y) -LIBS += -luc +LDLIBS += -luc else -LIBS += -lc +LDLIBS += -lc endif endif ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y) -LIBS += -lproxies +LDLIBS += -lproxies endif BIN = mutex @@ -78,7 +76,7 @@ $(OBJS): %.o: %.c $(BIN): $(OBJS) @echo "LD: $<" - $(Q) $(LD) $(LDELFFLAGS) $(LIBPATH) -o $@ $^ $(LIBS) + $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $^ $(LDLIBS) clean: $(call DELFILE, $(BIN)) diff --git a/apps/examples/elf/tests/pthread/Makefile b/apps/examples/elf/tests/pthread/Makefile index 0aa524506..0b34c8f8a 100644 --- a/apps/examples/elf/tests/pthread/Makefile +++ b/apps/examples/elf/tests/pthread/Makefile @@ -41,28 +41,26 @@ else NUTTXLIB = "$(TOPDIR)$(DELIM)lib" endif -LIBPATH = ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y) LDELFFLAGS += -Bstatic -LIBPATH += -L $(NUTTXLIB) +LDLIBPATH += -L $(NUTTXLIB) else ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y) LDELFFLAGS += -Bstatic -LIBPATH += -L $(NUTTXLIB) +LDLIBPATH += -L $(NUTTXLIB) endif endif -LIBS = ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y) ifeq ($(CONFIG_BUILD_PROTECTED),y) -LIBS += -luc +LDLIBS += -luc else -LIBS += -lc +LDLIBS += -lc endif endif ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y) -LIBS += -lproxies +LDLIBS += -lproxies endif BIN = pthread @@ -78,7 +76,7 @@ $(OBJS): %.o: %.c $(BIN): $(OBJS) @echo "LD: $<" - $(Q) $(LD) $(LDELFFLAGS) $(LIBPATH) -o $@ $^ $(LIBS) + $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $^ $(LDLIBS) clean: $(call DELFILE, $(BIN)) diff --git a/apps/examples/elf/tests/signal/Makefile b/apps/examples/elf/tests/signal/Makefile index 80b843e32..93f7bc183 100644 --- a/apps/examples/elf/tests/signal/Makefile +++ b/apps/examples/elf/tests/signal/Makefile @@ -41,28 +41,26 @@ else NUTTXLIB = "$(TOPDIR)$(DELIM)lib" endif -LIBPATH = ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y) LDELFFLAGS += -Bstatic -LIBPATH += -L $(NUTTXLIB) +LDLIBPATH += -L $(NUTTXLIB) else ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y) LDELFFLAGS += -Bstatic -LIBPATH += -L $(NUTTXLIB) +LDLIBPATH += -L $(NUTTXLIB) endif endif -LIBS = ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y) ifeq ($(CONFIG_BUILD_PROTECTED),y) -LIBS += -luc +LDLIBS += -luc else -LIBS += -lc +LDLIBS += -lc endif endif ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y) -LIBS += -lproxies +LDLIBS += -lproxies endif BIN = signal @@ -78,7 +76,7 @@ $(OBJS): %.o: %.c $(BIN): $(OBJS) @echo "LD: $<" - $(Q) $(LD) $(LDELFFLAGS) $(LIBPATH) -o $@ $^ $(LIBS) + $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $^ $(LDLIBS) clean: $(call DELFILE, $(BIN)) diff --git a/apps/examples/elf/tests/struct/Makefile b/apps/examples/elf/tests/struct/Makefile index 27595dfaa..4dec5e51e 100644 --- a/apps/examples/elf/tests/struct/Makefile +++ b/apps/examples/elf/tests/struct/Makefile @@ -43,28 +43,26 @@ else NUTTXLIB = "$(TOPDIR)$(DELIM)lib" endif -LIBPATH = ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y) LDELFFLAGS += -Bstatic -LIBPATH += -L $(NUTTXLIB) +LDLIBPATH += -L $(NUTTXLIB) else ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y) LDELFFLAGS += -Bstatic -LIBPATH += -L $(NUTTXLIB) +LDLIBPATH += -L $(NUTTXLIB) endif endif -LIBS = ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y) ifeq ($(CONFIG_BUILD_PROTECTED),y) -LIBS += -luc +LDLIBS += -luc else -LIBS += -lc +LDLIBS += -lc endif endif ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y) -LIBS += -lproxies +LDLIBS += -lproxies endif BIN = struct @@ -79,7 +77,7 @@ $(OBJS): %.o: %.c $(BIN): $(OBJS) @echo "LD: $<" - $(Q) $(LD) $(LDELFFLAGS) $(LIBPATH) -o $@ $^ $(LIBS) + $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $^ $(LDLIBS) clean: $(call DELFILE, $(BIN)) diff --git a/apps/examples/elf/tests/task/Makefile b/apps/examples/elf/tests/task/Makefile index 6a93da9e3..13d07e18a 100644 --- a/apps/examples/elf/tests/task/Makefile +++ b/apps/examples/elf/tests/task/Makefile @@ -41,28 +41,26 @@ else NUTTXLIB = "$(TOPDIR)$(DELIM)lib" endif -LIBPATH = ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y) LDELFFLAGS += -Bstatic -LIBPATH += -L $(NUTTXLIB) +LDLIBPATH += -L $(NUTTXLIB) else ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y) LDELFFLAGS += -Bstatic -LIBPATH += -L $(NUTTXLIB) +LDLIBPATH += -L $(NUTTXLIB) endif endif -LIBS = ifeq ($(CONFIG_EXAMPLES_ELF_LIBC),y) ifeq ($(CONFIG_BUILD_PROTECTED),y) -LIBS += -luc +LDLIBS += -luc else -LIBS += -lc +LDLIBS += -lc endif endif ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y) -LIBS += -lproxies +LDLIBS += -lproxies endif BIN = task @@ -78,7 +76,7 @@ $(OBJS): %.o: %.c $(BIN): $(OBJS) @echo "LD: $<" - $(Q) $(LD) $(LDELFFLAGS) $(LIBPATH) -o $@ $^ $(LIBS) + $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $^ $(LDLIBS) clean: $(call DELFILE, $(BIN)) diff --git a/apps/import/Make.defs b/apps/import/Make.defs index 702dd1480..efa6820fd 100644 --- a/apps/import/Make.defs +++ b/apps/import/Make.defs @@ -149,6 +149,7 @@ endef endif # Tool related definitions +# Compiler ifeq ($(WINTOOL),y) # Windows-native toolchains @@ -166,5 +167,19 @@ CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) +# C Pre-processor + CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ + +# Linker + +ifeq ($(WINTOOL),y) + # Windows-native toolchains + LDLIBPATH = -L "${shell cygpath -w ${APPDIR}}" -L "${shell cygpath -w $(TOPDIR)$(DELIM)libs}" +else + # Linux/Cygwin-native toolchain + LDLIBPATH = -L ${APPDIR} -L $(TOPDIR)$(DELIM)libs +endif + +LDLIBS = -lnuttx -- cgit v1.2.3