Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (47 loc) · 1.58 KB
/
Copy pathMakefile
File metadata and controls
60 lines (47 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Usage:
# make build-odin // build odin compiler (odin executable in vendor/odin)
# make | make release | make debug // build iris and libs
# make clean // removes iris and lib artifacts
NAME := iris
ODIN := ./vendor/odin/odin
UNAME_OS := $(shell uname)
UNAME_ARCH := $(shell uname -m)
MINIAUDIO_LIB := ./vendor/odin/vendor/miniaudio/lib/miniaudio.a
RAYLIB_LIB := ./vendor/raylib/src/libraylib.a
ifeq ($(UNAME_OS),Linux)
OS := linux
ifeq ($(UNAME_ARCH),aarch64) # assuming arm64 linux is raspberry pi
RAYLIB_BUILD_FLAGS ?= PLATFORM=PLATFORM_DRM GRAPHICS=GRAPHICS_API_OPENGL_ES3
EXTRA_FLAGS += -extra-linker-flags="-ldrm -lgbm -lEGL -lGLESv2" -define:PLATFORM_RASPBERRY_PI=true
endif
endif
ifeq ($(UNAME_OS),Darwin)
OS := macos
endif
all: release
build-odin:
$(MAKE) -C vendor/odin release-native
$(MINIAUDIO_LIB):
@echo --- Building miniaudio...
$(MAKE) -C vendor/odin/vendor/miniaudio/src
$(RAYLIB_LIB):
@echo --- Building raylib...
$(MAKE) -C vendor/raylib/src $(RAYLIB_BUILD_FLAGS)
cp $(RAYLIB_LIB) vendor/odin/vendor/raylib/$(OS)/libraylib.a
BUILD_CMD := mkdir -p ./out && $(ODIN) build src -out:out/$(NAME) $(EXTRA_FLAGS)
debug: $(MINIAUDIO_LIB) $(RAYLIB_LIB)
@echo --- Building iris...
$(BUILD_CMD) -debug
release: $(MINIAUDIO_LIB) $(RAYLIB_LIB)
@echo --- Building iris...
$(BUILD_CMD)
@echo --- Done!
clean:
@echo --- Removing miniaudio artifacts...
rm -f $(MINIAUDIO_LIB)
@echo --- Removing raylib artifacts...
$(MAKE) clean -C vendor/raylib/src
@echo --- Removing iris artifacts...
rm -f out/$(NAME)
rm -rf out/*.dSYM
@echo --- Done!