# Part of JoeyLib, Copyright (c) 2026 Scott Duensing, under the MIT License. # See LICENSE.md for license information. # SPDX-License-Identifier: MIT # # Win32 build rules: JoeyLib programs as Windows programs, through the hosted # core and its Win32 backend (src/hosted, src/hosted/win32), for Windows 95, # 98, ME, NT 4 and 2000 and everything since. The rules are make/hosted.mk's; # this file says what is the Win32 port's. A project reaches it through # make/project.mk. # # Built with llvm-mingw's i686 clang against MSVCRT.DLL (the installer's # llvmMingw component): a 32-bit GUI program NAME.EXE, in bin/ or in its own # bin/NAME/ with its DATA beside it, linked statically so it needs nothing # but the system's own DLLs. The port makes the program's folder the current # directory when the window opens. PLATFORM := win32 include $(dir $(lastword $(MAKEFILE_LIST)))/common.mk $(call requireTool,$(WIN32_CC),toolchain:win32) HOSTED_CC := $(WIN32_CC) HOSTED_AR := $(WIN32_AR) HOSTED_BACKEND := win32 HOSTED_DEFINES := -DJOEYLIB_PLATFORM_HOSTED -DJOEYLIB_HOSTED_WIN32 # The set-1 scan code table the DOS port reads its keys through. HOSTED_SDK_CFLAGS := -I$(SRC_X86) # Subsystem and OS version 4.0 in the PE header: Windows 95, 98 and NT 4 # refuse to load anything marked newer (the default is 6.0, Vista). HOSTED_LINK := -mwindows -static -lwinmm -lgdi32 -Wl,--subsystem,windows:4.0 -Wl,--major-os-version,4 -Wl,--minor-os-version,0 PROGRAM_EXT := .EXE # Its icon, the one Explorer and the window show: 16, 32 and 48 pixels, each # in 256 colours and in 32-bit, compiled into a resource object it links. WIN32_WINDRES := $(patsubst %-clang,%-windres,$(WIN32_CC)) HOSTED_ICON = $(call programIconDir,$(1))/icon.o HOSTED_ICON_BAKE = $(call hostedIconScript,$(1),ico) && $(WIN32_WINDRES) $(call programIconDir,$(1))/icon.rc -o $(call HOSTED_ICON,$(1)) HOSTED_ICON_LINK = $(call HOSTED_ICON,$(1)) include $(REPO_DIR)/make/hosted.mk # UBER's probe build is part of JoeyLib's own `all` # (scripts/verify-win32-display.sh). ifndef JOEY_PROJECT all $(PLATFORM): $(call programTarget,UBERPROB) endif