2013-07-16 01:50:17 +02:00
|
|
|
############################################################################
|
|
|
|
# apps/system/zmodem/Makefile.host
|
|
|
|
#
|
|
|
|
# Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
|
|
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in
|
|
|
|
# the documentation and/or other materials provided with the
|
|
|
|
# distribution.
|
|
|
|
# 3. Neither the name NuttX nor the names of its contributors may be
|
|
|
|
# used to endorse or promote products derived from this software
|
|
|
|
# without specific prior written permission.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
# POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
#
|
|
|
|
############################################################################
|
2013-07-16 16:26:59 +02:00
|
|
|
|
|
|
|
############################################################################
|
|
|
|
# USAGE:
|
|
|
|
#
|
|
|
|
# 1. TOPDIR and APPDIR must be defined on the make command line: TOPDIR
|
|
|
|
# is the full path to the nuttx/ directory; APPDIR is the full path to
|
|
|
|
# the apps/ directory. For example:
|
|
|
|
#
|
|
|
|
# make -f Makefile.host TOPDIR=/home/me/projects/nuttx
|
|
|
|
# APPDIR=/home/me/projects/apps
|
|
|
|
#
|
2019-12-31 03:06:43 +01:00
|
|
|
# 2. Add CONFIG_DEBUG_FEATURES=y to the make command line to enable debug output
|
2013-07-16 16:26:59 +02:00
|
|
|
# 3. Make sure to clean old target .o files before making new host .o
|
|
|
|
# files.
|
|
|
|
#
|
|
|
|
############################################################################
|
2013-07-16 01:50:17 +02:00
|
|
|
|
2019-10-15 03:25:48 +02:00
|
|
|
-include $(TOPDIR)/Make.defs
|
2013-07-16 01:50:17 +02:00
|
|
|
include $(APPDIR)/Make.defs
|
|
|
|
|
|
|
|
NUTTXINC = $(TOPDIR)/include
|
|
|
|
APPSINC = $(APPDIR)/include
|
|
|
|
|
|
|
|
ZMODEM = $(APPDIR)/system/zmodem
|
|
|
|
HOSTDIR = $(ZMODEM)/host
|
|
|
|
HOSTAPPS = $(ZMODEM)/host/apps
|
|
|
|
|
2018-05-27 02:53:49 +02:00
|
|
|
HOSTCFLAGS += -isystem $(HOSTDIR) -I $(ZMODEM) -I $(HOSTAPPS)
|
2013-07-16 01:50:17 +02:00
|
|
|
HOSTCFLAGS += -Dsz_main=main -Drz_main=main
|
2016-06-11 22:13:39 +02:00
|
|
|
ifeq ($(CONFIG_DEBUG_FEATURES),y)
|
2019-12-31 03:06:43 +01:00
|
|
|
HOSTCFLAGS += -DCONFIG_DEBUG_ZMODEM=1
|
2013-07-16 01:50:17 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Zmodem sz and rz commands
|
|
|
|
|
|
|
|
SZSRCS = sz_main.c zm_send.c
|
|
|
|
RZSRCS = rz_main.c zm_receive.c
|
2019-12-31 03:06:43 +01:00
|
|
|
CMNSRCS = zm_state.c zm_proto.c zm_watchdog.c zm_utils.c
|
2013-07-16 01:50:17 +02:00
|
|
|
CMNSRCS += crc16.c crc32.c
|
|
|
|
SRCS = $(SZSRCS) $(RZSRCS) $(CMNSRCS)
|
|
|
|
|
|
|
|
SZOBJS = $(SZSRCS:.c=$(OBJEXT))
|
|
|
|
RZOBJS = $(RZSRCS:.c=$(OBJEXT))
|
|
|
|
CMNOBJS = $(CMNSRCS:.c=$(OBJEXT))
|
|
|
|
OBJS = $(SRCS:.c=$(OBJEXT))
|
|
|
|
|
|
|
|
RZBIN = rz$(EXEEXT)
|
|
|
|
SZBIN = sz$(EXEEXT)
|
|
|
|
|
|
|
|
VPATH = host
|
|
|
|
|
|
|
|
all: $(RZBIN) $(SZBIN)
|
|
|
|
.PHONY: clean
|
|
|
|
|
|
|
|
$(OBJS): %$(OBJEXT): %.c
|
|
|
|
$(Q) $(HOSTCC) -c $(HOSTCFLAGS) -o $@ $<
|
|
|
|
|
2018-05-27 02:53:49 +02:00
|
|
|
$(HOSTAPPS)/system:
|
|
|
|
$(Q) mkdir $(HOSTAPPS)/system
|
2013-07-16 01:50:17 +02:00
|
|
|
|
2018-05-27 02:53:49 +02:00
|
|
|
$(HOSTAPPS)/system/zmodem.h: $(HOSTAPPS)/system $(APPSINC)/system/zmodem.h
|
|
|
|
$(Q) cp $(APPSINC)/system/zmodem.h $(HOSTAPPS)/system/zmodem.h
|
|
|
|
|
|
|
|
$(RZBIN): $(HOSTAPPS)/system/zmodem.h $(RZOBJS) $(CMNOBJS)
|
2013-07-16 19:23:35 +02:00
|
|
|
$(Q) $(HOSTCC) $(HOSTCFLAGS) -o $@ $(RZOBJS) $(CMNOBJS) -lrt
|
2013-07-16 01:50:17 +02:00
|
|
|
|
2018-05-27 02:53:49 +02:00
|
|
|
$(SZBIN): $(HOSTAPPS)/system/zmodem.h $(SZOBJS) $(CMNOBJS)
|
2013-07-16 19:23:35 +02:00
|
|
|
$(Q) $(HOSTCC) $(HOSTCFLAGS) -o $@ $(SZOBJS) $(CMNOBJS) -lrt
|
2013-07-16 01:50:17 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
ifneq ($(OBJEXT),)
|
|
|
|
rm -f *$(OBJEXT)
|
|
|
|
endif
|
|
|
|
rm -f $(RZBIN) $(SZBIN)
|
2018-05-27 02:53:49 +02:00
|
|
|
rm -rf $(HOSTAPPS)/system
|