From 4bb135bc104adcef1bea79726b8a6e5d6c73449f Mon Sep 17 00:00:00 2001 From: Nicholas Tay Date: Sat, 6 Apr 2024 21:11:37 +1100 Subject: Support win32 mingw cross-compile in make Required a slight mod to Windows.h to be lower case so it works on Linux mingw. Turns out it's case-insensitive on Windows MSVC/MSYS. --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 947ba94..6a6a2b7 100644 --- a/Makefile +++ b/Makefile @@ -4,11 +4,16 @@ PREFIX = $(HOME)/.local CC = gcc CFLAGS += -std=c99 -Wall -Wextra -Wshadow -pedantic +CC_WIN32 = i686-w64-mingw32-gcc + default: $(NAME) $(NAME): $(NAME).c config.h $(CC) $(CFLAGS) -o $(NAME) $(NAME).c +$(NAME).exe: $(NAME).c config.h + $(CC_WIN32) $(CFLAGS) -o $(NAME).exe $(NAME).c + install: $(NAME) install -d $(DESTDIR)$(PREFIX)/bin/ install -m 755 $(NAME) $(DESTDIR)$(PREFIX)/bin/ -- cgit