From 63f45cbd06e8434879422f6b8d3f7af6c41c76e0 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 7 Sep 2014 06:17:46 -0600 Subject: [PATCH] Fix apps/examples/hello/Makefile --- examples/hello/Makefile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/examples/hello/Makefile b/examples/hello/Makefile index 3a5c3df98..56405cdbb 100644 --- a/examples/hello/Makefile +++ b/examples/hello/Makefile @@ -46,14 +46,20 @@ STACKSIZE = 2048 # Hello, World! Example ASRCS = -CSRCS = hello_main.c +CSRCS = +MAINSRC = hello_main.c AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) +MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) -SRCS = $(ASRCS) $(CSRCS) +SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) OBJS = $(AOBJS) $(COBJS) +ifneq ($(CONFIG_BUILD_KERNEL),y) + OBJS += $(MAINOBJ) +endif + ifeq ($(CONFIG_WINDOWS_NATIVE),y) BIN = ..\..\libapps$(LIBEXT) else @@ -93,9 +99,10 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_BUILD_KERNEL),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) +$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(LDLIBS) + $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) + $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) install: $(BIN_DIR)$(DELIM)$(PROGNAME)