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
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 \
25 AM_CXXFLAGS = $(BASECXXFLAGS) -std=gnu++11 ${$(*F)_CXXFLAGS}
26 AM_CFLAGS = $(BASECXXFLAGS) -Wmissing-declarations -Winline \
27 -Wstrict-prototypes -Wmissing-prototypes
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
36 iniparse_CXXFLAGS:=-Wno-free-nonheap-object
38 noinst_PROGRAMS = @SETUP@$(EXEEXT) inilint
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)
59 CLEANFILES = setup_version.c
62 libgetopt++/libgetopt++.la \
91 libgetopt++/libgetopt++.la \
97 $(LIBSOLV_LIBS) -lregex \
98 -lshlwapi -lcomctl32 -lole32 -lpsapi -luuid -lntdll -lwininet -lws2_32 \
100 @SETUP@_LDFLAGS = -mwindows -Wc,-static -static-libtool-libs
109 archive_tar_file.cc \
126 ConnectionSetting.cc \
127 ConnectionSetting.h \
158 IniDBBuilderPackage.cc \
159 IniDBBuilderPackage.h \
166 io_stream_cygfile.cc \
167 io_stream_cygfile.h \
170 io_stream_memory.cc \
209 PackageSpecification.cc \
210 PackageSpecification.h \
212 PickCategoryLine.cc \
219 postinstallresults.cc \
220 postinstallresults.h \
262 csu_util/rfc1738.cc \
264 csu_util/version_compare.cc \
265 csu_util/version_compare.h
267 GITVER := $(shell cd $(srcdir) && git describe --match release_\* --abbrev=6 --dirty || echo "N/A")
268 VER := $(subst release_,,$(GITVER))
271 setup_version.c : Makefile
272 @echo "Setup version: " $(VER)
273 $(AM_V_GEN)(echo '#define VERSION_PREFIX "%%% setup-version"';\
274 echo 'static const char version_store[] = VERSION_PREFIX " '$(VER)'";';\
275 echo 'const char *setup_version = version_store + sizeof (VERSION_PREFIX);') > version.tmp && \
276 mv version.tmp setup_version.c
278 # rules for translation maintenance
279 .PHONY: pot rc2po po2rc
282 cd $(srcdir) && rc2po -P res/en/res.rc res.pot
288 for l in $(LINGUAS) ; do \
289 rc2po -t res/en/res.rc --charset=utf-8 res/$$l/res.rc po/$$l/ ; \
294 for l in $(LINGUAS) ; do \
295 po2rc -t res/en/res.rc --charset-output=utf-8 $$(./langopts $$l) po/$$l/ res/$$l && \
296 d2u -q res/$$l/res.rc ; \
299 # files included by res.rc
300 res.o: setup.exe.manifest res/en/res.rc $(foreach l,$(LINGUAS),res/$l/res.rc)
303 $(AM_V_GEN)$(WINDRES) --codepage 65001 --include-dir $(srcdir) -o $@ $<
307 cd ${srcdir}; rm -f $$ver; ln -sf . $$ver;\
308 git ls-files | tar -T - -cJf ${CURDIR}/$$ver-src.tar.xz;\
309 echo $$ver-src.tar.xz; exec rm -f $$ver
311 # optional: strip and compress executable
315 $(OBJCOPY) --add-gnu-debuglink=/dev/null --only-keep-debug setup$(EXEEXT) setup.dbg
316 $(OBJCOPY) --strip-all setup$(EXEEXT)
317 $(OBJCOPY) --add-gnu-debuglink=setup.dbg setup$(EXEEXT) setup$(EXEEXT)
319 CLEANFILES += setup.dbg
322 @if [ -e `which upx` ]; then\
323 upx --best --lzma setup$(EXEEXT) ;\
325 echo "UPX doesn't seem to be installed, cannot compress setup$(EXEEXT)." ;\
329 cp setup.dbg setup-${VER}.${ARCH}.dbg
330 cp setup${EXEEXT} setup-${VER}.${ARCH}${EXEEXT}
332 UPLOAD_HOST=cygwin-admin@cygwin.com
333 UPLOAD_PATH=/www/sourceware/htdocs/cygwin/setup
334 SIGN_KEYS="--enable-dsa2 --personal-digest-preferences=sha256 -u 676041BA -u 1A698DE9E2E56300"
337 scp setup-${VER}.$(ARCH).exe setup-${VER}.$(ARCH).dbg ${UPLOAD_HOST}:${UPLOAD_PATH}
338 ssh ${UPLOAD_HOST} gpg --batch ${SIGN_KEYS} --detach-sign ${UPLOAD_PATH}/setup-${VER}.$(ARCH).exe
341 rm -f setup*${EXEEXT} setup*.dbg