Skip to content

Commit

Permalink
Fix build, try to guess target type
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Sep 25, 2023
1 parent 1a85a16 commit cc6a1fb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
20 changes: 18 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion PawPaw

0 comments on commit cc6a1fb

Please sign in to comment.