Makefile.in 2.66 KB
Newer Older
Niels Möller's avatar
Niels Möller committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#### Start of system configuration section. ####

srcdir = @srcdir@
VPATH = $(srcdir)

CC = @CC@
@SET_MAKE@

# INSTALL = @INSTALL@
# INSTALL_PROGRAM = @INSTALL_PROGRAM@
# INSTALL_DATA = @INSTALL_DATA@
# MAKEINFO = makeinfo
# TEXI2DVI = texi2dvi

15
export DEFS = @DEFS@
Niels Möller's avatar
Niels Möller committed
16
17
18
LIBS = @LIBS@

CFLAGS = -g -Wall # -O2 -fomit-frame-pointer
Niels Möller's avatar
Niels Möller committed
19
20
LDFLAGS = @LDFLAGS@

21
CPPFLAGS = -DDEBUG_ALLOC -DLSH -I$(srcdir) -I$(srcdir)/include
Niels Möller's avatar
Niels Möller committed
22
23
24
25
26
27
28
29
30
31
32
33

prefix = @prefix@
exec_prefix = $(prefix)

bindir = $(exec_prefix)/bin
infodir = $(prefix)/info

# Prefix to be prepended to each installed program, normally empty or `g'.
binprefix = 

#### End of system configuration section. ####

34
35
LOADLIBES = $(LIBS) lib/algorithms.a

Niels Möller's avatar
Niels Möller committed
36
COMMON_SRCS = alist.c atoms.c bignum.c connection.c crypto.c \
Niels Möller's avatar
Niels Möller committed
37
38
	debug.c disconnect.c encrypt.c format.c getopt.c io.c keyexchange.c \
	packet_ignore.c pad.c parse.c publickey_crypto.c \
39
40
	randomness.c \
	read_data.c read_line.c read_packet.c \
Niels Möller's avatar
Niels Möller committed
41
	unpad.c \
Niels Möller's avatar
Niels Möller committed
42
	werror.c write_buffer.c xalloc.c
Niels Möller's avatar
Niels Möller committed
43

Niels Möller's avatar
Niels Möller committed
44
45
46
CLIENT_SRCS = lsh.c client.c client_keyexchange.c
SERVER_SRCS = lshd.c server.c server_keyexchange.c

Niels Möller's avatar
Niels Möller committed
47
48
49
50
51
SRCS = $(COMMON_SRCS) $(CLIENT_SRCS) $(SERVER_SRCS)

COMMON_OBJS = $(COMMON_SRCS:.c=.o)
CLIENT_OBJS = $(CLIENT_SRCS:.c=.o)
SERVER_OBJS = $(SERVER_SRCS:.c=.o)
Niels Möller's avatar
Niels Möller committed
52
OBJS = $(SRCS:.c=.o)
Niels Möller's avatar
Niels Möller committed
53

54
all: algorithms lsh lshd
Niels Möller's avatar
Niels Möller committed
55

Niels Möller's avatar
Niels Möller committed
56
57
58
59
60
.PHONY: all

.c.o:
	$(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) $<

Niels Möller's avatar
Niels Möller committed
61
62
63
lsh: $(CLIENT_OBJS) $(COMMON_OBJS)

lshd: $(SERVER_OBJS) $(COMMON_OBJS)
Niels Möller's avatar
Niels Möller committed
64

Niels Möller's avatar
Niels Möller committed
65
66
atoms_defines.h: atoms.in process_atoms
	bash process_atoms header <atoms.in >atoms_defines.h
Niels Möller's avatar
Niels Möller committed
67
68

atoms_gperf.c: atoms.in process_atoms
Niels Möller's avatar
Niels Möller committed
69
	bash process_atoms gperf <atoms.in \
70
             | gperf -t -c -k1,7,$$ -N gperf_atom >atoms_gperf.c
Niels Möller's avatar
Niels Möller committed
71
72
73

atoms_table.c: atoms.in process_atoms
	bash process_atoms table <atoms.in >atoms_table.c
Niels Möller's avatar
Niels Möller committed
74

75
76
77
78
79
80
algorithms:
	cd lib; \
        EXTRA_CPPFLAGS="-DLSH -I$(srcdir) -I$(srcdir)/include" \
	EXTRA_VPATH="$(srcdir):$(srcdir)/include" \
		$(MAKE) algorithms.a 

Niels Möller's avatar
Niels Möller committed
81
82
83
84
85
86
87
clean:
	rm -f *.o 

very_clean: clean
	rm *.d

%.d: %.c
Niels Möller's avatar
Niels Möller committed
88
	$(SHELL) -ec '$(CC) -MM -MG $(CPPFLAGS) $(DEFS) $< \
Niels Möller's avatar
Niels Möller committed
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
		| sed '\''s/\($*\)\.o:/\1\.o $@ : /g'\'' > $@'

include $(SRCS:.c=.d)

#### Remaking the Makefile and configure scripts. ####

#${srcdir}/configure: configure.in aclocal.m4
${srcdir}/configure: configure.in
	cd ${srcdir} && autoconf

# autoheader might not change config.h.in, so touch a stamp file.
${srcdir}/config.h.in: stamp-h.in

#${srcdir}/stamp-h.in: configure.in aclocal.m4 acconfig.h \
#    config.h.top config.h.bot

${srcdir}/stamp-h.in: configure.in 
	cd ${srcdir} && autoheader
	echo timestamp > ${srcdir}/stamp-h.in

config.h: stamp-h
stamp-h: config.h.in config.status
	./config.status

Makefile: Makefile.in config.status
	./config.status

config.status: configure
	./config.status --recheck