]> cygwin.com Git - cygwin-apps/setup.git/blob - Makefile.am
Suggest URLs for updated setup based on build architecture
[cygwin-apps/setup.git] / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2 #
3 # Copyright (c) 2000, Red Hat, Inc.
4 # Copyright (c) 2002, Robert Collins
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # A copy of the GNU General Public License can be found at
12 # http://www.gnu.org/
13 #
14 # Makefile for Cygwin installer
15
16 SUBDIRS := @subdirs@ tests
17
18 ## DISTCLEANFILES = include/stamp-h include/stamp-h[0-9]*
19
20 # We would like to use -Winline for C++ as well, but some STL code triggers
21 # this warning. (Bug verified present in gcc-3.3)
22 BASECXXFLAGS = -Werror -Wall -Wpointer-arith -Wcomments \
23 -Wcast-align -Wwrite-strings -fno-builtin-sscanf \
24 -Wno-attributes
25 AM_CXXFLAGS = $(BASECXXFLAGS) -std=gnu++11 ${$(*F)_CXXFLAGS}
26 AM_CFLAGS = $(BASECXXFLAGS) -Wmissing-declarations -Winline \
27 -Wstrict-prototypes -Wmissing-prototypes
28 AM_YFLAGS = -d
29 AM_LFLAGS = -8
30 WINDRES = @WINDRES@
31 AM_CPPFLAGS = -D__USE_MINGW_ANSI_STDIO=1 -D_FILE_OFFSET_BITS=64 -DLZMA_API_STATIC \
32 -I$(srcdir)/libgetopt++/include \
33 $(ZLIB_CFLAGS) $(LZMA_CFLAGS) $(ZSTD_CFLAGS) $(LIBCRYPT_CFLAGS) $(LIBSOLV_CFLAGS)
34
35 inilex_CXXFLAGS:=-Wno-sign-compare
36 iniparse_CXXFLAGS:=-Wno-free-nonheap-object
37
38 noinst_PROGRAMS = @SETUP@$(EXEEXT) inilint
39
40 EXTRA_DIST = \
41 CHANGES \
42 CONTRIBUTORS \
43 COPYING \
44 bootstrap.sh \
45 cygwin.ico \
46 cygwin-setup.ico \
47 cygwin-terminal.ico \
48 setup.exe.manifest \
49 tree-minus.ico \
50 tree-plus.ico
51
52 # iniparse.hh is generated from iniparse.yy via bison -d, so it needs to be
53 # included here for proper tracking (but not iniparse.cc, since automake
54 # knows about that already)
55 BUILT_SOURCES = \
56 setup_version.c \
57 iniparse.hh
58
59 CLEANFILES = setup_version.c
60
61 inilint_LDADD = \
62 libgetopt++/libgetopt++.la \
63 -lntdll -luuid
64
65 inilint_SOURCES = \
66 filemanip.cc \
67 filemanip.h \
68 CliParseFeedback.cc \
69 CliParseFeedback.h \
70 LogSingleton.cc \
71 LogSingleton.h \
72 IniDBBuilder.h \
73 inilintmain.cc \
74 inilex.ll \
75 iniparse.yy \
76 io_stream.cc \
77 io_stream.h \
78 io_stream_file.cc \
79 io_stream_file.h \
80 mkdir.cc \
81 mkdir.h \
82 mklink2.cc \
83 mklink2.h \
84 PackageTrust.h \
85 String++.cc \
86 String++.h \
87 win32.cc \
88 win32.h
89
90 # Do not link directly with wininet, as it's vulnerable to sideloading/dll
91 # hijacking. Instead we make and link with a delay-loading stub lib, so it's
92 # actually loaded after we've had a chance to call SetDefaultDllDirectories().
93 #
94 # (The voodoo here is to grovel over the libwininet.a we would link with to
95 # generate the .def file, rather than having to keep our own copy around)
96 wininet-delaylib.a:
97 $(AM_V_at)IMPLIB=$(shell $(CC) -print-file-name=libwininet.a) && \
98 echo "LIBRARY" $$($(DLLTOOL) --identify $$IMPLIB) >wininet.def && \
99 echo "EXPORTS" >> wininet.def && \
100 $(NM) -g --defined-only $$IMPLIB | grep ' T ' | cut -d' ' -f3 >>wininet.def
101 $(AM_V_GEN)$(DLLTOOL) --no-leading-underscore --input-def wininet.def --output-delaylib $@
102
103 CLEANFILES += wininet-delaylib.a
104
105 # Unfortunately, the delay-loading stub lib doesn't work properly on 32-bit
106 # currently, so don't bother (since we're probably going to stop building that
107 # fairly soon)
108 #
109 # (See https://sourceware.org/bugzilla/show_bug.cgi?id=14339)
110 if ARCH_X86
111 WININET=-lwininet
112 else
113 WININET=wininet-delaylib.a
114 EXTRA_@SETUP@_DEPENDENCIES=wininet-delaylib.a
115 endif
116
117 @SETUP@_LDADD = \
118 libgetopt++/libgetopt++.la \
119 $(LIBGCRYPT_LIBS) \
120 $(ZSTD_LIBS) \
121 $(LZMA_LIBS) \
122 $(BZ2_LIBS) \
123 $(ZLIB_LIBS) \
124 $(LIBSOLV_LIBS) -lregex \
125 -lmingwex \
126 -lshlwapi -lcomctl32 -lole32 -lpsapi -luuid -lntdll $(WININET) -lws2_32 \
127 -lmingw32 -lssp
128 @SETUP@_LDFLAGS = -mwindows -Wc,-static -static-libtool-libs
129 @SETUP@_SOURCES = \
130 actionlist.h \
131 AntiVirus.cc \
132 AntiVirus.h \
133 archive.cc \
134 archive.h \
135 archive_tar.cc \
136 archive_tar.h \
137 archive_tar_file.cc \
138 choose.cc \
139 choose.h \
140 compactos.cc \
141 compactos.h \
142 compress.cc \
143 compress.h \
144 compress_bz.cc \
145 compress_bz.h \
146 compress_gz.cc \
147 compress_gz.h \
148 compress_xz.cc \
149 compress_xz.h \
150 compress_zstd.cc \
151 compress_zstd.h \
152 confirm.cc \
153 confirm.h \
154 ConnectionSetting.cc \
155 ConnectionSetting.h \
156 ControlAdjuster.cc \
157 ControlAdjuster.h \
158 crypto.cc \
159 crypto.h \
160 cyg-pubkey.h \
161 desktop.cc \
162 desktop.h \
163 dialog.cc \
164 dialog.h \
165 diskfull.cc \
166 diskfull.h \
167 download.cc \
168 download.h \
169 Exception.cc \
170 Exception.h \
171 find.cc \
172 find.h \
173 FindVisitor.cc \
174 FindVisitor.h \
175 filemanip.cc \
176 filemanip.h \
177 fromcwd.cc \
178 Generic.h \
179 geturl.cc \
180 geturl.h \
181 gpg-packet.cc \
182 gpg-packet.h \
183 ini.cc \
184 ini.h \
185 IniDBBuilder.h \
186 IniDBBuilderPackage.cc \
187 IniDBBuilderPackage.h \
188 inilex.ll \
189 iniparse.yy \
190 IniParseFeedback.h \
191 install.cc \
192 io_stream.cc \
193 io_stream.h \
194 io_stream_cygfile.cc \
195 io_stream_cygfile.h \
196 io_stream_file.cc \
197 io_stream_file.h \
198 io_stream_memory.cc \
199 io_stream_memory.h \
200 IOStreamProvider.h \
201 KeysSetting.cc \
202 KeysSetting.h \
203 libsolv.cc \
204 libsolv.h \
205 ListView.cc \
206 ListView.h \
207 localdir.cc \
208 localdir.h \
209 LogFile.cc \
210 LogFile.h \
211 LogSingleton.cc \
212 LogSingleton.h \
213 main.cc \
214 mkdir.cc \
215 mkdir.h \
216 mklink2.cc \
217 mklink2.h \
218 mount.cc \
219 mount.h \
220 msg.cc \
221 msg.h \
222 net.cc \
223 net.h \
224 netio.cc \
225 netio.h \
226 nio-ie5.cc \
227 nio-ie5.h \
228 package_db.cc \
229 package_db.h \
230 package_depends.h \
231 package_depends.cc \
232 package_meta.cc \
233 package_meta.h \
234 package_source.cc \
235 package_source.h \
236 package_version.h \
237 PackageSpecification.cc \
238 PackageSpecification.h \
239 PackageTrust.h \
240 PickCategoryLine.cc \
241 PickCategoryLine.h \
242 PickPackageLine.cc \
243 PickPackageLine.h \
244 PickView.cc \
245 PickView.h \
246 postinstall.cc \
247 postinstallresults.cc \
248 postinstallresults.h \
249 prereq.cc \
250 prereq.h \
251 processlist.cc \
252 processlist.h \
253 proppage.cc \
254 proppage.h \
255 propsheet.cc \
256 propsheet.h \
257 RECTWrapper.h \
258 res.rc \
259 resource.h \
260 root.cc \
261 root.h \
262 script.cc \
263 script.h \
264 setup_version.h \
265 setup_version.c \
266 sha2.h \
267 sha2.c \
268 site.cc \
269 site.h \
270 source.cc \
271 source.h \
272 SourceSetting.cc \
273 SourceSetting.h \
274 splash.cc \
275 splash.h \
276 state.cc \
277 state.h \
278 String++.cc \
279 String++.h \
280 threebar.cc \
281 threebar.h \
282 UserSettings.cc \
283 UserSettings.h \
284 win32.cc \
285 win32.h \
286 window.cc \
287 window.h \
288 csu_util/MD5Sum.cc \
289 csu_util/MD5Sum.h \
290 csu_util/rfc1738.cc \
291 csu_util/rfc1738.h \
292 csu_util/version_compare.cc \
293 csu_util/version_compare.h
294
295 GITVER := $(shell cd $(srcdir) && git describe --match release_\* --abbrev=6 --dirty || echo "N/A")
296 VER := $(subst release_,,$(GITVER))
297 ARCH := @ARCH@
298
299 setup_version.c : Makefile
300 @echo "Setup version: " $(VER)
301 $(AM_V_GEN)(echo '#define VERSION_PREFIX "%%% setup-version"';\
302 echo 'static const char version_store[] = VERSION_PREFIX " '$(VER)'";';\
303 echo 'const char *setup_version = version_store + sizeof (VERSION_PREFIX);') > version.tmp && \
304 mv version.tmp setup_version.c
305
306 # rules for translation maintenance
307 .PHONY: pot rc2po po2rc
308
309 pot:
310 cd $(srcdir) && rc2po -P res/en/res.rc res.pot
311
312 LINGUAS=de fr pl tr zh_Hans
313
314 rc2po:
315 cd $(srcdir) && \
316 for l in $(LINGUAS) ; do \
317 rc2po -t res/en/res.rc --charset=utf-8 res/$$l/res.rc po/$$l/ ; \
318 done
319
320 po2rc:
321 cd $(srcdir) && \
322 for l in $(LINGUAS) ; do \
323 ./langopts $$l >/dev/null && \
324 $(MKDIR_P) res/$$l/ && \
325 po2rc -t res/en/res.rc --charset-output=utf-8 $$(./langopts $$l) po/$$l/res.po res/$$l/res.rc && \
326 d2u -q res/$$l/res.rc && \
327 ./rc-postprocess $$l res/$$l/res.rc ; \
328 done
329
330 # files included by res.rc
331 res.o: setup.exe.manifest res/en/res.rc $(foreach l,$(LINGUAS),res/$l/res.rc)
332
333 .rc.o:
334 $(AM_V_GEN)$(WINDRES) --codepage 65001 --include-dir $(srcdir) -o $@ $<
335
336 setup-src:
337 @ver=setup-$(VER);\
338 cd ${srcdir}; rm -f $$ver; ln -sf . $$ver;\
339 git ls-files | tar -T - -cJf ${CURDIR}/$$ver-src.tar.xz;\
340 echo $$ver-src.tar.xz; exec rm -f $$ver
341
342 # optional: strip and compress executable
343 .PHONY: strip upx release upload
344
345 strip: all
346 @$(MKDIR_P) stripped
347 $(OBJCOPY) --add-gnu-debuglink=/dev/null --only-keep-debug setup$(EXEEXT) stripped/setup.dbg
348 $(OBJCOPY) --strip-all setup$(EXEEXT) stripped/setup$(EXEEXT)
349 $(OBJCOPY) --add-gnu-debuglink=stripped/setup.dbg stripped/setup$(EXEEXT) stripped/setup$(EXEEXT)
350
351 CLEANFILES += setup.dbg
352
353 upx: strip
354 @if [ -e `which upx` ]; then\
355 $(MKDIR_P) upx ;\
356 rm -f upx/setup$(EXEEXT) ;\
357 upx --best --lzma stripped/setup$(EXEEXT) -o upx/setup$(EXEEXT) ;\
358 else \
359 echo "UPX doesn't seem to be installed, cannot compress setup$(EXEEXT)." ;\
360 fi
361
362 release: upx
363 @$(MKDIR_P) release
364 cp stripped/setup.dbg release/setup-${VER}.${ARCH}.dbg
365 cp stripped/setup${EXEEXT} release/setup-${VER}-uncompressed.${ARCH}${EXEEXT}
366 cp upx/setup${EXEEXT} release/setup-${VER}.${ARCH}${EXEEXT}
367
368 UPLOAD_HOST=cygwin-admin@cygwin.com
369 UPLOAD_PATH=/www/sourceware/htdocs/cygwin/setup
370 SIGN_KEYS="--enable-dsa2 --personal-digest-preferences=sha256 -u 1A698DE9E2E56300"
371
372 upload: release
373 cd release ; scp setup-${VER}.$(ARCH).exe setup-${VER}.$(ARCH).dbg setup-${VER}-uncompressed.${ARCH}${EXEEXT} ${UPLOAD_HOST}:${UPLOAD_PATH}
374 ssh ${UPLOAD_HOST} gpg --batch ${SIGN_KEYS} --detach-sign ${UPLOAD_PATH}/setup-${VER}.$(ARCH).exe
375 ssh ${UPLOAD_HOST} gpg --batch ${SIGN_KEYS} --detach-sign ${UPLOAD_PATH}/setup-${VER}-uncompressed.$(ARCH).exe
376 ssh ${UPLOAD_HOST} "cd ${UPLOAD_PATH} && sha512sum *.exe > sha512.sum"
377
378 clean-local:
379 rm -rf stripped upx release
This page took 0.050343 seconds and 5 git commands to generate.