-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
118 lines (86 loc) · 3.86 KB
/
Makefile
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
.PHONY:default
default:
$(error Must specify target)
CMAKE_DEFINES:=
ifdef RELEASE_MODE
ifdef RELEASE_NAME
CMAKE_DEFINES:=$(CMAKE_DEFINES) -DRELEASE_NAME=$(RELEASE_NAME)
endif
endif
BUILD_FOLDER:=build
ifeq ($(OS),Windows_NT)
PYTHON3:=py -3
# https://github.com/muttleyxd/clang-tools-static-binaries/releases
CLANG_FORMAT:=bin/clang-format-11_windows-amd64.exe
CAT:=cmd /c type
NPROC:=$(NUMBER_OF_PROCESSORS)
include Makefile.windows.mak
else
# Is this how you're supposed to do it? Works for me on macOS, at
# least...
PYTHON3:=python3
CAT:=cat
UNAME:=$(shell uname -s)
ifeq ($(UNAME),Darwin)
OS:=osx
NPROC:=$(shell sysctl -n hw.ncpu)
INSTALLER:=
ifdef OSX_DEPLOYMENT_TARGET
CMAKE_DEFINES:=$(CMAKE_DEFINES) -DCMAKE_OSX_DEPLOYMENT_TARGET=$(OSX_DEPLOYMENT_TARGET)
endif
# version number roulette.
CLANG_FORMAT:=clang-format
include Makefile.unix.mak
include Makefile.osx.mak
endif
ifeq ($(UNAME),Linux)
OS:=linux
NPROC:=$(shell nproc)
INSTALLER:=1
# this is what it ends up called on Ubuntu 22, at any rate.
CLANG_FORMAT:=clang-format-11
include Makefile.unix.mak
endif
endif
SHELLCMD:=$(PYTHON3) ./submodules/shellcmd.py/shellcmd.py
##########################################################################
##########################################################################
.PHONY:rel
rel:
$(PYTHON3) ./etc/release/release.py --make=$(MAKE)
##########################################################################
##########################################################################
.PHONY:rel_tests
rel_tests:
$(PYTHON3) ./etc/b2_tests/rel_tests.py
##########################################################################
##########################################################################
.PHONY:clang-format
clang-format:
$(SHELLCMD) cat experimental/clang-format.header.txt src/.clang-format experimental/clang-format.header.txt > experimental/.clang-format
$(SHELLCMD) mkdir $(BUILD_FOLDER)
$(PYTHON3) ./bin/make_clang-format_makefile.py -o "$(BUILD_FOLDER)/clang-format.mak" -e "$(CLANG_FORMAT)" src experimental
$(MAKE) -f "$(BUILD_FOLDER)/clang-format.mak" -j $(NPROC)
##########################################################################
##########################################################################
.PHONY:set_submodule_upstreams
set_submodule_upstreams:
@$(MAKE) _set_submodule_upstream SUBMODULE=Remotery UPSTREAM=https://github.com/Celtoys/Remotery
@$(MAKE) _set_submodule_upstream SUBMODULE=SDL_official UPSTREAM=https://github.com/libsdl-org/SDL
@$(MAKE) _set_submodule_upstream SUBMODULE=curl UPSTREAM=https://github.com/curl/curl
@$(MAKE) _set_submodule_upstream SUBMODULE=http-parser UPSTREAM=https://github.com/nodejs/http-parser
@$(MAKE) _set_submodule_upstream SUBMODULE=imgui UPSTREAM=https://github.com/ocornut/imgui
@$(MAKE) _set_submodule_upstream SUBMODULE=imgui_club UPSTREAM=https://github.com/tom-seddon/imgui_club
@$(MAKE) _set_submodule_upstream SUBMODULE=libuv UPSTREAM=https://github.com/libuv/libuv
@$(MAKE) _set_submodule_upstream SUBMODULE=macdylibbundler UPSTREAM=https://github.com/auriamg/macdylibbundler
@$(MAKE) _set_submodule_upstream SUBMODULE=perfect6502 UPSTREAM=https://github.com/mist64/perfect6502
@$(MAKE) _set_submodule_upstream SUBMODULE=rapidjson UPSTREAM=https://github.com/Tencent/rapidjson
@$(MAKE) _set_submodule_upstream SUBMODULE=relacy UPSTREAM=https://github.com/dvyukov/relacy
@$(MAKE) _set_submodule_upstream SUBMODULE=salieri UPSTREAM=https://github.com/nemequ/salieri
@$(MAKE) _set_submodule_upstream SUBMODULE=visual6502 UPSTREAM=https://github.com/trebonian/visual6502
.PHONY:_set_submodule_upstream
_set_submodule_upstream: SUBMODULE=$(error must supply SUBMODULE)
_set_submodule_upstream: UPSTREAM=$(error must supply UPSTREAM)
_set_submodule_upstream:
-cd "submodules/$(SUBMODULE)" && git remote remove upstream
cd "submodules/$(SUBMODULE)" && git remote add upstream "$(UPSTREAM)"