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