joeylib2/make/win32.mk
2026-10-13 14:01:46 -05:00

34 lines
1.6 KiB
Makefile

# 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)
$(call requireTool,$(LIBXMP_DIR)/include/libxmp-lite/xmp.h,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
include $(REPO_DIR)/make/hosted.mk