-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile.am
111 lines (89 loc) · 3.65 KB
/
Makefile.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# This file is part of the Green End SFTP Server.
# Copyright (C) 2007, 2011,14,16,18 Richard Kettlewell
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA
AM_CPPFLAGS=-DETCDIR=\"$(ETCDIR)\"
# Programs
noinst_PROGRAMS=sftpclient pwtest
noinst_SCRIPTS=run-tests
libexec_PROGRAMS=gesftpserver
noinst_LIBRARIES=libsftp.a
gesftpserver_SOURCES=sftpserver.c readwrite.c
gesftpserver_LDADD=libsftp.a
sftpclient_SOURCES=sftpclient.c readwrite.c
sftpclient_LDADD=libsftp.a $(LIBREADLINE)
libsftp_a_SOURCES=alloc.c alloc.h debug.c debug.h globals.h handle.c \
handle.h parse.c parse.h queue.c queue.h send.c send.h sftp.h \
sftpclient.h sftpcommon.h sftpserver.h status.c thread.h types.h \
users.c users.h utils.c utils.h v3.c xfns.c xfns.h stat.c charset.c \
charset.h serialize.h serialize.c v4.c realpath.c readlink.c v5.c v6.c \
stat.h getcwd.c globals.c dirname.c putword.h replaced.h \
sftpconf.c sftpconf.h
libsftp_a_LIBADD=$(LIBOBJS)
pwtest_SOURCES=pwtest.c
# Documentation
man_MANS=gesftpserver.8
gesftpserver.8: gesftpserver.8.in config.status
sed < ${srcdir}/gesftpserver.8.in > [email protected] \
-e "s,__libexecdir__,${libexecdir},g"
mv [email protected] $@
# Build and test
all: ${SEDOUTPUTS}
check: gesftpserver sftpclient pwtest aliases
rm -f *.gcda *.gcov
./pwtest
srcdir=${srcdir} ${PYTHON3} ${srcdir}/run-tests --directory tests $(TESTS)
srcdir=${srcdir} ${PYTHON3} ${srcdir}/run-tests --directory tests --no-reorder $(TESTS)
srcdir=${srcdir} ${PYTHON3} ${srcdir}/run-tests --directory tests --threads 1 $(TESTS)
srcdir=${srcdir} ${PYTHON3} ${srcdir}/run-tests --directory rotests --server ./gesftpserver-ro $(ROTESTS)
${GCOV} ${srcdir}/*.c | ${PYTHON3} ${srcdir}/format-gconv-report --html .
#${srcdir}/paramiko-test
check-valgrind: gesftpserver-valgrind sftpclient-valgrind pwtest aliases
rm -f ,valgrind*
srcdir=${srcdir} ${PYTHON3} ${srcdir}/run-tests --debug --directory tests --server ./gesftpserver-valgrind --client ./sftpclient-valgrind $(TESTS)
aliases: gesftpserver-ro gesftpserver-debug gesftpserver-ro-debug \
gesftpserver-valgrind
gesftpserver-ro:
rm -f $@
ln -s gesftpserver $@
gesftpserver-debug:
rm -f $@
ln -s gesftpserver $@
gesftpserver-ro-debug:
rm -f $@
ln -s gesftpserver $@
gesftpserver-valgrind: gesftpserver
echo "#! /bin/sh" > [email protected]
echo "set -e" >> [email protected]
echo "exec valgrind --leak-check=full -q --log-file=/dev/tty --num-callers=50 `pwd`/gesftpserver \"\$$@\"" >> [email protected]
chmod +x [email protected]
mv [email protected] $@
sftpclient-valgrind: sftpclient
echo "#! /bin/sh" > [email protected]
echo "set -e" >> [email protected]
echo "exec valgrind --leak-check=full -q --log-file=/dev/tty --num-callers=50 `pwd`/sftpclient \"\$$@\"" >> [email protected]
chmod +x [email protected]
mv [email protected] $@
# Cleaning
DISTCLEANFILES=${SEDOUTPUTS} gesftpserver.8
CLEANFILES=*.gcno *.gcda *.gcov gesftpserver-ro gesftpserver-debug gesftpserver-ro-debug gesftpserver-valgrind
# Distribution
EXTRA_DIST=gesftpserver.8.in testing.txt tests rotests README.md run-tests \
format-gconv-report getopt.c getopt1.c gnu-include/getopt.h CHANGES.md
%.s: %.c
$(COMPILE) -o $@ -S $<
version:
@echo $(VERSION)