diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-09-07 08:43:01 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-09-07 08:43:01 -0600 |
commit | 26b2fe3e5bfff38e941312edf4a6fe94a9e4dd43 (patch) | |
tree | f1eaf63c160822c9e89b9211678d2893d368e3df /apps/examples/nettest | |
parent | 0245ea571aff1a005054c608dd187dbb4cfd194f (diff) | |
download | nuttx-26b2fe3e5bfff38e941312edf4a6fe94a9e4dd43.tar.gz nuttx-26b2fe3e5bfff38e941312edf4a6fe94a9e4dd43.tar.bz2 nuttx-26b2fe3e5bfff38e941312edf4a6fe94a9e4dd43.zip |
Changes to many Makefiles. For kernel buil object containing main cannot go into library because of name collisions. The object file must be handled as a special case in every Makefile
Diffstat (limited to 'apps/examples/nettest')
-rw-r--r-- | apps/examples/nettest/Makefile | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/apps/examples/nettest/Makefile b/apps/examples/nettest/Makefile index b828d6691..99410d47a 100644 --- a/apps/examples/nettest/Makefile +++ b/apps/examples/nettest/Makefile @@ -42,18 +42,24 @@ include $(APPDIR)/Make.defs TARG_ASRCS = TARG_AOBJS = $(TARG_ASRCS:.S=$(OBJEXT)) -TARG_CSRCS = nettest.c +TARG_CSRCS = ifeq ($(CONFIG_EXAMPLES_NETTEST_SERVER),y) TARG_CSRCS += nettest_server.c else TARG_CSRCS += nettest_client.c endif +TARG_MAINSRC = nettest.c TARG_COBJS = $(TARG_CSRCS:.c=$(OBJEXT)) +TARG_MAINOBJ = $(TARG_MAINSRC:.c=$(OBJEXT)) -TARG_SRCS = $(TARG_ASRCS) $(TARG_CSRCS) +TARG_SRCS = $(TARG_ASRCS) $(TARG_CSRCS) $(TARG_CSRCS) TARG_OBJS = $(TARG_AOBJS) $(TARG_COBJS) +ifneq ($(CONFIG_BUILD_KERNEL),y) + TARG_OBJS += $(TARG_MAINOBJ) +endif + ifeq ($(CONFIG_WINDOWS_NATIVE),y) TARG_BIN = ..\..\libapps$(LIBEXT) else @@ -126,9 +132,10 @@ $(HOST_BIN): $(HOST_OBJS) @touch .built ifeq ($(CONFIG_BUILD_KERNEL),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) +$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(TARG_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) $(TARG_MAINOBJ) $(LDLIBS) + $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) install: $(BIN_DIR)$(DELIM)$(PROGNAME) |