Commit Graph

23 Commits

Author SHA1 Message Date
Ryan Prichard
d984413c0a Rename the UNIX adapter from console.exe to winpty.exe.
There are three reasons for this change:

 * It's consistent with MSYS2, which already renamed console.exe to
   winpty.exe.

 * winpty.exe is less likely to clash with another program.

 * winpty.exe is easier to search for online.  If someone unfamiliar with
   winpty is asked to run console.exe, they might have a hard time figuring
   out where console.exe comes from.

The old behavior can be restored by passing UNIX_ADAPTER_EXE=console.exe
to `make`, or by simply renaming the binary after-the-fact, or with
`alias`, etc.
2016-04-05 02:43:13 -05:00
Ryan Prichard
bb23f63b34 Install dev files (importlib, headers) and docs, localize PHONY deps 2016-04-05 02:43:12 -05:00
Ryan Prichard
adc1a5adbf Use precompiled headers when compiling with GCC.
The unix-adapter doesn't use PCH, because MSYS1's compiler doesn't support
them.
2016-02-29 04:33:42 -06:00
Ryan Prichard
fd270915c1 Compile each target's source files separately from other targets.
The gyp file already worked this way, but now the Makefile does too.

The motivation is to let the shared source files have different error
handling behavior (e.g. assert/ASSERT/stderr-print/abort/exception) in
winpty.dll and the other targets.
2016-02-29 04:16:04 -06:00
Ryan Prichard
bce511725a Add a clean-msvs target for cleaning up after gyp and VisualStudio/msbuild 2016-02-29 04:16:03 -06:00
Ryan Prichard
e390c8775c Try to fix an issue where make fails if a header file disappears
Currently, when a header file is removed (or renamed), there is a stale
dependency file still referring to the header, and GNU make aborts, because
the header is missing.  Attempt to work around this by adding a pattern
rule to generate any header in `src/`.  The rule prints a warning message.

The C source file whose header was missing will be recompiled because a
dependency was rebuilt.  Once it is, the removed header should be removed
from the dependency file.

(Aside: FWIW, the "ninja" build tool knows directly about depfiles, and it
does not have this problem.)
2016-02-29 02:58:30 -06:00
Ryan Prichard
483aeffee6 Makefile: stop reading environ variables and avoid spawning processes
The variables can be specified on the make command-line instead, and the
user could have unrelated variables that happen to have the name winpty
is using.

I verified that MSYS2 is passing UNIX_ADAPTER_EXE and PREFIX on the
command-line.  ship/ship.py already passes PREFIX on the command-line.

Previously, for each object file, the Makefile spawned a subprocess for
each of: echo, mkdir, dirname, and git.  Most of these can be eliminated:

 - echo: The gmake function $(info ...) is mostly good enough -- it
   affects the --dry-run/-n output, which might be undesired.

 - mkdir: We only need to invoke mkdir once per directory.  It's tricky
   to get the optimal behavior, but it's possible to do better than before.

 - dirname: The gmake function $(dir ...) is good enough.

 - git: only needed once per build, to get the commit hash.
2016-02-26 04:21:22 -06:00
Ryan Prichard
97e1bd2661 Enable C++11 mode and re-enable C++ exception handling. 2016-02-26 01:20:31 -06:00
Ryan Prichard
0fb98c03fa Recompile everything if VERSION.txt changes
The contents of that file are included on the compiler command-line for
every file.
2015-12-28 21:57:11 -06:00
Ryan Prichard
95aff6bc69 Move source files into a src subdirectory.
Fixes https://github.com/rprichard/winpty/issues/51
2015-11-29 03:50:06 -06:00
Ryan Prichard
d21d0d0598 Add an "implicit copyright grant" notice; update copyright notices 2015-11-08 00:37:25 -06:00
Ryan Prichard
7b7192e441 Add version tracking. Add a --version arg to console and winpty-agent.
There is a "version suffix" that defaults to "-dev".  A maintainer could
change the suffix (or remove it) by invoking make:

    make BUILD_SUFFIX=-foo
    make BUILD_SUFFIX=

It can also be changed in gyp builds:

    gyp winpty.gyp --depth=1 -D BUILD_SUFFIX=-foo
    gyp winpty.gyp --depth=1 -D BUILD_SUFFIX=

If git cannot be executed, the string "none" is used for the commit hash.
2015-11-07 21:19:03 -06:00
Ryan Prichard
52b11bfba9 Convert the makefiles from recursive to non-recursive
* This change reduces the total build time from about 14 seconds to about
   9 seconds on my computer.

Also:

 * Consolidate all the intermediate files into the build directory to
   reduces clutter.

 * Allow specifying UNIX_ADAPTER_EXE to make.  Perhaps this will be helpful
   to the MSYS2 fork, which renames console.exe to winpty.exe.  (I like
   the renaming, but I don't know about the other winpty users.  Maybe
   I'll make the change after I've put out another stable release...)

 * Rename the WINPTY define to COMPILING_WINPTY_DLL define.  The longer
   name is clearer.  I define the macro inside libwinpty/winpty.cc, so the
   build system no longer needs to.  (I removed the define from
   winpty.gyp.)

 * Consolidate config-unix.mk and config-mingw.mk into config.mk.  The
   separation was previously necessary because each file had a conflicting
   definition of CXX.

 * Rename the UNIX_LDFLAGS_STATIC_LIBSTDCXX macro to UNIX_LDFLAGS_STATIC,
   because libstdc++ isn't the only thing I'm linking statically.
2015-11-06 22:08:24 -06:00
Ryan Prichard
4fbda64b7e List "make install" files explicitly and use install tool
* Previously, "make tests install" would also copy trivial_test.exe and
   trivial_test.d to /usr/local/bin.

 * The `install` tool seems to be the conventional way of installing files.
   Setting permissions when copying to /usr/local/bin seems like a good
   idea.

 * Invoke install with -s to strip the symbol tables when they're
   installed.
2015-10-15 16:47:00 -05:00
Ryan Prichard
db12b07706 Add winpty-debugserver.exe and document debugging environment variables. 2015-10-01 03:17:38 -05:00
Ryan Prichard
e123a4e7c8 Add a test program. 2015-08-23 16:02:23 -07:00
Josh Holtrop
31798422d2 add "install" Makefile target 2012-07-11 14:50:51 -04:00
Ryan Prichard
9b66d2cb9c Add a distclean target that removes the files configure creates. 2012-04-17 09:50:19 -07:00
Ryan Prichard
71aa4a59bb Rename pconsole to winpty.
* This avoids a name conflict with an existing unrelated project.

 * I think winpty is a better name anyway.  (i) It's more obviously
   Windows-related.  (ii) I think it more accurately describes what it
   does.  A "pseudo-console" ought to mirror the console API and allow
   replacing the implementation built-in to Windows.  This project is only
   trying to provide functionality similar to using the master interface of
   a Unix pty, but for native console programs.
2012-03-25 02:29:37 -07:00
Ryan Prichard
44554d5e9d Add an MIT copyright notice to all the source files. 2012-03-23 03:11:34 -07:00
Ryan Prichard
19d9c1832c Add a Unix pty<->pconsole adapter. 2012-01-28 14:23:31 -08:00
Ryan Prichard
7e4c06c2e1 Rename Agent to agent. 2012-01-21 17:32:26 -08:00
Ryan Prichard
a4df196ed4 Work on switching from qmake to makefiles and reorganize code a little.
My plan now is to integrate the PseudoConsole with Cygwin and MSYS ptys,
with initial focus on Cygwin.  I think I'll keep the separate Agent and DLL
binaries, and they'll continue to be native Win32 binaries.  I don't want
to have two build systems (qmake vs whatever MSYS/Cygwin uses), and since
I'd like to remove the Qt dependency anyway, I'm trying to switch to
makefiles.
2012-01-21 17:30:41 -08:00