summaryrefslogtreecommitdiff
path: root/apps/examples/helloxx
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-09-07 06:59:30 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-09-07 06:59:30 -0600
commit6ba90d01b2bc73b9ffd9a0ca8305f97ed34efb68 (patch)
treea0fd0a766e73ef65c6ba6c09760184c60f029131 /apps/examples/helloxx
parent4e07afd09beb927fc064a2b8495f58db9f51c394 (diff)
downloadnuttx-6ba90d01b2bc73b9ffd9a0ca8305f97ed34efb68.tar.gz
nuttx-6ba90d01b2bc73b9ffd9a0ca8305f97ed34efb68.tar.bz2
nuttx-6ba90d01b2bc73b9ffd9a0ca8305f97ed34efb68.zip
Update apps/examples/helloxx/Makefile
Diffstat (limited to 'apps/examples/helloxx')
-rw-r--r--apps/examples/helloxx/Makefile24
1 files changed, 22 insertions, 2 deletions
diff --git a/apps/examples/helloxx/Makefile b/apps/examples/helloxx/Makefile
index f138cb2fb..204ed6881 100644
--- a/apps/examples/helloxx/Makefile
+++ b/apps/examples/helloxx/Makefile
@@ -41,15 +41,21 @@ include $(APPDIR)/Make.defs
ASRCS =
CSRCS =
-CXXSRCS = helloxx_main.cxx
+CXXSRCS =
+MAINSRC = helloxx_main.cxx
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT))
+MAINOBJ = $(MAINSRC:.cxx=$(OBJEXT))
-SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS)
+SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS) $(CXXOBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
@@ -60,6 +66,9 @@ else
endif
endif
+CONFIG_EXAMPLES_HELLOXX_PROGNAME ?= helloxx$(EXEEXT)
+PROGNAME = $(CONFIG_EXAMPLES_HELLOXX_PROGNAME)
+
ROOTDEPPATH = --dep-path .
# helloxx built-in application info
@@ -100,8 +109,19 @@ $(CXXOBJS): %$(OBJEXT): %.cxx
$(call ARCHIVE, $(BIN), $(OBJS))
@touch .built
+feq ($(CONFIG_BUILD_KERNEL),y)
+$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ)
+ @echo "LD: $(PROGNAME)"
+ $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS)
+ $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME)
+
+install: $(BIN_DIR)$(DELIM)$(PROGNAME)
+
+else
install:
+endif
+
ifeq ($(CONFIG_NSH_BUILTIN_APPS),y)
$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile
$(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main)