diff options
| author | Lena <lena@omega> | 2026-01-01 00:00:00 +0000 |
|---|---|---|
| committer | Lena <lena@omega> | 2026-01-01 00:00:00 +0000 |
| commit | 2fa72ee0dc67d973330aec4ba98260e9f57f7821 (patch) | |
| tree | e6a25c07c8da61d29e4e1f8a72436565e63c5777 /Makefile.win | |
| download | mouseboard-master.tar.gz | |
Keyboard-only pointing: a labelled grid over every monitor, type a
label to jump to a cell, bisect it by quadrant until the crosshair is
exact, then one key clicks. The coarse grid keeps labels short and
bisection keeps precision unlimited, so a hotkey and a few keystrokes
replace the mouse.
The core talks only to the backend interface in platform.h; wlroots
Wayland and Win32 backends supply the overlay, keyboard grab and
pointer.
Diffstat (limited to 'Makefile.win')
| -rw-r--r-- | Makefile.win | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Makefile.win b/Makefile.win new file mode 100644 index 0000000..fffe03f --- /dev/null +++ b/Makefile.win @@ -0,0 +1,51 @@ +# Makefile.win - cross-compile the Windows build with mingw-w64. +# +# Links the Win32 backend instead of the Wayland one (no protocols, no +# wayland-scanner, no pkg-config). Produces a single static mouseboard.exe. +# +# make -f Makefile.win # x86_64 +# make -f Makefile.win CC=i686-w64-mingw32-gcc # 32-bit +# +# Needs a mingw-w64 cross toolchain on the build host: +# Debian / Ubuntu : sudo apt install gcc-mingw-w64-x86-64 +# Arch : sudo pacman -S mingw-w64-gcc +# Fedora : sudo dnf install mingw64-gcc +# +# Built for the GUI subsystem (-mwindows) so launching it - e.g. from a hotkey - +# creates no console window. The backend still calls AttachConsole() at startup, +# so --help / --dry-run / --selftest output appears when run from a terminal. + +VERSION = 0-dev + +# Unconditional: make predefines CC=cc, which ?= would keep, silently +# building with the host compiler. `make -f Makefile.win CC=...` still wins. +CC = x86_64-w64-mingw32-gcc +CFLAGS ?= -std=c11 -Wall -Wextra -O2 +override CPPFLAGS += -DMOUSEBOARD_VERSION='"$(VERSION)"' +# -s strips at link: no symbols in the shipped exe. +MB_LDFLAGS = -static -mwindows -s +MB_LDLIBS = -lgdi32 -luser32 + +# Distinct object names: the Linux Makefile compiles main.o etc. with the +# host cc, and sharing names would link objects from the wrong compiler when +# switching builds without a clean. +OBJ = main.win.o core.win.o config.win.o draw.win.o font.win.o \ + backend-windows.win.o + +# font8x8_basic.h is vendored verbatim; its 0xFF rows overflow signed char. +font.win.o: override CFLAGS += -Wno-overflow + +mouseboard.exe: $(OBJ) + $(CC) $(CFLAGS) $(LDFLAGS) $(MB_LDFLAGS) -o $@ $(OBJ) \ + $(LDLIBS) $(MB_LDLIBS) + +# Every object depends on every header: over-rebuilds a little, never stale. +$(OBJ): config.h core.h draw.h font.h platform.h font8x8_basic.h + +%.win.o: %.c + $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< + +clean: + rm -f mouseboard.exe $(OBJ) + +.PHONY: clean |