+# ------------------------------------------------------------
+# Additional text added verbatim to each individual Makefile.
+
+# Hack to force version.o to be rebuilt always.
+!begin vc
+version.obj: *.c *.h *.rc
+ cl $(VER) $(CFLAGS) /c ..\version.c
+!end
+!specialobj vc version
+!begin cygwin
+version.o: FORCE
+ $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) $(VER) -c ../version.c
+!end
+!specialobj cygwin version
+!begin borland
+version.obj: FORCE
+ bcc32 $(VER) $(CFLAGS) /c ..\version.c
+!end
+!specialobj borland version
+!begin lcc
+version.obj: FORCE
+ lcc $(VER) $(CFLAGS) /c ..\version.c
+!end
+!specialobj lcc version
+# For Unix, we also need the gross MD5 hack that causes automatic
+# version number selection in release source archives.
+!begin gtk
+version.o: FORCE
+ if test -z "$(VER)" && (cd ..; md5sum -c manifest); then \
+ $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) `cat ../version.def` -c ../version.c; \
+ else \
+ $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) $(VER) -c ../version.c; \
+ fi
+!end
+!specialobj gtk version
+# In the automake build, we have to do the whole job by supplying
+# extra CFLAGS, so we have to put the if statement inside one big
+# backtick expression. We also force rebuilding via a -D option that
+# makes version.o include empty.h, which we construct ourselves and
+# touch whenever any source file is updated.
+!cflags am version $(VER) -DINCLUDE_EMPTY_H `if test -z "$(VER)" && (cd $(srcdir)/..; md5sum -c manifest >/dev/null 2>&1); then cat $(srcdir)/../version.def; else echo "$(VER)"; fi`
+!begin am
+BUILT_SOURCES = empty.h
+empty.h: $(allsources)
+ echo '/* Empty file touched by automake makefile to force rebuild of version.o */' >$@
+
+!end
+!begin >empty.h
+/* Empty file touched by automake makefile to force rebuild of version.o */
+!end
+
+# Add VER to Windows resource targets, and force them to be rebuilt every
+# time, on the assumption that they will contain version information.
+!begin vc vars
+CFLAGS = $(CFLAGS) /DHAS_GSSAPI /DSECURITY_WIN32
+RCFLAGS = $(RCFLAGS) $(VER)
+!end
+!begin cygwin vars
+# XXX GNU-ism, but it's probably all right for a Cygwin/MinGW Makefile.
+RCFLAGS += $(patsubst -D%,--define %,$(VER))
+!end
+!begin borland vars
+# Borland doesn't support +=. This probably shouldn't work, but seems to.
+RCFLAGS = $(RCFLAGS) $(VER)
+!end
+!begin lcc vars
+RCFLAGS += $(VER)
+!end
+!forceobj putty.res
+!forceobj puttytel.res
+!forceobj plink.res
+!forceobj pscp.res
+!forceobj psftp.res
+!forceobj pageant.res
+!forceobj puttygen.res
+
+# `make install' target for Unix.
+!begin gtk
+install:
+ mkdir -p $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir)
+ $(INSTALL_PROGRAM) -m 755 plink $(DESTDIR)$(bindir)/plink
+ $(INSTALL_PROGRAM) -m 755 pscp $(DESTDIR)$(bindir)/pscp
+ $(INSTALL_PROGRAM) -m 755 psftp $(DESTDIR)$(bindir)/psftp
+ $(INSTALL_PROGRAM) -m 755 pterm $(DESTDIR)$(bindir)/pterm
+ if test -n "$(UTMP_GROUP)"; then \
+ chgrp $(UTMP_GROUP) $(DESTDIR)$(bindir)/pterm && \
+ chmod 2755 $(DESTDIR)$(bindir)/pterm; \
+ elif test -n "$(UTMP_USER)"; then \
+ chown $(UTMP_USER) $(DESTDIR)$(bindir)/pterm && \
+ chmod 4755 $(DESTDIR)$(bindir)/pterm; \
+ fi
+ $(INSTALL_PROGRAM) -m 755 putty $(DESTDIR)$(bindir)/putty
+ $(INSTALL_PROGRAM) -m 755 puttygen $(DESTDIR)$(bindir)/puttygen
+ $(INSTALL_PROGRAM) -m 755 puttytel $(DESTDIR)$(bindir)/puttytel
+ $(INSTALL_DATA) -m 644 ../doc/plink.1 $(DESTDIR)$(man1dir)/plink.1
+ $(INSTALL_DATA) -m 644 ../doc/pscp.1 $(DESTDIR)$(man1dir)/pscp.1
+ $(INSTALL_DATA) -m 644 ../doc/psftp.1 $(DESTDIR)$(man1dir)/psftp.1
+ $(INSTALL_DATA) -m 644 ../doc/pterm.1 $(DESTDIR)$(man1dir)/pterm.1
+ $(INSTALL_DATA) -m 644 ../doc/putty.1 $(DESTDIR)$(man1dir)/putty.1
+ $(INSTALL_DATA) -m 644 ../doc/puttygen.1 $(DESTDIR)$(man1dir)/puttygen.1
+ $(INSTALL_DATA) -m 644 ../doc/puttytel.1 $(DESTDIR)$(man1dir)/puttytel.1
+
+install-strip:
+ $(MAKE) install INSTALL_PROGRAM="$(INSTALL_PROGRAM) -s"
+!end
+!begin osx vars
+CFLAGS += -DMACOSX
+!end
+
+# List the man pages for the automake makefile.
+!begin am
+man1_MANS = ../doc/plink.1 ../doc/pscp.1 ../doc/psftp.1 ../doc/pterm.1 \
+ ../doc/putty.1 ../doc/puttygen.1 ../doc/puttytel.1
+!end
+
+# In automake, chgrp/chmod pterm after installation, if configured to.
+!begin am
+if HAVE_SETID_CMD
+install-exec-local:
+ @SETID_CMD@ $(bindir)/pterm
+ chmod @SETID_MODE@ $(bindir)/pterm
+endif
+!end
+
+# Random symbols.
+!begin cygwin vars
+# _WIN32_IE is required to expose identifiers that only make sense on
+# systems with IE5+ installed, such as some arguments to SHGetFolderPath().
+# WINVER etc perform a similar function for FlashWindowEx().
+CFLAGS += -D_WIN32_IE=0x0500
+CFLAGS += -DWINVER=0x0500 -D_WIN32_WINDOWS=0x0410 -D_WIN32_WINNT=0x0500
+!end
+
+# ------------------------------------------------------------