-
Notifications
You must be signed in to change notification settings - Fork 128
/
Makefile
146 lines (120 loc) · 2.5 KB
/
Makefile
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
CC = gcc
RM = rm -f
STRIP = strip
CFLAGS = -O3 -W -Wall
TOOLCHAIN = /var/toolchain/sys30
COMM = pel.o aes.o sha1.o
TSH = tsh
TSHD = tshd
VERSION=tsh-0.7
CLIENT_OBJ=pel.c aes.c sha1.c tsh.c
SERVER_OBJ=pel.c aes.c sha1.c tshd.c
DISTFILES= \
sha1.h \
README \
ChangeLog\
pel.h \
Makefile \
aes.h\
tsh.h\
$(CLIENT_OBJ) $(SERVER_OBJ)
all:
@echo
@echo "Please specify one of these targets:"
@echo
@echo " make linux"
@echo " make linux_x64"
@echo " make freebsd"
@echo " make openbsd"
@echo " make netbsd"
@echo " make cygwin"
@echo " make sunos"
@echo " make irix"
@echo " make hpux"
@echo " make osf"
@echo " make iphone"
@echo " make darwin"
@echo
make `uname | tr A-Z a-z`
osx: darwin
darwin:
$(MAKE) \
CC="clang" \
LDFLAGS="$(LDFLAGS) -lutil" \
DEFS="$(DEFS) -DOPENBSD" \
$(TSH) $(TSHD)
iphone:
$(MAKE) \
CFLAGS="$(CFLAGS) -I$(TOOLCHAIN)/usr/include" \
LDFLAGS="$(LDFLAGS) -L$(TOOLCHAIN)/usr/lib -lutil" \
DEFS="$(DEFS) -DOPENBSD" \
$(TSH) $(TSHD)
ldid -S $(TSH)
ldid -S $(TSHD)
linux:
gcc -O -W -Wall -o tsh $(CLIENT_OBJ)
gcc -O -W -Wall -o tshd $(SERVER_OBJ) -lutil -DLINUX
strip tsh tshd
linux_x64:
$(MAKE) \
LDFLAGS="$(LDFLAGS) -Xlinker --no-as-needed -lutil" \
DEFS="$(DEFS) -DLINUX" \
$(TSH) $(TSHD)
openbsd:
$(MAKE) \
LDFLAGS="$(LDFLAGS) -lutil" \
DEFS="$(DEFS) -DOPENBSD" \
$(TSH) $(TSHD)
freebsd:
$(MAKE) \
LDFLAGS="$(LDFLAGS) -lutil" \
DEFS="$(DEFS) -DFREEBSD" \
$(TSH) $(TSHD)
netbsd: openbsd
sunos:
$(MAKE) \
LDFLAGS="$(LDFLAGS) -lsocket -lnsl" \
DEFS="$(DEFS) -DSUNOS" \
$(TSH) $(TSHD)
cygwin:
$(MAKE) \
DEFS="$(DEFS) -DCYGWIN" \
$(TSH) $(TSHD)
irix:
$(MAKE) \
CC="cc" \
CFLAGS="-O" \
DEFS="$(DEFS) -DIRIX" \
$(TSH) $(TSHD)
hpux:
$(MAKE) \
CC="cc" \
CFLAGS="-O" \
DEFS="$(DEFS) -DHPUX" \
$(TSH) $(TSHD)
osf:
$(MAKE) \
CC="cc" \
CFLAGS="-O" \
DEFS="$(DEFS) -DOSF" \
$(TSH) $(TSHD)
$(TSH): $(COMM) tsh.o
$(CC) ${LDFLAGS} -o $(TSH) $(COMM) tsh.o
$(STRIP) $(TSH)
$(TSHD): $(COMM) tshd.o
$(CC) ${LDFLAGS} -o $(TSHD) $(COMM) tshd.o
$(STRIP) $(TSHD)
aes.o: aes.h
pel.o: aes.h pel.h sha1.h
sha1.o: sha1.h
tsh.o: pel.h tsh.h
tshd.o: pel.h tsh.h
.c.o:
$(CC) ${CFLAGS} ${DEFS} -c $*.c
clean:
$(RM) $(TSH) $(TSHD) *.o core
dist:
mkdir $(VERSION)
cp $(DISTFILES) $(VERSION)
tar -czf $(VERSION).tar.gz $(VERSION)
rm -r $(VERSION)