#
# Copyright (c) y2k Micha Moskal <malekith@topnet.pl>
#
# This file is part of cryptoFTP - cftp protocol implementation.
# CryptoFTP is free software. You can redistribute it and/or modify it under
# the terms of the GNU General Public License (see COPYING.GPL for details).
#
# $Id: Makefile,v 1.1.1.1 2000/04/22 10:15:53 malekith Exp $
#

include ../Make.common

cftp_lib := ../libcftp.a

CPPFLAGS += -I../libcftp/h -I..
LDLIBS += ${LGMP}

ifeq (${INTERNAL_GMP},yes)
CPPFLAGS += -I../libcftp/gmp
endif

ifeq (${INTERNAL_ZLIB},yes)
CPPFLAGS += -I../libcftp/zlib
endif

obj_dir     := ../.client_obj
client_name := ../cftp

client_src  := client.c getpass.c parser.c transfer.c
client_obj  := $(addprefix ${obj_dir}/, ${client_src:.c=.o}) ${cftp_lib}


.PHONY: clean all

all: ${obj_dir} ${client_name}

${obj_dir}:
	[ -d ${obj_dir} ] || mkdir ${obj_dir}

${client_name}: ${client_obj}
	${CC} ${LDFLAGS} -o $@ $^ ${LZLIB} ${LDLIBS} ${LREADLINE}

clean:
	rm -rf ${obj_dir} core ${client_name}

${cftp_lib}:
	make -C ../libcftp

${obj_dir}/%.o: %.c
	${CC} ${CPPFLAGS} ${CFLAGS} -c $< -o $@
