Makefile.in 2.87 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
LIBS = @LIBS@

18
CFLAGS = -g -Wall -Wmissing-prototypes \
19
         -Wmissing-declarations -Werror -O # -O2 -fomit-frame-pointer
Niels Möller's avatar
Niels Möller committed
20
21
LDFLAGS = @LDFLAGS@

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

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. ####

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

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

46
47
CLIENT_SRCS = lsh.c client.c client_keyexchange.c \
	client_password.c client_userauth.c
48
SERVER_SRCS = lshd.c reaper.c server.c server_keyexchange.c\
49
	server_password.c server_userauth.c
Niels Möller's avatar
Niels Möller committed
50

Niels Möller's avatar
Niels Möller committed
51
52
53
54
55
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
56
OBJS = $(SRCS:.c=.o)
Niels Möller's avatar
Niels Möller committed
57

58
all: algorithms lsh lshd
Niels Möller's avatar
Niels Möller committed
59

Niels Möller's avatar
Niels Möller committed
60
61
62
63
64
.PHONY: all

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

Niels Möller's avatar
Niels Möller committed
65
66
67
lsh: $(CLIENT_OBJS) $(COMMON_OBJS)

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

Niels Möller's avatar
Niels Möller committed
69
70
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
71

Niels Möller's avatar
Niels Möller committed
72
atoms_gperf.c: atoms.in process_atoms Makefile
Niels Möller's avatar
Niels Möller committed
73
	bash process_atoms gperf <atoms.in \
74
             | gperf -t -c -l -k1,7,$$ -N gperf_atom >atoms_gperf.c
Niels Möller's avatar
Niels Möller committed
75
76
77

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
78

79
80
81
82
83
84
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
85
86
87
88
89
90
91
clean:
	rm -f *.o 

very_clean: clean
	rm *.d

%.d: %.c
Niels Möller's avatar
Niels Möller committed
92
	$(SHELL) -ec '$(CC) -MM -MG $(CPPFLAGS) $(DEFS) $< \
Niels Möller's avatar
Niels Möller committed
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
118
119
120
121
		| 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