2013-07-16 01:50:17 +02:00
|
|
|
############################################################################
|
|
|
|
# apps/system/zmodem/Makefile.host
|
|
|
|
#
|
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
|
2013-07-16 01:50:17 +02:00
|
|
|
#
|
2021-06-07 17:31:08 +02:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2013-07-16 01:50:17 +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.
|
2013-07-16 01:50:17 +02:00
|
|
|
#
|
|
|
|
############################################################################
|
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
|
|
|
|
|
|
|
include $(APPDIR)/Make.defs
|
|
|
|
|
|
|
|
NUTTXINC = $(TOPDIR)/include
|
|
|
|
APPSINC = $(APPDIR)/include
|
|
|
|
|
|
|
|
ZMODEM = $(APPDIR)/system/zmodem
|
|
|
|
HOSTDIR = $(ZMODEM)/host
|
|
|
|
HOSTAPPS = $(ZMODEM)/host/apps
|
|
|
|
|
2020-06-02 15:02:47 +02:00
|
|
|
HOSTCFLAGS += -I $(HOSTDIR) -I $(HOSTAPPS)
|
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))
|
|
|
|
|
2020-05-19 15:56:39 +02:00
|
|
|
RZBIN = rz$(HOSTEXEEXT)
|
|
|
|
SZBIN = sz$(HOSTEXEEXT)
|
2013-07-16 01:50:17 +02:00
|
|
|
|
|
|
|
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
|