Add Windows (MSYS2/MinGW) build support and docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
pepaskopec-blip 2026-09-10 08:51:57 +02:00
commit 35695f97d0
2 changed files with 38 additions and 2 deletions

View file

@ -16,7 +16,15 @@ GTK_LIBS := $(shell $(PKG_CONFIG) --libs gtk4)
CFLAGS = -Wall -Wextra -Wno-deprecated-declarations $(GTK_CFLAGS) CFLAGS = -Wall -Wextra -Wno-deprecated-declarations $(GTK_CFLAGS)
LIBS = $(GTK_LIBS) -lm LIBS = $(GTK_LIBS) -lm
# Windows (MSYS2 / MinGW): .exe suffix and no console window for the GUI.
ifeq ($(OS),Windows_NT)
TARGET = maturita.exe
LIBS += -mwindows
else
TARGET = maturita TARGET = maturita
endif
SRC = maturita.c SRC = maturita.c
all: $(TARGET) all: $(TARGET)
@ -25,7 +33,7 @@ $(TARGET): $(SRC)
$(CC) $(CFLAGS) -o $(TARGET) $(SRC) $(LIBS) $(CC) $(CFLAGS) -o $(TARGET) $(SRC) $(LIBS)
clean: clean:
rm -f $(TARGET) rm -f $(TARGET) maturita.exe
run: $(TARGET) run: $(TARGET)
./$(TARGET) ./$(TARGET)

View file

@ -72,7 +72,7 @@ GTK 4 interface.
- **language**: Czech or English, applied instantly without a restart - **language**: Czech or English, applied instantly without a restart
- all three preferences are stored in `progress/settings.conf` - all three preferences are stored in `progress/settings.conf`
- **Keyboard quit shortcuts** – `Super/Cmd+Q` or `Alt+F4` closes the app - **Keyboard quit shortcuts** – `Super/Cmd+Q` or `Alt+F4` closes the app
- Single-file C codebase, cross-platform (Linux and macOS supported) - Single-file C codebase, cross-platform (Linux, macOS and Windows)
## Installation ## Installation
@ -104,6 +104,17 @@ Linux (Arch):
sudo pacman -S gtk4 sudo pacman -S gtk4
``` ```
Windows (MSYS2) – install [MSYS2](https://www.msys2.org/), then open the
**UCRT64** shell (not the plain “MSYS” one) and run:
```bash
pacman -S mingw-w64-ucrt-x86_64-gtk4 mingw-w64-ucrt-x86_64-toolchain \
mingw-w64-ucrt-x86_64-pkgconf make
```
If you prefer the older MINGW64 environment instead of UCRT64, use the
`mingw-w64-x86_64-…` package names and open the **MINGW64** shell.
#### 2. Build tools (compiler, Make, pkg-config) #### 2. Build tools (compiler, Make, pkg-config)
macOS – install all of these explicitly, they are **not** preinstalled: macOS – install all of these explicitly, they are **not** preinstalled:
@ -134,6 +145,10 @@ sudo dnf install pkgconf-pkg-config
sudo pacman -S base-devel pkgconf sudo pacman -S base-devel pkgconf
``` ```
Windows – the `pacman` command above already installs GCC, Make and
pkgconf inside the UCRT64/MINGW64 environment. Always build and run from
that shell so the MinGW `PATH` (and GTK DLLs) are available.
### Building the Application ### Building the Application
1. Clone or download this repository 1. Clone or download this repository
@ -147,7 +162,11 @@ make
Or manually: Or manually:
```bash ```bash
# Linux / macOS
gcc -o maturita maturita.c `pkg-config --cflags --libs gtk4` -lm gcc -o maturita maturita.c `pkg-config --cflags --libs gtk4` -lm
# Windows (MSYS2 UCRT64 / MINGW64)
gcc -o maturita.exe maturita.c `pkg-config --cflags --libs gtk4` -lm -mwindows
``` ```
### Running the Application ### Running the Application
@ -159,9 +178,18 @@ make run
or or
```bash ```bash
# Linux / macOS
./maturita ./maturita
# Windows (from the same MSYS2 MinGW shell used to build)
./maturita.exe
``` ```
On Windows, run the binary from the UCRT64/MINGW64 shell (or copy the
required GTK DLLs next to `maturita.exe`). Double-clicking the `.exe`
from Explorer usually fails with a missing-DLL error unless those
libraries are on `PATH`.
## Usage ## Usage
When launched, the application shows the welcome screen. From there: When launched, the application shows the welcome screen. From there: