Adjust build for Linux

This commit is contained in:
2022-04-04 18:17:32 +02:00
parent b55b9b3138
commit c77e90ab76
6 changed files with 28 additions and 63 deletions

View File

@@ -1,20 +1,17 @@
VERBOSE_BUILD := false
IsMinGW := $(findstring MINGW,$(shell uname -s)) $(findstring MSYS,$(shell uname -s))
IsDarwin := $(findstring Darwin,$(shell uname -s))
ifneq (,$(IsMinGW))
HOST_ARCH :=
HOST_OS := $(shell uname -o )
HOST_KERNEL := $(shell uname -s )
ifeq ($(HOST_OS),Msys)
HOST_ARCH := mingw
else
ifneq (,$(IsDarwin))
HOST_ARCH := macosx
else
endif
ifeq ($(HOST_KERNEL),Linux)
HOST_ARCH := linux
endif
endif
ifeq ($(arch),emscripten)
HOST_ARCH := emscripten
ifeq ($(HOST_KERNEL),Darwin)
HOST_ARCH := macosx
endif
@@ -31,7 +28,7 @@ ifeq ($(HOST_ARCH),mingw)
LDFLAGS := -g -mwindows -D_GNU_SOURCE=1
RES_GAMELIB := libgame.a
BUILDDIR := build-$(shell gcc -v 2>&1 | grep "Target:" | cut --delimiter=' ' --fields=2)
BUILDDIR := build-$(shell gcc -dumpmachine )
endif
ifeq ($(HOST_ARCH),linux)
CC := gcc
@@ -47,7 +44,7 @@ ifeq ($(HOST_ARCH),linux)
RES_GAMELIB := libgame.a
RES_GAME := game
BUILDDIR := build-$(shell gcc -v 2>&1 | grep "Target:" | cut --delimiter=' ' --fields=2)
BUILDDIR := build-$(shell gcc -dumpmachine )
endif
ifeq ($(HOST_ARCH),macosx)
CC := gcc
@@ -62,18 +59,15 @@ ifeq ($(HOST_ARCH),macosx)
LDFLAGS :=
RES_GAMELIB := libgame.a
BUILDDIR := build-$(shell gcc -v 2>&1 | grep "Target:" | cut -d ' ' -f 2)
BUILDDIR := build-$(shell gcc -dumpmachine )
endif
ifeq ($(HOST_ARCH),emscripten)
ifeq ($(arch),emscripten)
CC := emcc
AR := emar
LAUNCHER := emrun --port 8080
RM := rm -rf
MKDIR := mkdir
ECHO := echo
LIBS :=
CFLAGS := -s FULL_ES2=1 -s ASM_JS=1 -s USE_SDL=2 -O2 -Wno-implicit-function-declaration -DEMSCRIPTEN
CFLAGS := -s USE_SDL=2 -O2 -Wno-implicit-function-declaration -DEMSCRIPTEN
LDFLAGS := --preload-file data -s TOTAL_MEMORY=134217728 -lidbfs.js
RES_GAMELIB := libgame.a