Fix several build issues noted by Mike Smith

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5459 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2012-12-24 20:22:14 +00:00
parent a66f6e6d12
commit e1dad951f1
3 changed files with 41 additions and 31 deletions
ChangeLog.txt
builtin
examples/nettest

@ -439,12 +439,18 @@
* Makefiles: Removed dependency of distclean on clean in most top-level * Makefiles: Removed dependency of distclean on clean in most top-level
files. It makes sense for 'leaf' Makefiles to have this dependency, files. It makes sense for 'leaf' Makefiles to have this dependency,
but it does not make sense for upper-level Makefiles. but it does not make sense for upper-level Makefiles.
* namedapp/: Renamed to builtins in preparation for another change. * apps/namedapp/: Renamed to builtins in preparation for another change.
* .context: Removed the .context kludge. This caused lots of problems * .context: Removed the .context kludge. This caused lots of problems
when changing configurations because there is no easy way to get the when changing configurations because there is no easy way to get the
system to rebuild the context. Now, the context will be rebuilt system to rebuild the context. Now, the context will be rebuilt
whenever there is a change in either .config or the Makefile. whenever there is a change in either .config or the Makefile.
* builtin/registry: Updated new built-in registration logic to handle * apps/builtin/registry: Updated new built-in registration logic to handle
cases where (1) old apps/.config is used, and (2) applications ared cases where (1) old apps/.config is used, and (2) applications ared
removed, not just added. removed, not just added.
* apps/examples/nettest/Makefile: Fix an error that crept in during
some of the recent, massive build system changes.
* apps/builtin/Makefile: Need to have auto-generated header files
in place early in the dependency generation phase to avoid warnings.
It is not important if they are only stubbed out header files at
this build phase.

@ -75,6 +75,9 @@ $(AOBJS): %$(OBJEXT): %.S
$(COBJS): %$(OBJEXT): %.c $(COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@) $(call COMPILE, $<, $@)
registry/.updated:
$(V) $(MAKE) -C registry .updated TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
builtin_list.h: registry/.updated builtin_list.h: registry/.updated
$(call DELFILE, builtin_list.h) $(call DELFILE, builtin_list.h)
$(Q) touch builtin_list.h $(Q) touch builtin_list.h
@ -110,7 +113,7 @@ endif
context: context:
$(Q) $(MAKE) -C registry context TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" $(Q) $(MAKE) -C registry context TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
.depend: Makefile $(SRCS) .depend: Makefile $(SRCS) builtin_list.h builtin_proto.h
$(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@ $(Q) touch $@

@ -39,64 +39,64 @@ include $(APPDIR)/Make.defs
# Basic TCP networking test # Basic TCP networking test
TARG_ASRCS = TARG_ASRCS =
TARG_AOBJS = $(TARG_ASRCS:.S=$(OBJEXT)) TARG_AOBJS = $(TARG_ASRCS:.S=$(OBJEXT))
TARG_CSRCS = nettest.c TARG_CSRCS = nettest.c
ifeq ($(CONFIG_EXAMPLES_NETTEST_SERVER),y) ifeq ($(CONFIG_EXAMPLES_NETTEST_SERVER),y)
TARG_CSRCS += nettest_server.c TARG_CSRCS += nettest_server.c
else else
TARG_CSRCS += nettest_client.c TARG_CSRCS += nettest_client.c
endif endif
TARG_COBJS = $(TARG_CSRCS:.c=$(OBJEXT)) TARG_COBJS = $(TARG_CSRCS:.c=$(OBJEXT))
TARG_SRCS = $(TARG_ASRCS) $(TARG_CSRCS) TARG_SRCS = $(TARG_ASRCS) $(TARG_CSRCS)
TARG_OBJS = $(TARG_AOBJS) $(TARG_COBJS) TARG_OBJS = $(TARG_AOBJS) $(TARG_COBJS)
ifeq ($(CONFIG_WINDOWS_NATIVE),y) ifeq ($(CONFIG_WINDOWS_NATIVE),y)
TARG_BIN = ..\..\libapps$(LIBEXT) TARG_BIN = ..\..\libapps$(LIBEXT)
else else
ifeq ($(WINTOOL),y) ifeq ($(WINTOOL),y)
TARG_BIN = ..\\..\\libapps$(LIBEXT) TARG_BIN = ..\\..\\libapps$(LIBEXT)
else else
TARG_BIN = ../../libapps$(LIBEXT) TARG_BIN = ../../libapps$(LIBEXT)
endif endif
endif endif
HOSTCFLAGS += -DCONFIG_EXAMPLES_NETTEST_HOST=1 HOSTCFLAGS += -DCONFIG_EXAMPLES_NETTEST_HOST=1
ifeq ($(CONFIG_EXAMPLES_NETTEST_SERVER),y) ifeq ($(CONFIG_EXAMPLES_NETTEST_SERVER),y)
HOSTCFLAGS += -DCONFIG_EXAMPLES_NETTEST_SERVER=1 \ HOSTCFLAGS += -DCONFIG_EXAMPLES_NETTEST_SERVER=1 -DCONFIG_EXAMPLES_NETTEST_CLIENTIP="$(CONFIG_EXAMPLES_NETTEST_CLIENTIP)"
-DCONFIG_EXAMPLES_NETTEST_CLIENTIP="$(CONFIG_EXAMPLES_NETTEST_CLIENTIP)"
endif endif
ifeq ($(CONFIG_EXAMPLES_NETTEST_PERFORMANCE),y) ifeq ($(CONFIG_EXAMPLES_NETTEST_PERFORMANCE),y)
HOSTCFLAGS += -DCONFIG_EXAMPLES_NETTEST_PERFORMANCE=1 HOSTCFLAGS += -DCONFIG_EXAMPLES_NETTEST_PERFORMANCE=1
endif endif
HOST_SRCS = host.c HOST_SRCS = host.c
ifeq ($(CONFIG_EXAMPLES_NETTEST_SERVER),y) ifeq ($(CONFIG_EXAMPLES_NETTEST_SERVER),y)
HOST_SRCS += nettest_client.c HOST_SRCS += nettest_client.c
else else
HOST_SRCS += nettest_server.c HOST_SRCS += nettest_server.c
endif endif
HOST_OBJS = $(HOST_SRCS:.c=.o) HOSTOBJEXT ?= .hobj
HOST_BIN = host HOST_OBJS = $(HOST_SRCS:.c=$(HOSTOBJEXT))
HOST_BIN = host
ROOTDEPPATH = --dep-path . ROOTDEPPATH = --dep-path .
# NET test built-in application info # NET test built-in application info
APPNAME = nettest APPNAME = nettest
PRIORITY = SCHED_PRIORITY_DEFAULT PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = 2048 STACKSIZE = 2048
# Common build # Common build
VPATH = VPATH =
all: .built $(HOST_BIN) all: .built $(HOST_BIN)
.PHONY: clean depend distclean .PHONY: clean depend distclean
$(TARG_AOBJS): %$(OBJEXT): %.S $(TARG_AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@) $(call ASSEMBLE, $<, $@)
@ -104,7 +104,7 @@ $(TARG_AOBJS): %$(OBJEXT): %.S
$(TARG_COBJS): %$(OBJEXT): %.c $(TARG_COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@) $(call COMPILE, $<, $@)
$(HOST_OBJS): %.o: %.c $(HOST_OBJS): %$(HOSTOBJEXT): %.c
@echo "CC: $<" @echo "CC: $<"
@$(HOSTCC) -c $(HOSTCFLAGS) $< -o $@ @$(HOSTCC) -c $(HOSTCFLAGS) $< -o $@
@ -113,7 +113,7 @@ $(HOST_BIN): $(HOST_OBJS)
@$(HOSTCC) $(HOSTLDFLAGS) $(HOST_OBJS) -o $@ @$(HOSTCC) $(HOSTLDFLAGS) $(HOST_OBJS) -o $@
.built: $(TARG_OBJS) .built: $(TARG_OBJS)
$(call ARCHIVE, $(BIN), $(TARG_OBJS)) $(call ARCHIVE, $(TARG_BIN), $(TARG_OBJS))
@touch .built @touch .built
ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) ifeq ($(CONFIG_NSH_BUILTIN_APPS),y)
@ -132,6 +132,7 @@ endif
depend: .depend depend: .depend
clean: clean:
$(call DELFILE, *$(HOSTOBJEXT))
$(call DELFILE, $(HOST_BIN)) $(call DELFILE, $(HOST_BIN))
$(call DELFILE, .built) $(call DELFILE, .built)
$(call CLEAN) $(call CLEAN)