-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile.rdb
205 lines (172 loc) · 5.82 KB
/
Makefile.rdb
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
REMOTE=$(shell git show-ref --hash origin/master | head -1)
FORKED=$(shell git merge-base $(REMOTE) HEAD)
PVER=$(shell git log --format=%d --decorate=short --simplify-by-decoration $(FORKED) | awk '/^..tag:/{gsub("[^0-9.]","",$$2);print $$2;exit;}')
MDIF=$(shell git show-branch $(PVER) $(FORKED) | grep '^ + ' | wc -l )
RDIF=$(shell git show-branch $(FORKED) HEAD | grep '^ + ' | wc -l )
CDATE=$(shell git log -1 --format='%h %ci' | awk '{print $$2;}')
FDATE=$(shell git log -1 --format='%h %ci' $(FORKED) | awk '{print $$2;}')
SOURCE_COMMIT=$(shell git describe --always)
BVER=$(shell echo $(PVER) | sed -e 's/\./,/' -e 's/$$/,'"$(MDIF),$(RDIF)"'/')
VER=$(PVER).$(MDIF) $(FDATE) +RdB-$(RDIF) $(CDATE)
SVER=$(PVER).$(MDIF)+RdB-$(RDIF)
J99=-j99
CNF=$(J99)
WINTGT=/tmp/putty
WINTOOLPATH32=i686-w64-mingw32-
WINTOOLPATH64=x86_64-w64-mingw32-
# The Cygwin makefile is a proper unix makefile, but the FLAGS to GCC
# are messed up. So I override the lot.
WINCFLAGS = -Wall -O2 -std=c90 -fstack-protector -D_WINDOWS -D_NO_OLDNAMES \
-DNO_MULTIMON -I.././ -I../charset/ -I../windows/
ifeq ($(wildcard version.h),)
# For version 0.63
WINCFLAGS += -DSECURITY_WIN32
endif
WINLDFLAGS = -static -fstack-protector -Wl,--nxcompat -Wl,--dynamicbase -s
WINCNF=$(CNF) CFLAGS="$(WINCFLAGS)" LDFLAGS="$(WINLDFLAGS)"
all: unix-all windows-all
flags:
@echo REMOTE=$(REMOTE)
@echo FORKED=$(FORKED)
@echo PVER=$(PVER)
@echo MDIF=$(MDIF)
@echo RDIF=$(RDIF)
@echo CDATE=$(CDATE)
@echo FDATE=$(FDATE)
@echo BVER=$(BVER)
@echo VER=$(VER)
@echo SVER=$(SVER)
@echo CNF=$(CNF)
complete: all doc-all icons-all
pterm: unix-pterm
putty: unix-putty windows-putty
# All cleanup
clean: unix/Makefile.gtk windows/Makefile.winx
make -C unix -f Makefile.gtk clean
make -C windows -f Makefile.winx clean
make -C doc clean
make -C icons clean
@-[ ! -d macosx ] || make -C macosx clean
@# Clean version.h, and remove the makefiles so it gets regenerated.
@-[ ! -f version.bak ] || mv -f version.bak version.h
@-rm -f unix/Makefile.gtk windows/Makefile.vc windows/Makefile.winx
doc-all:
make -C doc
# NB: make install in here changes files in other directories ... those files
# are generated. BUT mkfiles.pl *requires* them to exist.
icons-all:
make -C icons
# Unix (Linux) compile
unix-all: unix/Makefile.gtk
make $(CNF) -C unix -f Makefile.gtk
unix-putty: unix/Makefile.gtk
make $(CNF) -C unix -f Makefile.gtk putty
unix-pterm: unix/Makefile.gtk
make $(CNF) -C unix -f Makefile.gtk pterm
# WINDOWS Cross compile
windows-all: windows/Makefile.winx
make TOOLPATH=$(WINTOOLPATH32) $(WINCNF) -C windows -f Makefile.winx
windows-putty: windows/Makefile.winx
make TOOLPATH=$(WINTOOLPATH32) $(WINCNF) -C windows -f Makefile.winx putty.exe
windows-x64: windows/Makefile.winx
make TOOLPATH=$(WINTOOLPATH64) $(WINCNF) -C windows -f Makefile.winx
# Makefiles
unix/Makefile.gtk windows/Makefile.vc windows/Makefile.winx: mkfiles.pl
./mkfiles.pl
[ ! -f windows/Makefile.cyg ] || cp windows/Makefile.cyg windows/Makefile.winx
[ ! -f windows/Makefile.mgw ] || cp windows/Makefile.mgw windows/Makefile.winx
ifneq ($(wildcard version.h),)
@echo Dynamic change made to version.h, you should use:
@echo : git update-index --assume-unchanged version.h
[ -f version.bak ] || mv version.h version.bak
echo "#define TEXTVER" '"'"$(VER)"'"' > version.h
echo "#define SSHVER" '"'"PuTTY-$(SVER)"'"' >> version.h
echo "#define BINARY_VERSION" $(BVER) >> version.h
echo "#define SOURCE_COMMIT " '"'"$(SOURCE_COMMIT)"'"' >> version.h
endif
push: unix-all windows-all binary-branch
git push [email protected]:rdebath/PuTTY.git $(PUSHARGS) \
origin/master:refs/heads/master \
+binary \
+putty-rdb \
`git tag | grep ^0.`
git fetch rdebath
fetch:
git fetch origin
git push [email protected]:rdebath/PuTTY.git origin/master:refs/heads/master
git fetch rdebath
binary-branch: unix-all windows-all
rdb/mkzip.sh
rdb/git-commit-putty-bin
# WINDOWS Compile archive
zip: windows/Makefile.vc
-mkdir -p $(WINTGT)
-rm $(WINTGT)/putty.zip
rsync -vrc --delete --delete-excluded \
--exclude /.pc --exclude /.git\* \
--exclude='*.orig' --exclude='*.rej' \
--exclude=unix/plink --exclude=unix/pscp \
--exclude=unix/psftp --exclude=unix/pterm \
--exclude=unix/putty --exclude=unix/puttygen \
--exclude=unix/puttytel \
--exclude='*.obj' \
--exclude='*.rsp' --exclude='*.res' \
--exclude='*.map' --exclude='*.o' \
--exclude='*.zip' --exclude='*.tgz' \
--exclude='x' --exclude='x?' \
. $(WINTGT)/putty
cd $(WINTGT)/putty ; \
zip -Dq9rp \
$(WINTGT)/putty.zip . \
-x \*.obj \*.exe \*.rsp \*.map \*.res
realclean distclean: clean
@echo : Removing more generated files.
@# Recipe
@-rm -f charset/sbcsdat.c
@-rm -f empty.h
@-rm -f Makefile.am
@-rm -f macosx/Makefile
@-rm -f unix/Makefile.am
@-rm -f unix/Makefile.ux
@-rm -f unix/Makefile.gtk
@# Windows
@-rm -f windows/Makefile.mgw
@-rm -f windows/Makefile.cyg
@-rm -f windows/Makefile.winx
@-rm -f windows/Makefile.vc
@-rm -f windows/Makefile.bor
@-rm -f windows/Makefile.lcc
@-rm -f windows/Makefile.clangcl
@-rm -rf windows/VS2010
@-rm -rf windows/VS2012
@-rm -rf windows/MSVC
@-rm -rf windows/DEVCPP
@# autoconf clutter
@-rm -rf .deps/
@-rm -rf charset/.deps/
@-rm -rf unix/.deps/
@-rm -rf autom4te.cache
@-rm -f Makefile
@-rm -f Makefile.in
@-rm -f aclocal.m4
@-rm -f ar-lib
@-rm -f compile
@-rm -f config.log
@-rm -f config.status
@-rm -f configure
@-rm -f depcomp
@-rm -f install-sh
@-rm -f missing
@-rm -f stamp-h1
@-rm -f uxconfig.h
@-rm -f uxconfig.in
@# autoconf build
@-rm -f *.o charset/*.o
@-rm -f charset/.dirstamp unix/.dirstamp
@-rm -f fuzzterm pageant plink pscp psftp
@-rm -f pterm putty puttygen puttytel cgtest
@-rm -f libversion.a osxlaunch ptermapp puttyapp testbn
@# Simon's clutter
@-[ ! -f licence.pl ] || rm -f doc/licence.but doc/copy.but licence.h
@-rm -f putty-src.zip
@-rm -f putty-win.zip