Makefile.am 4.96 KB
Newer Older
1 2 3 4 5 6
# Process this file with automake to produce Makefile.in

SUBDIRS = argp rsync nettle scm sftp spki . testsuite

include .dist_classes
include .dist_headers
7 8

BUILT_SOURCES = environ.h
9

10 11
# Kludge needed for finding the nettle/nettle-types.h file in the build tree
AM_CPPFLAGS = -I./nettle
12

13 14
SCHEME = $(SCHEME_PROGRAM) -l $(srcdir)/scm/$(SCHEME_NAME)-compat.scm

15
EXTRA_PROGRAMS = lsh-krb-checkpw lsh-pam-checkpw srp-gen
16

17
bin_PROGRAMS = lsh lshg lsh-keygen lsh-writekey lsh-decrypt-key \
18
	       lsh-decode-key lsh-export-key lsh-make-seed \
19
	       @SRP_PROGRAM@
20

21
sbin_PROGRAMS = lshd lsh-execuv @KRB_PROGRAM@ @PAM_PROGRAM@
22
bin_SCRIPTS = lsh-authorize ssh-conv lsh-upgrade lsh-upgrade-key lcp
Niels Möller's avatar
Niels Möller committed
23
noinst_LIBRARIES = liblsh.a
Niels Möller's avatar
Niels Möller committed
24 25 26 27

# Don't use BUILT_SOURCES, as all these files are #included, and can't be
# compiled or dependency checked independently.

Niels Möller's avatar
Niels Möller committed
28
generated_sources = atoms_defines.h atoms_gperf.c atoms_table.c \
29
	packet_types.h
Niels Möller's avatar
Niels Möller committed
30

Niels Möller's avatar
Niels Möller committed
31 32
.PHONY: bootstrap

33
# Not all potential .x files can be generated
34
bootstrap: $(generated_sources) $(dist_classes)
35
	(cd spki && $(MAKE) bootstrap)
Niels Möller's avatar
Niels Möller committed
36

37
liblsh_a_SOURCES = abstract_io.c abstract_crypto.c \
38
	algorithms.c alist.c atoms.c \
39
	channel.c channel_commands.c channel_forward.c \
40
	charset.c \
41
	client.c client_escape.c client_keyexchange.c \
42
	client_pty.c client_session.c client_userauth.c client_x11.c \
43 44
	combinators.c command.c compress.c \
	parse_config.c connection.c connection_commands.c \
45
	crypto.c \
46
	daemon.c \
Niels Möller's avatar
Niels Möller committed
47
	debug.c dh_exchange.c \
48
	dsa.c \
49
	exception.c \
50 51
	format.c gc.c \
	gateway.c gateway_channel.c gateway_commands.c \
52
	handshake.c \
Niels Möller's avatar
Niels Möller committed
53
	interact.c io.c io_commands.c \
54
	keyexchange.c \
55 56
	list.c lookup_verifier.c \
	lock_file.c \
57
	lsh_string.c parse.c \
58
	pkcs5.c \
59
	publickey_crypto.c queue.c \
Niels Möller's avatar
Niels Möller committed
60
	randomness.c \
61
	read_data.c read_file.c read_line.c read_packet.c \
62
	reaper.c resource.c \
63
	rsa.c \
64 65
	server.c server_authorization.c server_keyexchange.c \
	server_password.c server_publickey.c \
Niels Möller's avatar
Niels Möller committed
66
	server_pty.c server_session.c server_userauth.c \
Niels Möller's avatar
Niels Möller committed
67
	server_x11.c sexp.c socks.c \
68
	spki.c srp_exchange.c \
69 70
	string_buffer.c suspend.c \
	tcpforward.c tcpforward_commands.c \
Niels Möller's avatar
Niels Möller committed
71
	translate_signal.c tty.c \
72
	unix_interact.c unix_process.c unix_random.c unix_user.c \
73
	userauth.c \
74 75
	werror.c write_buffer.c write_packet.c \
	xalloc.c xauth.c zlib.c
Niels Möller's avatar
Niels Möller committed
76

77 78
liblsh_a_LIBADD = @LIBOBJS@

79 80 81 82
# config_parse.c: config_parse.y
# 	bison $< -o $@T
# 	test -s $@T && mv -f $@T $@

83
# FIXME: Won't work if the filename contains `,', `\', `"' or newline.
84 85
# NOTE: This rule is used by non-maintainer builds, so avoid using
# $< and $@ which are only available with GNU make.
86 87 88 89 90
environ.h: environ.h.in Makefile
	(echo '/* Automatically generated from environ.h.in, by make. */' ; \
	sed -e 's,@''prefix@,$(prefix),' \
	    -e 's,@''bindir@,$(bindir),' \
	    -e 's,@''sbindir@,$(sbindir),' \
Niels Möller's avatar
Niels Möller committed
91
	    -e 's,@''libexecdir@,$(libexecdir),' \
92 93 94
	    -e 's,@''sysconfdir@,$(sysconfdir),' \
	  < $(srcdir)/environ.h.in) >environ.hT
	test -s environ.hT && mv -f environ.hT environ.h
95

96
atoms_defines.h: atoms.in process_atoms
97
	$(srcdir)/process_atoms header <$< >$@T
Niels Möller's avatar
Niels Möller committed
98
	test -s $@T && mv -f $@T $@
Niels Möller's avatar
Niels Möller committed
99

Niels Möller's avatar
Niels Möller committed
100
# With the next version of gperf, add -F ", 0"
101
GPERF_FLAGS = -LANSI-C -t -c -C -l -k1,3,6,10,21,$$ -N gperf_atom 
102
atoms_gperf.c: atoms.in process_atoms
103
	$(srcdir)/process_atoms gperf <$< \
104
             | gperf $(GPERF_FLAGS) | sed 's/{""}/{"", 0}/g' >$@T 
Niels Möller's avatar
Niels Möller committed
105
	test -s $@T && mv -f $@T $@
Niels Möller's avatar
Niels Möller committed
106

107
atoms_table.c: atoms.in process_atoms
108
	$(srcdir)/process_atoms table <$< >$@T
Niels Möller's avatar
Niels Möller committed
109
	test -s $@T && mv -f $@T $@
Niels Möller's avatar
Niels Möller committed
110

111
packet_types.h: ssh.h invert-defs
112
	$(srcdir)/invert-defs <$< >$@T
Niels Möller's avatar
Niels Möller committed
113
	test -s $@T && mv -f $@T $@
114

115 116
lsh_krb_checkpw_LDADD=@KRB_LIBS@

117 118
lsh_execuv_LDADD=

Niels Möller's avatar
Niels Möller committed
119
LDADD = liblsh.a spki/libspki.a nettle/libnettle.a @LIBARGP@
120

121 122 123 124 125 126 127 128
# To avoid having to link lshg with nettle, link with dummy.o.

# FIXME: We still link with gmp and zlib, to avoid that we'd need to
# remove them from LIBS. The only libraries really needed for lshg is
# liboop and perhaps libXau.

lshg_SOURCES = lshg.c dummy.c
lshg_LDADD = liblsh.a @LIBARGP@
129

130 131
class-map: $(srcdir)/make-class-map $(dist_classes)
	cat $(dist_classes) | grep '^CLASS:' \
132
	| sort | awk -f $(srcdir)/make-class-map > $@
133

134
# Is this rule needed?
Niels Möller's avatar
Niels Möller committed
135
# all-recursive check-recursive: config.h
136

137 138
EXTRA_DIST = lsh-authorize ssh-conv lcp \
	lsh-upgrade lsh-upgrade-key \
139
	atoms.in process_atoms \
140
	environ.h.in \
141
	invert-defs \
Niels Möller's avatar
Niels Möller committed
142
	$(generated_sources) \
143
	sexp_chars.in \
144
	jpoll.h jpoll.c \
145
	$(dist_headers) $(dist_classes)
Niels Möller's avatar
Niels Möller committed
146

147
CLEANFILES = *.hT *.cT *.xT
148
DISTCLEANFILES = environ.h
149
MAINTAINERCLEANFILES = $(dist_classes) $(DEP_FILES)
150

Niels Möller's avatar
Niels Möller committed
151 152
# Class files
# SUFFIXES = .xh .xc
153 154 155 156

.PHONY: gcov-list
gcov-list:
	for f in *.c; do gcov "$$f"; done
157
	grep -c '##' *.gcov | grep -v ':0$$' | sort -t : -k 2 -nr >gcov-list
158

159 160 161 162 163
.PHONY: depend
depend:
	rm -f $(DEP_FILES)
	make $(DEP_FILES)

Niels Möller's avatar
Niels Möller committed
164 165
# This is GNU make specific

166
%.x: % $(srcdir)/scm/gaba.scm $(srcdir)/scm/compiler.scm
167
	$(SCHEME) -e main -l $(srcdir)/scm/compiler.scm \
168
		  -s $(srcdir)/scm/gaba.scm <$< >$@T
Niels Möller's avatar
Niels Möller committed
169
	test -s $@T && mv -f $@T $@
Niels Möller's avatar
Niels Möller committed
170

171 172 173
ETAGS_ARGS = -r '/     (name[ \t]+\([a-zA-Z0-9_]+\)/\1/' \
             -r '/DEFINE[^(]*(\([a-zA-Z0-9_]+\)/\1/'