2018-07-06 00:03:54 +02:00
|
|
|
############################################################################
|
2022-03-08 23:05:12 +01:00
|
|
|
# apps/examples/tcpblaster/Makefile
|
2018-07-06 00:03:54 +02:00
|
|
|
#
|
2021-06-07 17:31:08 +02:00
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
|
|
# this work for additional information regarding copyright ownership. The
|
|
|
|
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
# "License"); you may not use this file except in compliance with the
|
|
|
|
# License. You may obtain a copy of the License at
|
2018-07-06 00:03:54 +02:00
|
|
|
#
|
2021-06-07 17:31:08 +02:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2018-07-06 00:03:54 +02:00
|
|
|
#
|
2021-06-07 17:31:08 +02:00
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
# License for the specific language governing permissions and limitations
|
|
|
|
# under the License.
|
2018-07-06 00:03:54 +02:00
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
2020-05-20 06:35:03 +02:00
|
|
|
include $(APPDIR)/Make.defs
|
2018-07-06 00:03:54 +02:00
|
|
|
|
|
|
|
# Basic TCP networking test
|
|
|
|
|
2018-09-03 17:29:56 +02:00
|
|
|
CSRCS = tcpblaster_cmdline.c
|
2018-07-06 00:03:54 +02:00
|
|
|
ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_INIT),y)
|
2018-09-03 17:29:56 +02:00
|
|
|
CSRCS += tcpblaster_netinit.c
|
2018-07-06 00:03:54 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Target 1 Files
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_LOOPBACK),y)
|
2018-09-03 17:29:56 +02:00
|
|
|
CSRCS += tcpblaster_server.c tcpblaster_client.c
|
2018-07-06 00:03:54 +02:00
|
|
|
else ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_SERVER),y)
|
2018-09-03 17:29:56 +02:00
|
|
|
CSRCS += tcpblaster_server.c
|
2018-07-06 00:03:54 +02:00
|
|
|
else
|
2018-09-03 17:29:56 +02:00
|
|
|
CSRCS += tcpblaster_client.c
|
2018-07-06 00:03:54 +02:00
|
|
|
endif
|
2018-09-03 17:29:56 +02:00
|
|
|
MAINSRC = tcpblaster_target1.c
|
2018-07-06 00:03:54 +02:00
|
|
|
|
|
|
|
# Target 1 Application Info
|
|
|
|
|
2018-09-03 17:29:56 +02:00
|
|
|
PROGNAME = $(CONFIG_EXAMPLES_TCPBLASTER_PROGNAME1)
|
|
|
|
PRIORITY = $(CONFIG_EXAMPLES_TCPBLASTER_PRIORITY1)
|
|
|
|
STACKSIZE = $(CONFIG_EXAMPLES_TCPBLASTER_STACKSIZE1)
|
2018-07-06 00:03:54 +02:00
|
|
|
|
|
|
|
# Target 2
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_TARGET2),y)
|
|
|
|
|
2018-08-21 17:38:17 +02:00
|
|
|
ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_SERVER),y)
|
2018-09-03 17:29:56 +02:00
|
|
|
CSRCS += tcpblaster_client.c
|
2018-07-06 00:03:54 +02:00
|
|
|
else
|
2018-09-03 17:29:56 +02:00
|
|
|
CSRCS += tcpblaster_server.c
|
2018-07-06 00:03:54 +02:00
|
|
|
endif
|
2018-09-03 17:29:56 +02:00
|
|
|
MAINSRC += tcpblaster_target2.c
|
2018-07-06 00:03:54 +02:00
|
|
|
|
|
|
|
# Target 2 Application Info
|
|
|
|
|
2018-09-03 17:29:56 +02:00
|
|
|
PROGNAME += $(CONFIG_EXAMPLES_TCPBLASTER_PROGNAME2)
|
|
|
|
PRIORITY += $(CONFIG_EXAMPLES_TCPBLASTER_PRIORITY2)
|
|
|
|
STACKSIZE += $(CONFIG_EXAMPLES_TCPBLASTER_STACKSIZE2)
|
2018-07-06 00:03:54 +02:00
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Host
|
|
|
|
|
|
|
|
ifneq ($(CONFIG_EXAMPLES_TCPBLASTER_TARGET2),y)
|
|
|
|
ifneq ($(CONFIG_EXAMPLES_TCPBLASTER_LOOPBACK),y)
|
|
|
|
|
|
|
|
HOSTCFLAGS += -DTCPBLASTER_HOST=1
|
|
|
|
ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_SERVER),y)
|
2019-12-09 00:11:07 +01:00
|
|
|
HOSTCFLAGS += -DCONFIG_EXAMPLES_TCPBLASTER_SERVER=1 -DCONFIG_EXAMPLES_TCPBLASTER_SERVERIP=$(CONFIG_EXAMPLES_TCPBLASTER_SERVERIP)
|
2018-07-06 00:03:54 +02:00
|
|
|
endif
|
|
|
|
|
2019-12-09 00:11:07 +01:00
|
|
|
HOST_SRCS = tcpblaster_host.c tcpblaster_cmdline.c
|
2018-07-06 00:03:54 +02:00
|
|
|
ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_SERVER),y)
|
|
|
|
HOST_SRCS += tcpblaster_client.c
|
2020-05-19 15:56:39 +02:00
|
|
|
HOST_BIN = tcpclient$(HOSTEXEEXT)
|
2018-07-06 00:03:54 +02:00
|
|
|
else
|
|
|
|
HOST_SRCS += tcpblaster_server.c
|
2020-05-19 15:56:39 +02:00
|
|
|
HOST_BIN = tcpserver$(HOSTEXEEXT)
|
2018-07-06 00:03:54 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
HOSTOBJEXT ?= hobj
|
|
|
|
HOST_OBJS = $(HOST_SRCS:.c=.$(HOSTOBJEXT))
|
|
|
|
|
|
|
|
# Common build
|
|
|
|
|
|
|
|
$(HOST_OBJS): %.$(HOSTOBJEXT): %.c
|
|
|
|
@echo "CC: $<"
|
|
|
|
$(Q) $(HOSTCC) -c $(HOSTCFLAGS) $< -o $@
|
|
|
|
|
2019-10-19 00:47:57 +02:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2018-07-06 00:03:54 +02:00
|
|
|
config.h: $(TOPDIR)/include/nuttx/config.h
|
|
|
|
@echo "CP: $<"
|
|
|
|
$(Q) cp $< $@
|
|
|
|
|
2019-10-19 00:47:57 +02:00
|
|
|
ifneq ($(CONFIG_EXAMPLES_TCPBLASTER_TARGET2),y)
|
|
|
|
ifneq ($(CONFIG_EXAMPLES_TCPBLASTER_LOOPBACK),y)
|
|
|
|
|
2020-06-02 09:24:10 +02:00
|
|
|
$(HOST_OBJS): config.h
|
|
|
|
|
|
|
|
$(HOST_BIN): $(HOST_OBJS)
|
2018-07-06 00:03:54 +02:00
|
|
|
@echo "LD: $@"
|
|
|
|
$(Q) $(HOSTCC) $(HOSTLDFLAGS) $(HOST_OBJS) -o $@
|
|
|
|
|
2019-10-19 00:47:57 +02:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2018-09-03 17:29:56 +02:00
|
|
|
context:: config.h $(HOST_BIN)
|
2018-07-06 00:03:54 +02:00
|
|
|
|
2018-09-03 17:29:56 +02:00
|
|
|
clean::
|
2019-10-19 00:47:57 +02:00
|
|
|
ifneq ($(CONFIG_EXAMPLES_TCPBLASTER_TARGET2),y)
|
|
|
|
ifneq ($(CONFIG_EXAMPLES_TCPBLASTER_LOOPBACK),y)
|
2018-07-06 00:03:54 +02:00
|
|
|
$(call DELFILE, *.$(HOSTOBJEXT))
|
|
|
|
$(call DELFILE, $(HOST_BIN))
|
|
|
|
$(call DELFILE, *.dSYM)
|
2019-10-06 14:14:39 +02:00
|
|
|
endif
|
|
|
|
endif
|
2019-10-19 00:47:57 +02:00
|
|
|
$(call DELFILE, config.h)
|
2019-10-06 14:14:39 +02:00
|
|
|
|
|
|
|
MODULE = $(CONFIG_EXAMPLES_TCPBLASTER)
|
2018-07-06 00:03:54 +02:00
|
|
|
|
2018-09-03 17:29:56 +02:00
|
|
|
include $(APPDIR)/Application.mk
|