Translated using Weblate (Chinese (Simplified))
[cygwin-setup.git] / Makefile.am
blobfac60ee93f62fd74a91d9f02d34e061a77bbf3b6
1 ## Process this file with automake to produce Makefile.in
3 # Copyright (c) 2000, Red Hat, Inc.
4 # Copyright (c) 2002, Robert Collins
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.
11 #     A copy of the GNU General Public License can be found at
12 #     http://www.gnu.org/
14 # Makefile for Cygwin installer
16 SUBDIRS := @subdirs@ tests
18 ## DISTCLEANFILES = include/stamp-h include/stamp-h[0-9]*
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)
35 inilex_CXXFLAGS:=-Wno-sign-compare
36 iniparse_CXXFLAGS:=-Wno-free-nonheap-object
38 noinst_PROGRAMS = @SETUP@$(EXEEXT) inilint
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
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
59 CLEANFILES = setup_version.c
61 inilint_LDADD = \
62         libgetopt++/libgetopt++.la \
63         -lntdll -luuid
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
90 @SETUP@_LDADD = \
91         libgetopt++/libgetopt++.la \
92         $(LIBGCRYPT_LIBS) \
93         $(ZSTD_LIBS) \
94         $(LZMA_LIBS) \
95         $(BZ2_LIBS) \
96         $(ZLIB_LIBS) \
97         $(LIBSOLV_LIBS) -lregex \
98         -lmingwex \
99         -lshlwapi -lcomctl32 -lole32 -lpsapi -luuid -lntdll -lwininet -lws2_32 \
100         -lmingw32 -lssp
101 @SETUP@_LDFLAGS = -mwindows -Wc,-static -static-libtool-libs
102 @SETUP@_SOURCES = \
103         actionlist.h \
104         AntiVirus.cc \
105         AntiVirus.h \
106         archive.cc \
107         archive.h \
108         archive_tar.cc \
109         archive_tar.h \
110         archive_tar_file.cc \
111         choose.cc \
112         choose.h \
113         compactos.cc \
114         compactos.h \
115         compress.cc \
116         compress.h \
117         compress_bz.cc \
118         compress_bz.h \
119         compress_gz.cc \
120         compress_gz.h \
121         compress_xz.cc \
122         compress_xz.h \
123         compress_zstd.cc \
124         compress_zstd.h \
125         confirm.cc \
126         confirm.h \
127         ConnectionSetting.cc \
128         ConnectionSetting.h \
129         ControlAdjuster.cc \
130         ControlAdjuster.h \
131         crypto.cc \
132         crypto.h \
133         cyg-pubkey.h \
134         desktop.cc \
135         desktop.h \
136         dialog.cc \
137         dialog.h \
138         diskfull.cc \
139         diskfull.h \
140         download.cc \
141         download.h \
142         Exception.cc \
143         Exception.h \
144         find.cc \
145         find.h \
146         FindVisitor.cc \
147         FindVisitor.h \
148         filemanip.cc \
149         filemanip.h \
150         fromcwd.cc \
151         Generic.h \
152         geturl.cc \
153         geturl.h \
154         gpg-packet.cc \
155         gpg-packet.h \
156         ini.cc \
157         ini.h \
158         IniDBBuilder.h \
159         IniDBBuilderPackage.cc \
160         IniDBBuilderPackage.h \
161         inilex.ll \
162         iniparse.yy \
163         IniParseFeedback.h \
164         install.cc \
165         io_stream.cc \
166         io_stream.h \
167         io_stream_cygfile.cc \
168         io_stream_cygfile.h \
169         io_stream_file.cc \
170         io_stream_file.h \
171         io_stream_memory.cc \
172         io_stream_memory.h \
173         IOStreamProvider.h \
174         KeysSetting.cc \
175         KeysSetting.h \
176         libsolv.cc \
177         libsolv.h \
178         ListView.cc \
179         ListView.h \
180         localdir.cc \
181         localdir.h \
182         LogFile.cc \
183         LogFile.h \
184         LogSingleton.cc \
185         LogSingleton.h \
186         main.cc \
187         mkdir.cc \
188         mkdir.h \
189         mklink2.cc \
190         mklink2.h \
191         mount.cc \
192         mount.h \
193         msg.cc \
194         msg.h \
195         net.cc \
196         net.h \
197         netio.cc \
198         netio.h \
199         nio-ie5.cc \
200         nio-ie5.h \
201         package_db.cc \
202         package_db.h \
203         package_depends.h \
204         package_depends.cc \
205         package_meta.cc \
206         package_meta.h \
207         package_source.cc \
208         package_source.h \
209         package_version.h \
210         PackageSpecification.cc \
211         PackageSpecification.h \
212         PackageTrust.h \
213         PickCategoryLine.cc \
214         PickCategoryLine.h \
215         PickPackageLine.cc \
216         PickPackageLine.h \
217         PickView.cc \
218         PickView.h \
219         postinstall.cc \
220         postinstallresults.cc \
221         postinstallresults.h \
222         prereq.cc \
223         prereq.h \
224         processlist.cc \
225         processlist.h \
226         proppage.cc \
227         proppage.h \
228         propsheet.cc \
229         propsheet.h \
230         RECTWrapper.h \
231         res.rc \
232         resource.h \
233         root.cc \
234         root.h \
235         script.cc \
236         script.h \
237         setup_version.h \
238         setup_version.c \
239         sha2.h \
240         sha2.c \
241         site.cc \
242         site.h \
243         source.cc \
244         source.h \
245         SourceSetting.cc \
246         SourceSetting.h \
247         splash.cc \
248         splash.h \
249         state.cc \
250         state.h \
251         String++.cc \
252         String++.h \
253         threebar.cc \
254         threebar.h \
255         UserSettings.cc \
256         UserSettings.h \
257         win32.cc \
258         win32.h \
259         window.cc \
260         window.h \
261         csu_util/MD5Sum.cc \
262         csu_util/MD5Sum.h \
263         csu_util/rfc1738.cc \
264         csu_util/rfc1738.h \
265         csu_util/version_compare.cc \
266         csu_util/version_compare.h
268 GITVER := $(shell cd $(srcdir) && git describe --match release_\* --abbrev=6 --dirty || echo "N/A")
269 VER := $(subst release_,,$(GITVER))
270 ARCH := @ARCH@
272 setup_version.c : Makefile
273         @echo "Setup version: " $(VER)
274         $(AM_V_GEN)(echo '#define VERSION_PREFIX "%%% setup-version"';\
275         echo 'static const char version_store[] = VERSION_PREFIX " '$(VER)'";';\
276         echo 'const char *setup_version = version_store + sizeof (VERSION_PREFIX);') > version.tmp && \
277         mv version.tmp setup_version.c
279 # rules for translation maintenance
280 .PHONY: pot rc2po po2rc
282 pot:
283         cd $(srcdir) && rc2po -P res/en/res.rc res.pot
285 LINGUAS=de fr pl tr zh_Hans
287 rc2po:
288         cd $(srcdir) && \
289         for l in $(LINGUAS) ; do \
290                 rc2po -t res/en/res.rc --charset=utf-8 res/$$l/res.rc po/$$l/ ; \
291         done
293 po2rc:
294         cd $(srcdir) && \
295         for l in $(LINGUAS) ; do \
296                 ./langopts $$l >/dev/null && \
297                 mkdir -p res/$$l/ && \
298                 po2rc -t res/en/res.rc --charset-output=utf-8 $$(./langopts $$l) po/$$l/res.po res/$$l/res.rc && \
299                 d2u -q res/$$l/res.rc ; \
300         done
302 # files included by res.rc
303 res.o: setup.exe.manifest res/en/res.rc $(foreach l,$(LINGUAS),res/$l/res.rc)
305 .rc.o:
306         $(AM_V_GEN)$(WINDRES) --codepage 65001 --include-dir $(srcdir) -o $@ $<
308 setup-src:
309         @ver=setup-$(VER);\
310         cd ${srcdir}; rm -f $$ver; ln -sf . $$ver;\
311         git ls-files | tar -T - -cJf ${CURDIR}/$$ver-src.tar.xz;\
312         echo $$ver-src.tar.xz; exec rm -f $$ver
314 # optional: strip and compress executable
315 .PHONY: strip upx
317 strip:  all
318         $(OBJCOPY) --add-gnu-debuglink=/dev/null --only-keep-debug setup$(EXEEXT) setup.dbg
319         $(OBJCOPY) --strip-all setup$(EXEEXT)
320         $(OBJCOPY) --add-gnu-debuglink=setup.dbg setup$(EXEEXT) setup$(EXEEXT)
322 CLEANFILES += setup.dbg
324 upx:    strip
325         @if [ -e `which upx` ]; then\
326                 upx --best --lzma setup$(EXEEXT) ;\
327         else \
328                 echo "UPX doesn't seem to be installed, cannot compress setup$(EXEEXT)." ;\
329         fi
331 release: upx
332         cp setup.dbg setup-${VER}.${ARCH}.dbg
333         cp setup${EXEEXT} setup-${VER}.${ARCH}${EXEEXT}
335 UPLOAD_HOST=cygwin-admin@cygwin.com
336 UPLOAD_PATH=/www/sourceware/htdocs/cygwin/setup
337 SIGN_KEYS="--enable-dsa2 --personal-digest-preferences=sha256 -u 1A698DE9E2E56300"
339 upload: release
340         scp setup-${VER}.$(ARCH).exe setup-${VER}.$(ARCH).dbg ${UPLOAD_HOST}:${UPLOAD_PATH}
341         ssh ${UPLOAD_HOST} gpg --batch ${SIGN_KEYS} --detach-sign ${UPLOAD_PATH}/setup-${VER}.$(ARCH).exe
343 clean-local:
344         rm -f setup*${EXEEXT} setup*.dbg