include $(APPDIR)/Make.defs
CSRCS = tcpblaster_cmdline.c
ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_INIT),y)
CSRCS += tcpblaster_netinit.c
endif
ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_LOOPBACK),y)
CSRCS += tcpblaster_server.c tcpblaster_client.c
else ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_SERVER),y)
CSRCS += tcpblaster_server.c
else
CSRCS += tcpblaster_client.c
endif
MAINSRC = tcpblaster_target1.c
PROGNAME = $(CONFIG_EXAMPLES_TCPBLASTER_PROGNAME1)
PRIORITY = $(CONFIG_EXAMPLES_TCPBLASTER_PRIORITY1)
STACKSIZE = $(CONFIG_EXAMPLES_TCPBLASTER_STACKSIZE1)
ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_TARGET2),y)
ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_SERVER),y)
CSRCS += tcpblaster_client.c
else
CSRCS += tcpblaster_server.c
endif
MAINSRC += tcpblaster_target2.c
PROGNAME += $(CONFIG_EXAMPLES_TCPBLASTER_PROGNAME2)
PRIORITY += $(CONFIG_EXAMPLES_TCPBLASTER_PRIORITY2)
STACKSIZE += $(CONFIG_EXAMPLES_TCPBLASTER_STACKSIZE2)
endif
ifneq ($(CONFIG_EXAMPLES_TCPBLASTER_TARGET2),y)
ifneq ($(CONFIG_EXAMPLES_TCPBLASTER_LOOPBACK),y)
HOSTCFLAGS += -DTCPBLASTER_HOST=1
ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_SERVER),y)
HOSTCFLAGS += -DCONFIG_EXAMPLES_TCPBLASTER_SERVER=1 -DCONFIG_EXAMPLES_TCPBLASTER_SERVERIP=$(CONFIG_EXAMPLES_TCPBLASTER_SERVERIP)
endif
HOST_SRCS = tcpblaster_host.c tcpblaster_cmdline.c
ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_SERVER),y)
HOST_SRCS += tcpblaster_client.c
HOST_BIN = tcpclient$(HOSTEXEEXT)
else
HOST_SRCS += tcpblaster_server.c
HOST_BIN = tcpserver$(HOSTEXEEXT)
endif
HOSTOBJEXT ?= hobj
HOST_OBJS = $(HOST_SRCS:.c=.$(HOSTOBJEXT))
$(HOST_OBJS): %.$(HOSTOBJEXT): %.c
@echo "CC: $<"
$(Q) $(HOSTCC) -c $(HOSTCFLAGS) $< -o $@
endif
endif
config.h: $(TOPDIR)/include/nuttx/config.h
@echo "CP: $<"
$(Q) cp $< $@
ifneq ($(CONFIG_EXAMPLES_TCPBLASTER_TARGET2),y)
ifneq ($(CONFIG_EXAMPLES_TCPBLASTER_LOOPBACK),y)
$(HOST_OBJS): config.h
$(HOST_BIN): $(HOST_OBJS)
@echo "LD: $@"
$(Q) $(HOSTCC) $(HOSTLDFLAGS) $(HOST_OBJS) -o $@
endif
endif
context:: config.h $(HOST_BIN)
clean::
ifneq ($(CONFIG_EXAMPLES_TCPBLASTER_TARGET2),y)
ifneq ($(CONFIG_EXAMPLES_TCPBLASTER_LOOPBACK),y)
$(call DELFILE, *.$(HOSTOBJEXT))
$(call DELFILE, $(HOST_BIN))
$(call DELFILE, *.dSYM)
endif
endif
$(call DELFILE, config.h)
MODULE = $(CONFIG_EXAMPLES_TCPBLASTER)
include $(APPDIR)/Application.mk