Repository navigation
Expand file tree
/
Copy pathmakefile
More file actions
62 lines (53 loc) · 2.19 KB
/
Copy pathmakefile
File metadata and controls
62 lines (53 loc) · 2.19 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
61
62
#
# Copyright 2025-2026 Milos Tosic. All rights reserved.
# License: https://github.com/RudjiGames/rg_core/blob/master/LICENSE
#
UNAME := $(shell uname)
ifeq ($(UNAME),$(filter $(UNAME),Linux Darwin))
ifeq ($(UNAME),$(filter $(UNAME),Darwin))
OS=darwin
else
OS=linux
endif
help:
@echo Available targets:
@grep -E "^[a-zA-Z0-9_-]+:.*?## .*$$" $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
else
OS=windows
help:
@echo Available targets:
@for /F "tokens=1,2 delims=#" %%a in ('findstr /R /C:"^[a-zA-Z0-9_-]*:.*## " $(MAKEFILE_LIST)') do @echo [36m%%a[0m %%b
endif
GetParentDir = $(dir ${1:/=})
RG_ZIDAR_DIR?=
# If RG_ZIDAR_DIR does not exist, search parent directories for 'zidar'
# 7 levels up should be enough for most cases, but can be increased if needed.
ifeq ($(wildcard $(RG_ZIDAR_DIR)),)
_d0 := $(CURDIR)/
_d1 := $(call GetParentDir, $(_d0))
_d2 := $(call GetParentDir, $(_d1))
_d3 := $(call GetParentDir, $(_d2))
_d4 := $(call GetParentDir, $(_d3))
_d5 := $(call GetParentDir, $(_d4))
_d6 := $(call GetParentDir, $(_d5))
_d7 := $(call GetParentDir, $(_d6))
RG_ZIDAR_DIR := $(firstword $(foreach d,$(_d0) $(_d1) $(_d2) $(_d3) $(_d4) $(_d5) $(_d6) $(_d7),$(wildcard $(d)zidar)))
ifeq ($(RG_ZIDAR_DIR),)
$(error RG_ZIDAR_DIR not found in any parent directory)
endif
endif
GENIE?=$(RG_ZIDAR_DIR)/tools/bin/$(OS)/genie $(EXTRA_GENIE_ARGS) --zidar-path=$(RG_ZIDAR_DIR)
NINJA?=$(RG_ZIDAR_DIR)/tools/bin/$(OS)/ninja
.PHONY: help
clean: ## Clean all intermediate files.
@echo Cleaning...
-@rm -rf .zidar
projgen: ## Generate project files for all configurations.
@echo Generating project files...
$(GENIE) --with-samples --with-unittests --with-tools vs2022
$(GENIE) --with-samples --with-unittests --with-tools --gcc=linux-clang gmake
$(GENIE) --with-samples --with-unittests --with-tools --gcc=linux-gcc gmake
$(GENIE) --with-samples --with-unittests --with-tools --gcc=osx-arm64 gmake
$(GENIE) --with-samples --with-unittests --with-tools --xcode=osx xcode9
$(GENIE) --with-samples --with-unittests --with-tools --xcode=ios xcode9
$(GENIE) --with-samples --with-unittests --with-tools --gcc=android-arm64 gmake