Skip to content

Commit

Permalink
Minor GNUmakefile cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisd1100 committed May 15, 2023
1 parent 510c22b commit 7669a78
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ FLAGS = \
-fPIC

ifdef DEBUG
FLAGS := $(FLAGS) -O0 -g
FLAGS := $(FLAGS) -O0 -g3
DEFS := $(DEFS) -DMTY_VK_DEBUG
else
FLAGS := $(FLAGS) -O3 -g0 -fvisibility=hidden
Expand All @@ -73,11 +73,13 @@ endif
# github.com/WebAssembly/wasi-sdk/releases -> ~/wasi-sdk

ifdef WASM

WASI_SDK = $(HOME)/wasi-sdk

CC = $(WASI_SDK)/bin/clang
AR = $(WASI_SDK)/bin/ar

TARGET = web
ARCH := wasm32

OBJS := $(OBJS) \
Expand Down Expand Up @@ -106,15 +108,17 @@ DEFS := $(DEFS) \
-DMTY_GL_EXTERNAL \
-DMTY_GL_ES

TARGET = web
INCLUDES := $(INCLUDES) -Isrc/unix/web
INCLUDES := $(INCLUDES) \
-Isrc/unix/web

else
#############
### LINUX ###
#############
ifeq ($(UNAME_S), Linux)

TARGET = linux

ifdef STEAM
WEBVIEW_OBJ = src/swebview.o
else
Expand Down Expand Up @@ -156,8 +160,10 @@ SHADERS = \
DEFS := $(DEFS) \
-DMTY_VK_XLIB

TARGET = linux
INCLUDES := $(INCLUDES) -Isrc/unix/linux -Isrc/unix/linux/x11
INCLUDES := $(INCLUDES) \
-Isrc/unix/linux \
-Isrc/unix/linux/x11

endif

#############
Expand Down Expand Up @@ -222,7 +228,10 @@ FLAGS := $(FLAGS) \
-isysroot $(shell xcrun --sdk $(TARGET) --show-sdk-path) \
-arch $(ARCH)

INCLUDES := $(INCLUDES) -Isrc/unix/apple -Isrc/unix/apple/$(TARGET)
INCLUDES := $(INCLUDES) \
-Isrc/unix/apple \
-Isrc/unix/apple/$(TARGET)

endif
endif

Expand Down Expand Up @@ -265,7 +274,6 @@ clean: clean-build
clean-build:
@rm -rf bin
@rm -f $(OBJS)
@rm -f $(NAME).so

clear:
@clear

0 comments on commit 7669a78

Please sign in to comment.