2017-09-23 19:02:21 +02:00
|
|
|
############################################################################
|
|
|
|
# apps/examples/flowc/Makefile
|
|
|
|
#
|
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
|
2017-09-23 19:02:21 +02:00
|
|
|
#
|
2021-06-07 17:31:08 +02:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2017-09-23 19:02:21 +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.
|
2017-09-23 19:02:21 +02:00
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
2020-05-20 06:35:03 +02:00
|
|
|
include $(APPDIR)/Make.defs
|
2017-09-23 19:02:21 +02:00
|
|
|
|
|
|
|
# FLOWC Test
|
|
|
|
|
|
|
|
# Target 1
|
|
|
|
|
2018-09-03 17:29:56 +02:00
|
|
|
ifeq ($(CONFIG_EXAMPLES_FLOWC_SENDER1),y)
|
|
|
|
CSRCS += flowc_sender.c
|
2017-09-23 19:02:21 +02:00
|
|
|
else
|
2018-09-03 17:29:56 +02:00
|
|
|
CSRCS += flowc_receiver.c
|
2017-09-23 19:02:21 +02:00
|
|
|
endif
|
2018-09-03 17:29:56 +02:00
|
|
|
MAINSRC += flowc_target1.c
|
2017-09-23 19:02:21 +02:00
|
|
|
|
2018-09-03 17:29:56 +02:00
|
|
|
PROGNAME = $(CONFIG_EXAMPLES_FLOWC_PROGNAME1)
|
|
|
|
PRIORITY = $(CONFIG_EXAMPLES_FLOWC_PRIORITY1)
|
|
|
|
STACKSIZE = $(CONFIG_EXAMPLES_FLOWC_STACKSIZE1)
|
2017-09-23 19:02:21 +02:00
|
|
|
|
|
|
|
# Target 2
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_EXAMPLES_FLOWC_TARGET2),y)
|
|
|
|
|
2018-09-03 17:29:56 +02:00
|
|
|
ifeq ($(CONFIG_EXAMPLES_FLOWC_SENDER1),y)
|
|
|
|
CSRCS += flowc_receiver.c
|
2017-09-23 19:02:21 +02:00
|
|
|
else
|
2018-09-03 17:29:56 +02:00
|
|
|
CSRCS += flowc_sender.c
|
2017-09-23 19:02:21 +02:00
|
|
|
endif
|
2018-09-03 17:29:56 +02:00
|
|
|
MAINSRC += flowc_target2.c
|
2017-09-23 19:02:21 +02:00
|
|
|
|
2018-09-03 17:29:56 +02:00
|
|
|
PROGNAME += $(CONFIG_EXAMPLES_FLOWC_PROGNAME2)
|
|
|
|
PRIORITY += $(CONFIG_EXAMPLES_FLOWC_PRIORITY2)
|
|
|
|
STACKSIZE += $(CONFIG_EXAMPLES_FLOWC_STACKSIZE2)
|
2017-09-23 19:02:21 +02:00
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Host
|
|
|
|
|
|
|
|
ifneq ($(CONFIG_EXAMPLES_FLOWC_TARGET2),y)
|
|
|
|
|
|
|
|
HOSTCFLAGS += -DEXAMPLES_FLOWC_HOST=1
|
|
|
|
HOSTOBJSEXT ?= hobj
|
|
|
|
|
|
|
|
HOST_SRCS = flowc_host.c
|
2018-09-03 17:29:56 +02:00
|
|
|
ifeq ($(CONFIG_EXAMPLES_FLOWC_SENDER1),y)
|
2017-09-23 19:02:21 +02:00
|
|
|
HOST_SRCS += flowc_receiver.c
|
2020-05-19 15:56:39 +02:00
|
|
|
HOST_BIN = receiver$(HOSTEXEEXT)
|
2017-09-23 19:02:21 +02:00
|
|
|
else
|
|
|
|
HOST_SRCS += flowc_sender.c
|
2020-05-19 15:56:39 +02:00
|
|
|
HOST_BIN = sender$(HOSTEXEEXT)
|
2017-09-23 19:02:21 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
HOST_OBJS = $(HOST_SRCS:.c=.$(HOSTOBJSEXT))
|
|
|
|
$(HOST_OBJS): %.$(HOSTOBJSEXT): %.c
|
|
|
|
@echo "CC: $<"
|
|
|
|
$(Q) $(HOSTCC) -c $(HOSTCFLAGS) $< -o $@
|
|
|
|
|
2019-10-19 00:47:57 +02:00
|
|
|
endif
|
|
|
|
|
2017-09-23 19:02:21 +02:00
|
|
|
config.h: $(TOPDIR)/include/nuttx/config.h
|
|
|
|
@echo "CP: $<"
|
|
|
|
$(Q) cp $< $@
|
|
|
|
|
2019-10-19 00:47:57 +02:00
|
|
|
ifneq ($(CONFIG_EXAMPLES_FLOWC_TARGET2),y)
|
|
|
|
|
2020-06-02 09:24:10 +02:00
|
|
|
$(HOST_OBJS): config.h
|
|
|
|
|
|
|
|
$(HOST_BIN): $(HOST_OBJS)
|
2017-09-23 19:02:21 +02:00
|
|
|
$(Q) $(HOSTCC) $(HOSTLDFLAGS) $(HOST_OBJS) -o $@
|
|
|
|
|
2019-10-19 00:47:57 +02:00
|
|
|
endif
|
|
|
|
|
2018-09-03 17:29:56 +02:00
|
|
|
context:: config.h $(HOST_BIN)
|
2017-09-23 19:02:21 +02:00
|
|
|
|
2018-09-03 17:29:56 +02:00
|
|
|
clean::
|
2019-10-19 00:47:57 +02:00
|
|
|
ifneq ($(CONFIG_EXAMPLES_FLOWC_TARGET2),y)
|
2017-09-23 19:02:21 +02:00
|
|
|
$(call DELFILE, $(HOST_BIN))
|
|
|
|
$(call DELFILE, *.$(HOSTOBJSEXT))
|
|
|
|
$(call DELFILE, *.dSYM)
|
2019-10-06 14:14:39 +02:00
|
|
|
endif
|
2019-10-19 00:47:57 +02:00
|
|
|
$(call DELFILE, config.h)
|
2019-10-06 14:14:39 +02:00
|
|
|
|
|
|
|
MODULE = $(CONFIG_EXAMPLES_FLOWC)
|
2017-09-23 19:02:21 +02:00
|
|
|
|
2018-09-03 17:29:56 +02:00
|
|
|
include $(APPDIR)/Application.mk
|