spiegel-keyman/windows/src/engine/Makefile
Marc Durdin c66eb49163 fix(windows): Start Keyman on Demand - keyman32
This is the first half of a two-part update to Keyman for Windows. There
are two significant changes here. These changes apply to
keyman32/keyman64, as well as kmtip/kmtip64, but will refer to the
32-bit equivalents for simplicity:

1. Instead of using `GetProcAddress` to connect to keyman32.dll, we
   now have an import library connection. This removes one particularly
   suspect piece of architecture for Keyman, as using `GetProcAddress`
   could lead to a race condition, where keyman32.dll is unloaded after
   that function is called but before we use the handle. This makes the
   kmtip.dll build dependent on keyman32.dll; loading kmtip.dll (by
   selecting a Keyman input method) also loads keyman32.dll.

2. It's not enough (yet) to load kmtip.dll. We also need to be running
   keyman.exe itself, due to global hooks that we still require (it may
   be possible, one day, to avoid these, but it doesn't look very
   hopeful). To that end, kmtip calls new function `TIPIsKeymanRunning`
   to check whether keyman32.dll is initialised (and hence keyman.exe
   has initialised it). Then, if keyman.exe is not running, it issues an
   event to the Windows Event Log, which we will pick up with a
   scheduled task in the next PR.

The first part of this is an architectural change which may lead to some
change in behaviours, as keyman32.dll now may not be unloaded from a
process when keyman.exe exits, due to the lock that kmtip.dll now has on
it. It will be important to test this (@MakaraSok) by running through
various startup and shutdown scenarios. In my initial testing, I found
that there were some situations after restarting keyman.exe where I
needed to switch in and out of the Keyman TIP, but those were not all
critical.

This change also lays groundwork for an eventual ability to run the
Keyman input method without keyman.exe running, which will be helpful
e.g. on login screen, even if missing certain additional functionality
such as the serialised input queue.
2020-10-28 06:10:22 +11:00

102 lines
2.2 KiB
Makefile

#
# Keyman Engine Makefile
#
# ----------------------------------------------------------------------
TARGETS=keymanmc keyman32 kmcomapi keyman tsysinfox64 tsysinfo keyman64 keymanx64 mcompile inst kmtip
MANIFESTS=keyman tsysinfo tsysinfox64 keymanx64 mcompile
CLEANS=clean-engine
!include ..\Header.mak
# ----------------------------------------------------------------------
keyman: redist
cd $(ROOT)\src\engine\keyman
$(MAKE) $(TARGET)
kmcomapi:
cd $(ROOT)\src\engine\kmcomapi
$(MAKE) $(TARGET)
keymanmc:
cd $(ROOT)\src\engine\keymanmc
$(MAKE) $(TARGET)
keyman32-build:
cd $(ROOT)\src\engine\keyman32
$(MAKE) build
keyman32-signcode:
cd $(ROOT)\src\engine\keyman32
$(MAKE) signcode
keyman32-install:
cd $(ROOT)\src\engine\keyman32
$(MAKE) install
keyman32:
cd $(ROOT)\src\engine\keyman32
$(MAKE) $(TARGET)
tsysinfox64:
cd $(ROOT)\src\engine\tsysinfox64
$(MAKE) $(TARGET)
tsysinfo: tsysinfox64
cd $(ROOT)\src\engine\tsysinfo
$(MAKE) $(TARGET)
keymanx64:
cd $(ROOT)\src\engine\keymanx64
$(MAKE) $(TARGET)
keyman64:
cd $(ROOT)\src\engine\keyman64
$(MAKE) $(TARGET)
keyman64-build:
cd $(ROOT)\src\engine\keyman64
$(MAKE) build
keyman64-signcode:
cd $(ROOT)\src\engine\keyman64
$(MAKE) signcode
keyman64-install:
cd $(ROOT)\src\engine\keyman64
$(MAKE) install
mcompile:
cd $(ROOT)\src\engine\mcompile
$(MAKE) $(TARGET)
kmtip:
cd $(ROOT)\src\engine\kmtip
$(MAKE) $(TARGET)
# ----------------------------------------------------------------------
redist:
copy $(ROOT)\src\ext\sentry\sentry.dll $(ROOT)\bin\engine
copy $(ROOT)\src\ext\sentry\sentry.x64.dll $(ROOT)\bin\engine
copy $(ROOT)\src\ext\sentry\crashpad_handler.exe $(ROOT)\bin\engine
# ----------------------------------------------------------------------
inst: redist
cd $(ROOT)\src\engine\inst
$(MAKE) $(TARGET)
# ----------------------------------------------------------------------
clean-engine:
cd $(ROOT)\src\engine
-del version.txt
!include ..\Target.mak
# ----------------------------------------------------------------------
# EOF
# ----------------------------------------------------------------------