From cc6a1fb70034b8abb01738ef634e66b75d7dcb4a Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 25 Sep 2023 21:36:03 +0200 Subject: [PATCH] Fix build, try to guess target type Signed-off-by: falkTX --- Makefile | 20 ++++++++++++++++++-- PawPaw | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 981dd50..d8ea74b 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,21 @@ - -PAWPAW_TARGET = linux-x86_64 +#!/usr/bin/make -f + +CC ?= gcc +TARGET_MACHINE := $(shell $(CC) -dumpmachine) + +ifeq ($(PAWPAW_TARGET),) +ifneq (,$(findstring linux,$(TARGET_MACHINE))) +PAWPAW_TARGET = linux-$(uname -m) +else ifneq (,$(findstring apple,$(TARGET_MACHINE))) +PAWPAW_TARGET = macos-universal +else ifneq (,$(findstring mingw,$(TARGET_MACHINE))) +PAWPAW_TARGET = win64 +else ifneq (,$(findstring wasm,$(TARGET_MACHINE))) +PAWPAW_TARGET = wasm +else +$(error unknown target, cannot continue) +endif +endif ifeq ($(PAWPAW_TARGET),macos-universal) APP_EXT = diff --git a/PawPaw b/PawPaw index 0c27aa9..9726a11 160000 --- a/PawPaw +++ b/PawPaw @@ -1 +1 @@ -Subproject commit 0c27aa9f2200a3a3bfb894b5244b9be1566022a9 +Subproject commit 9726a11f2e96f1c6d47412e1b76b5759e913667b