From 6ba90d01b2bc73b9ffd9a0ca8305f97ed34efb68 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 7 Sep 2014 06:59:30 -0600 Subject: Update apps/examples/helloxx/Makefile --- apps/examples/helloxx/Makefile | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'apps/examples/helloxx/Makefile') 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) -- cgit v1.2.3