Fix format() returning a std::string containing a terminating null
[cygwin-setup.git] / Makefile.am
blob3d032d6827e9b19fc0c5d46034180457c563f90f
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 -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
37 noinst_PROGRAMS = @SETUP@$(EXEEXT) inilint
39 EXTRA_DIST = \
40         CHANGES \
41         CONTRIBUTORS \
42         COPYING \
43         bootstrap.sh \
44         cygwin.ico \
45         cygwin-setup.ico \
46         cygwin-terminal.ico \
47         setup.exe.manifest \
48         tree-minus.ico \
49         tree-plus.ico
51 # iniparse.hh is generated from iniparse.yy via bison -d, so it needs to be
52 # included here for proper tracking (but not iniparse.cc, since automake
53 # knows about that already)
54 BUILT_SOURCES = \
55         setup_version.c \
56         iniparse.hh
58 CLEANFILES = setup_version.c
60 inilint_LDADD = \
61         libgetopt++/libgetopt++.la \
62         -lntdll -luuid
64 inilint_SOURCES = \
65         filemanip.cc \
66         filemanip.h \
67         CliParseFeedback.cc \
68         CliParseFeedback.h \
69         LogSingleton.cc \
70         LogSingleton.h \
71         IniDBBuilder.h \
72         inilintmain.cc \
73         inilex.ll \
74         iniparse.yy \
75         io_stream.cc \
76         io_stream.h \
77         io_stream_file.cc \
78         io_stream_file.h \
79         mkdir.cc \
80         mkdir.h \
81         mklink2.cc \
82         mklink2.h \
83         PackageTrust.h \
84         String++.cc \
85         String++.h \
86         win32.cc \
87         win32.h
89 @SETUP@_LDADD = \
90         libgetopt++/libgetopt++.la \
91         $(LIBGCRYPT_LIBS) \
92         $(ZSTD_LIBS) \
93         $(LZMA_LIBS) \
94         $(BZ2_LIBS) \
95         $(ZLIB_LIBS) \
96         $(LIBSOLV_LIBS) -lregex \
97         -lshlwapi -lcomctl32 -lole32 -lpsapi -luuid -lntdll -lwininet -lws2_32 \
98         -lmingw32 -lssp
99 @SETUP@_LDFLAGS = -mwindows -Wc,-static -static-libtool-libs
100 @SETUP@_SOURCES = \
101         actionlist.h \
102         AntiVirus.cc \
103         AntiVirus.h \
104         archive.cc \
105         archive.h \
106         archive_tar.cc \
107         archive_tar.h \
108         archive_tar_file.cc \
109         choose.cc \
110         choose.h \
111         compactos.cc \
112         compactos.h \
113         compress.cc \
114         compress.h \
115         compress_bz.cc \
116         compress_bz.h \
117         compress_gz.cc \
118         compress_gz.h \
119         compress_xz.cc \
120         compress_xz.h \
121         compress_zstd.cc \
122         compress_zstd.h \
123         confirm.cc \
124         confirm.h \
125         ConnectionSetting.cc \
126         ConnectionSetting.h \
127         ControlAdjuster.cc \
128         ControlAdjuster.h \
129         crypto.cc \
130         crypto.h \
131         cyg-pubkey.h \
132         desktop.cc \
133         desktop.h \
134         dialog.cc \
135         dialog.h \
136         diskfull.cc \
137         diskfull.h \
138         download.cc \
139         download.h \
140         Exception.cc \
141         Exception.h \
142         find.cc \
143         find.h \
144         FindVisitor.cc \
145         FindVisitor.h \
146         filemanip.cc \
147         filemanip.h \
148         fromcwd.cc \
149         Generic.h \
150         geturl.cc \
151         geturl.h \
152         gpg-packet.cc \
153         gpg-packet.h \
154         ini.cc \
155         ini.h \
156         IniDBBuilder.h \
157         IniDBBuilderPackage.cc \
158         IniDBBuilderPackage.h \
159         inilex.ll \
160         iniparse.yy \
161         IniParseFeedback.h \
162         install.cc \
163         io_stream.cc \
164         io_stream.h \
165         io_stream_cygfile.cc \
166         io_stream_cygfile.h \
167         io_stream_file.cc \
168         io_stream_file.h \
169         io_stream_memory.cc \
170         io_stream_memory.h \
171         IOStreamProvider.h \
172         KeysSetting.cc \
173         KeysSetting.h \
174         libsolv.cc \
175         libsolv.h \
176         ListView.cc \
177         ListView.h \
178         localdir.cc \
179         localdir.h \
180         LogFile.cc \
181         LogFile.h \
182         LogSingleton.cc \
183         LogSingleton.h \
184         main.cc \
185         mkdir.cc \
186         mkdir.h \
187         mklink2.cc \
188         mklink2.h \
189         mount.cc \
190         mount.h \
191         msg.cc \
192         msg.h \
193         net.cc \
194         net.h \
195         netio.cc \
196         netio.h \
197         nio-ie5.cc \
198         nio-ie5.h \
199         package_db.cc \
200         package_db.h \
201         package_depends.h \
202         package_depends.cc \
203         package_meta.cc \
204         package_meta.h \
205         package_source.cc \
206         package_source.h \
207         package_version.h \
208         PackageSpecification.cc \
209         PackageSpecification.h \
210         PackageTrust.h \
211         PickCategoryLine.cc \
212         PickCategoryLine.h \
213         PickPackageLine.cc \
214         PickPackageLine.h \
215         PickView.cc \
216         PickView.h \
217         postinstall.cc \
218         postinstallresults.cc \
219         postinstallresults.h \
220         prereq.cc \
221         prereq.h \
222         processlist.cc \
223         processlist.h \
224         proppage.cc \
225         proppage.h \
226         propsheet.cc \
227         propsheet.h \
228         RECTWrapper.h \
229         res.rc \
230         resource.h \
231         root.cc \
232         root.h \
233         script.cc \
234         script.h \
235         setup_version.h \
236         setup_version.c \
237         sha2.h \
238         sha2.c \
239         site.cc \
240         site.h \
241         source.cc \
242         source.h \
243         SourceSetting.cc \
244         SourceSetting.h \
245         splash.cc \
246         splash.h \
247         state.cc \
248         state.h \
249         String++.cc \
250         String++.h \
251         threebar.cc \
252         threebar.h \
253         UserSettings.cc \
254         UserSettings.h \
255         win32.cc \
256         win32.h \
257         window.cc \
258         window.h \
259         csu_util/MD5Sum.cc \
260         csu_util/MD5Sum.h \
261         csu_util/rfc1738.cc \
262         csu_util/rfc1738.h \
263         csu_util/version_compare.cc \
264         csu_util/version_compare.h
266 GITVER := $(shell cd $(srcdir) && git describe --match release_\* --abbrev=6 --dirty || echo "N/A")
267 VER := $(subst release_,,$(GITVER))
268 ARCH := @ARCH@
270 setup_version.c : Makefile
271         @echo "Setup version: " $(VER)
272         $(AM_V_GEN)(echo '#define VERSION_PREFIX "%%% setup-version"';\
273         echo 'static const char version_store[] = VERSION_PREFIX " '$(VER)'";';\
274         echo 'const char *setup_version = version_store + sizeof (VERSION_PREFIX);') > version.tmp && \
275         mv version.tmp setup_version.c
277 # files included by res.rc
278 res.o: setup.exe.manifest res/fr/res.rc
280 .rc.o:
281         $(AM_V_GEN)$(WINDRES) --codepage 65001 --include-dir $(srcdir) -o $@ $<
283 setup-src:
284         @ver=setup-$(VER);\
285         cd ${srcdir}; rm -f $$ver; ln -sf . $$ver;\
286         git ls-files | tar -T - -cJf ${CURDIR}/$$ver-src.tar.xz;\
287         echo $$ver-src.tar.xz; exec rm -f $$ver
289 # optional: strip and compress executable
290 .PHONY: strip upx
292 strip:  all
293         $(OBJCOPY) --add-gnu-debuglink=/dev/null --only-keep-debug setup$(EXEEXT) setup.dbg
294         $(OBJCOPY) --strip-all setup$(EXEEXT)
295         $(OBJCOPY) --add-gnu-debuglink=setup.dbg setup$(EXEEXT) setup$(EXEEXT)
297 CLEANFILES += setup.dbg
299 upx:    strip
300         @if [ -e `which upx` ]; then\
301                 upx --best --lzma setup$(EXEEXT) ;\
302         else \
303                 echo "UPX doesn't seem to be installed, cannot compress setup$(EXEEXT)." ;\
304         fi
306 release: upx
307         cp setup.dbg setup-${VER}.${ARCH}.dbg
308         cp setup${EXEEXT} setup-${VER}.${ARCH}${EXEEXT}
310 UPLOAD_HOST=cygwin-admin@cygwin.com
311 UPLOAD_PATH=/www/sourceware/htdocs/cygwin/setup
312 SIGN_KEYS="--enable-dsa2 --personal-digest-preferences=sha256 -u 676041BA -u 1A698DE9E2E56300"
314 upload: release
315         scp setup-${VER}.$(ARCH).exe setup-${VER}.$(ARCH).dbg ${UPLOAD_HOST}:${UPLOAD_PATH}
316         ssh ${UPLOAD_HOST} gpg ${SIGN_KEYS} --detach-sign ${UPLOAD_PATH}/setup-${VER}.$(ARCH).exe
318 clean-local:
319         rm -f setup*${EXEEXT} setup*.dbg