From 887b8f3aa3eae2797c247e30f42bdb4b23d9f70b Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Tue, 28 Apr 2026 09:44:34 +0200 Subject: [PATCH] build: evita crear fitxer 'NUL' a Windows quan Make corre dins MSYS/MinGW --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a0f84c3..b24b078 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,15 @@ BUILDDIR := build # (que requereix Visual Studio); forcem MinGW Makefiles per usar el g++ de # MinGW. nproc tampoc existeix en cmd.exe → fem servir NUMBER_OF_PROCESSORS. ifeq ($(OS),Windows_NT) - NULDEV := NUL + # Si Make corre dins MSYS2/Git Bash/MinGW, $(shell ...) usa sh.exe i + # "NUL" NO és dispositiu — un redirect "2>NUL" crearia un fitxer literal + # anomenat NUL al cwd (i en Windows es complica esborrar-lo). Detectem + # MSYSTEM per usar /dev/null en aquests entorns; només cmd.exe pur necessita NUL. + ifneq ($(MSYSTEM),) + NULDEV := /dev/null + else + NULDEV := NUL + endif JOBS ?= $(NUMBER_OF_PROCESSORS) # Si Ninja està al PATH, l'usem (més ràpid i paral·lelitza millor). # Si no, caiem a MinGW Makefiles. Sense aquesta selecció CMake