1 ## Process this file with automake to produce Makefile.in
5 # Copyright (c) 2000, Red Hat, Inc.
6 # Copyright (c) 2002, Robert Collins
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # A copy of the GNU General Public License can be found at
16 # Makefile for Cygwin installer
18 SUBDIRS := @subdirs@ tests
20 ## DISTCLEANFILES = include/stamp-h include/stamp-h[0-9]*
22 # We would like to use -Winline for C++ as well, but some STL code triggers
23 # this warning. (Bug verified present in gcc-3.3)
24 BASECXXFLAGS = -Werror -Wall -Wpointer-arith -Wcomments \
25 -Wcast-align -Wwrite-strings -fno-builtin-sscanf \
27 AM_CXXFLAGS = $(BASECXXFLAGS) -std=gnu++11 ${$(*F)_CXXFLAGS}
28 AM_CFLAGS = $(BASECXXFLAGS) -Wmissing-declarations -Winline \
29 -Wstrict-prototypes -Wmissing-prototypes
33 AM_CPPFLAGS = -DLZMA_API_STATIC -I$(srcdir)/libgetopt++/include
35 inilex_CXXFLAGS:=-Wno-sign-compare
37 noinst_PROGRAMS = @SETUP@$(EXEEXT) @INILINT@
39 EXTRA_PROGRAMS = inilint
40 ## noinst_PROGRAMS +=inilint
56 setup64.exe.manifest \
60 # iniparse.hh is generated from iniparse.yy via bison -d, so it needs to be
61 # included here for proper tracking (but not iniparse.cc, since automake
62 # knows about that already)
67 CLEANFILES = setup_version.c
70 libgetopt++/libgetopt++.la
94 PackageSpecification.cc \
95 PackageSpecification.h \
103 libgetopt++/libgetopt++.la -lgcrypt -lgpg-error -llzma -lbz2 -lz \
104 -lshlwapi -lcomctl32 -lole32 -lws2_32 -lpsapi -luuid -lntdll -lwininet -lmingw32
105 @SETUP@_LDFLAGS = -mwindows -Wc,-static -static-libtool-libs
113 archive_tar_file.cc \
124 ConnectionSetting.cc \
125 ConnectionSetting.h \
158 IniDBBuilderPackage.cc \
159 IniDBBuilderPackage.h \
162 IniParseFeedback.cc \
167 io_stream_cygfile.cc \
168 io_stream_cygfile.h \
171 io_stream_memory.cc \
213 PackageSpecification.cc \
214 PackageSpecification.h \
216 PickCategoryLine.cc \
224 postinstallresults.cc \
225 postinstallresults.h \
271 csu_util/rfc1738.cc \
273 csu_util/version_compare.cc \
274 csu_util/version_compare.h
276 GITVER := $(shell cd $(srcdir) && git describe --match release_\* --abbrev=6 --dirty || "N/A")
277 VER := $(subst release_,,$(GITVER))
280 setup_version.c : Makefile
281 @echo "Setup version: " $(VER)
282 $(AM_V_GEN)(echo '#define VERSION_PREFIX "%%% setup-version"';\
283 echo 'static const char version_store[] = VERSION_PREFIX " '$(VER)'";';\
284 echo 'const char *setup_version = version_store + sizeof (VERSION_PREFIX);') > version.tmp && \
285 mv version.tmp setup_version.c
287 # setup.exe.manifest is included in res.rc
288 res.o: @SETUP@.exe.manifest
291 $(AM_V_GEN)$(WINDRES) --include-dir $(srcdir) -o $@ $<
295 cd ${srcdir}; rm -f $$ver; ln -sf . $$ver;\
296 git ls-files | tar -T - -cJf ${CURDIR}/$$ver-src.tar.xz;\
297 echo $$ver-src.tar.xz; exec rm -f $$ver
299 # optional: strip and compress executable
303 $(OBJCOPY) --add-gnu-debuglink=/dev/null --only-keep-debug setup$(EXEEXT) setup.dbg
304 $(OBJCOPY) --strip-all setup$(EXEEXT)
305 $(OBJCOPY) --add-gnu-debuglink=setup.dbg setup$(EXEEXT) setup$(EXEEXT)
307 CLEANFILES += setup.dbg
310 @if [ -e `which upx` ]; then\
311 upx --best --lzma setup$(EXEEXT) ;\
313 echo "UPX doesn't seem to be installed, cannot compress setup$(EXEEXT)." ;\
317 cp setup.dbg setup-${VER}.${ARCH}.dbg
318 cp setup${EXEEXT} setup-${VER}.${ARCH}${EXEEXT}
321 rm -f setup*${EXEEXT} setup*.dbg