forked from efroemling/ballistica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
709 lines (542 loc) · 25.1 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
# Copyright (c) 2011-2020 Eric Froemling
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# ------------------------------------------------------------------------------
# This Makefile encompasses most high level functionality you should need when
# working with Ballistica. These build rules are also handy as reference or a
# starting point if you need specific funtionality beyond that exposed here.
# Targets in this top level Makefile do not expect -jX to be passed to them
# and generally handle spawning an appropriate number of child jobs themselves.
# Prefix used for output of docs/changelogs/etc. targets for use in webpages.
DOCPREFIX = "ballisticacore_"
################################################################################
# #
# General #
# #
################################################################################
# List targets in this Makefile and basic descriptions for them.
help:
@tools/snippets makefile_target_list Makefile
PREREQS = .cache/checkenv .dir-locals.el \
.mypy.ini .pycheckers .pylintrc .style.yapf .clang-format \
.projectile .editorconfig
# Target that should be built before running most any other build.
# This installs tool config files, runs environment checks, etc.
prereqs: ${PREREQS}
prereqs-clean:
@rm -rf ${PREREQS} .irony
# Build all assets for all platforms.
assets: prereqs
@cd assets && make -j${CPUS}
# Build assets required for cmake builds (linux, mac)
assets-cmake: prereqs
@cd assets && ${MAKE} -j${CPUS} cmake
# Build assets required for WINDOWS_PLATFORM windows builds.
assets-windows: prereqs
@cd assets && ${MAKE} -j${CPUS} win-${WINDOWS_PLATFORM}
# Build assets required for Win32 windows builds.
assets-windows-Win32: prereqs
@cd assets && ${MAKE} -j${CPUS} win-Win32
# Build assets required for x64 windows builds.
assets-windows-x64: prereqs
@cd assets && ${MAKE} -j${CPUS} win-x64
# Build assets required for mac xcode builds
assets-mac: prereqs
@cd assets && ${MAKE} -j${CPUS} mac
# Build assets required for ios.
assets-ios: prereqs
@cd assets && ${MAKE} -j${CPUS} ios
# Build assets required for android.
assets-android: prereqs
@cd assets && ${MAKE} -j${CPUS} android
# Clean all assets.
assets-clean:
@cd assets && ${MAKE} clean
# Remove *ALL* files and directories that aren't managed by git
# (except for a few things such as localconfig.json).
clean:
@${CHECK_CLEAN_SAFETY}
@git clean -dfx ${ROOT_CLEAN_IGNORES}
# Show what clean would delete without actually deleting it.
clean-list:
@${CHECK_CLEAN_SAFETY}
@git clean -dnx ${ROOT_CLEAN_IGNORES}
# Tell make which of these targets don't represent files.
.PHONY: list prereqs prereqs-clean assets assets-cmake assets-windows \
assets-windows-Win32 assets-windows-x64 \
assets-mac assets-ios assets-android assets-clean \
-clean-clean\
clean clean-list
################################################################################
# #
# Prefab #
# #
################################################################################
# Prebuilt binaries for various platforms.
# Assemble & run a debug build for this platform.
prefab-debug: prefab-debug-build
${${shell tools/snippets prefab_run_var debug}}
# Assemble & run a release build for this platform.
prefab-release: prefab-release-build
${${shell tools/snippets prefab_run_var release}}
# Assemble a debug build for this platform.
prefab-debug-build:
@tools/snippets make_prefab debug
# Assemble a release build for this platform.
prefab-release-build:
@tools/snippets make_prefab release
# Assemble & run a server debug build for this platform.
prefab-server-debug: prefab-server-debug-build
${${shell tools/snippets prefab_run_var server-debug}}
# Assemble & run a server release build for this platform.
prefab-server-release: prefab-server-release-build
${${shell tools/snippets prefab_run_var server-release}}
# Assemble a server debug build for this platform.
prefab-server-debug-build:
@tools/snippets make_prefab server-debug
# Assemble a server release build for this platform.
prefab-server-release-build:
@tools/snippets make_prefab server-release
# Specific platform prefab targets:
RUN_PREFAB_MAC_DEBUG = cd build/prefab/mac/debug && ./ballisticacore
prefab-mac-debug: prefab-mac-debug-build
@tools/snippets ensure_prefab_platform mac
@${RUN_PREFAB_MAC_DEBUG}
prefab-mac-debug-build: prereqs assets-cmake \
build/prefab/mac/debug/ballisticacore
@${STAGE_ASSETS} -cmake build/prefab/mac/debug
build/prefab/mac/debug/ballisticacore: .efrocachemap
@tools/snippets efrocache_get $@
RUN_PREFAB_MAC_RELEASE = cd build/prefab/mac/release && ./ballisticacore
prefab-mac-release: prefab-mac-release-build
@tools/snippets ensure_prefab_platform mac
@${RUN_PREFAB_MAC_RELEASE}
prefab-mac-release-build: prereqs assets-cmake \
build/prefab/mac/release/ballisticacore
@${STAGE_ASSETS} -cmake build/prefab/mac/release
build/prefab/mac/release/ballisticacore: .efrocachemap
@tools/snippets efrocache_get $@
RUN_PREFAB_MAC_SERVER_DEBUG = cd build/prefab/mac-server/debug \
&& ./ballisticacore_server
prefab-mac-server-debug: prefab-mac-server-debug-build
@tools/snippets ensure_prefab_platform mac
@${RUN_PREFAB_MAC_SERVER_DEBUG}
prefab-mac-server-debug-build: prereqs assets-cmake \
build/prefab/mac-server/debug/dist/ballisticacore_headless \
build/prefab/mac-server/debug/ballisticacore_server \
build/prefab/mac-server/debug/config_template.yaml \
build/prefab/mac-server/debug/README.txt
@${STAGE_ASSETS} -cmake-server build/prefab/mac-server/debug/dist
build/prefab/mac-server/debug/ballisticacore_server: \
assets/src/server/ballisticacore_server.py
@cp $< $@
build/prefab/mac-server/debug/config_template.yaml: \
assets/src/server/config_template.yaml \
tools/batools/build.py \
tools/bacommon/servermanager.py
@tools/snippets filter_server_config $< $@
build/prefab/mac-server/debug/README.txt: \
assets/src/server/README.txt
@cp $< $@
build/prefab/mac-server/debug/dist/ballisticacore_headless: .efrocachemap
@tools/snippets efrocache_get $@
RUN_PREFAB_MAC_SERVER_RELEASE = cd build/prefab/mac-server/release \
&& ./ballisticacore_server
prefab-mac-server-release: prefab-mac-server-release-build
@tools/snippets ensure_prefab_platform mac
@${RUN_PREFAB_MAC_SERVER_RELEASE}
prefab-mac-server-release-build: prereqs assets-cmake \
build/prefab/mac-server/release/dist/ballisticacore_headless \
build/prefab/mac-server/release/ballisticacore_server \
build/prefab/mac-server/release/config_template.yaml \
build/prefab/mac-server/release/README.txt
@${STAGE_ASSETS} -cmake-server build/prefab/mac-server/release/dist
build/prefab/mac-server/release/ballisticacore_server: \
assets/src/server/ballisticacore_server.py
@cp $< $@
build/prefab/mac-server/release/config_template.yaml: \
assets/src/server/config_template.yaml \
tools/batools/build.py \
tools/bacommon/servermanager.py
@tools/snippets filter_server_config $< $@
build/prefab/mac-server/release/README.txt: \
assets/src/server/README.txt
@cp $< $@
build/prefab/mac-server/release/dist/ballisticacore_headless: .efrocachemap
@tools/snippets efrocache_get $@
RUN_PREFAB_LINUX_DEBUG = cd build/prefab/linux/debug && ./ballisticacore
prefab-linux-debug: prefab-linux-debug-build
@tools/snippets ensure_prefab_platform linux
@${RUN_PREFAB_LINUX_DEBUG}
prefab-linux-debug-build: prereqs assets-cmake \
build/prefab/linux/debug/ballisticacore
@${STAGE_ASSETS} -cmake build/prefab/linux/debug
build/prefab/linux/debug/ballisticacore: .efrocachemap
@tools/snippets efrocache_get $@
RUN_PREFAB_LINUX_RELEASE = cd build/prefab/linux/release && ./ballisticacore
prefab-linux-release: prefab-linux-release-build
@tools/snippets ensure_prefab_platform linux
@${RUN_PREFAB_LINUX_RELEASE}
prefab-linux-release-build: prereqs assets-cmake \
build/prefab/linux/release/ballisticacore
@${STAGE_ASSETS} -cmake build/prefab/linux/release
build/prefab/linux/release/ballisticacore: .efrocachemap
@tools/snippets efrocache_get $@
RUN_PREFAB_LINUX_SERVER_DEBUG = cd build/prefab/linux-server/debug \
&& ./ballisticacore_server
prefab-linux-server-debug: prefab-linux-server-debug-build
@tools/snippets ensure_prefab_platform linux
@${RUN_PREFAB_LINUX_SERVER_DEBUG}
prefab-linux-server-debug-build: prereqs assets-cmake \
build/prefab/linux-server/debug/dist/ballisticacore_headless \
build/prefab/linux-server/debug/ballisticacore_server \
build/prefab/linux-server/debug/config_template.yaml \
build/prefab/linux-server/debug/README.txt
@${STAGE_ASSETS} -cmake-server build/prefab/linux-server/debug/dist
build/prefab/linux-server/debug/ballisticacore_server: \
assets/src/server/ballisticacore_server.py
@cp $< $@
build/prefab/linux-server/debug/config_template.yaml: \
assets/src/server/config_template.yaml \
tools/batools/build.py \
tools/bacommon/servermanager.py
@tools/snippets filter_server_config $< $@
build/prefab/linux-server/debug/README.txt: \
assets/src/server/README.txt
@cp $< $@
build/prefab/linux-server/debug/dist/ballisticacore_headless: .efrocachemap
@tools/snippets efrocache_get $@
RUN_PREFAB_LINUX_SERVER_RELEASE = cd build/prefab/linux-server/release \
&& ./ballisticacore_server
prefab-linux-server-release: prefab-linux-server-release-build
@tools/snippets ensure_prefab_platform linux
@${RUN_PREFAB_LINUX_SERVER_RELEASE}
prefab-linux-server-release-build: prereqs assets-cmake \
build/prefab/linux-server/release/dist/ballisticacore_headless \
build/prefab/linux-server/release/ballisticacore_server \
build/prefab/linux-server/release/config_template.yaml \
build/prefab/linux-server/release/README.txt
@${STAGE_ASSETS} -cmake-server build/prefab/linux-server/release/dist
build/prefab/linux-server/release/ballisticacore_server: \
assets/src/server/ballisticacore_server.py
@cp $< $@
build/prefab/linux-server/release/config_template.yaml: \
assets/src/server/config_template.yaml \
tools/batools/build.py \
tools/bacommon/servermanager.py
@tools/snippets filter_server_config $< $@
build/prefab/linux-server/release/README.txt: \
assets/src/server/README.txt
@cp $< $@
build/prefab/linux-server/release/dist/ballisticacore_headless: .efrocachemap
@tools/snippets efrocache_get $@
PREFAB_WINDOWS_PLATFORM = x64
RUN_PREFAB_WINDOWS_DEBUG = cd build/prefab/windows/debug && ./BallisticaCore.exe
prefab-windows-debug: prefab-windows-debug-build
@tools/snippets ensure_prefab_platform windows
@{RUN_PREFAB_WINDOWS_DEBUG}
prefab-windows-debug-build: prereqs assets-windows-${PREFAB_WINDOWS_PLATFORM} \
build/prefab/windows/debug/BallisticaCore.exe
@${STAGE_ASSETS} -win-$(PREFAB_WINDOWS_PLATFORM) build/prefab/windows/debug
build/prefab/windows/debug/BallisticaCore.exe: .efrocachemap
@tools/snippets efrocache_get $@
RUN_PREFAB_WINDOWS_RELEASE = cd build/prefab/windows/release \
&& ./BallisticaCore.exe
prefab-windows-release: prefab-windows-release-build
@tools/snippets ensure_prefab_platform windows
@{RUN_PREFAB_WINDOWS_RELEASE}
prefab-windows-release-build: prereqs \
assets-windows-${PREFAB_WINDOWS_PLATFORM} \
build/prefab/windows/release/BallisticaCore.exe
@${STAGE_ASSETS} -win-$(PREFAB_WINDOWS_PLATFORM) build/prefab/windows/release
build/prefab/windows/release/BallisticaCore.exe: .efrocachemap
@tools/snippets efrocache_get $@
RUN_PREFAB_WINDOWS_SERVER_DEBUG = cd build/prefab/windows-server/debug \
&& dist/python.exe ballisticacore_server.py
prefab-windows-server-debug: prefab-windows-server-debug-build
@tools/snippets ensure_prefab_platform windows
@{RUN_PREFAB_WINDOWS_SERVER_DEBUG}
prefab-windows-server-debug-build: prereqs \
assets-windows-${PREFAB_WINDOWS_PLATFORM} \
build/prefab/windows-server/debug/dist/ballisticacore_headless.exe \
build/prefab/windows-server/debug/launch_ballisticacore_server.bat \
build/prefab/windows-server/debug/ballisticacore_server.py \
build/prefab/windows-server/debug/config_template.yaml \
build/prefab/windows-server/debug/README.txt
@${STAGE_ASSETS} -win-$(PREFAB_WINDOWS_PLATFORM) \
build/prefab/windows-server/debug/dist
build/prefab/windows-server/debug/dist/ballisticacore_headless.exe: .efrocachemap
@tools/snippets efrocache_get $@
build/prefab/windows-server/debug/ballisticacore_server.py: \
assets/src/server/ballisticacore_server.py
@cp $< $@
build/prefab/windows-server/debug/launch_ballisticacore_server.bat: \
assets/src/server/launch_ballisticacore_server.bat
@cp $< $@
build/prefab/windows-server/debug/config_template.yaml: \
assets/src/server/config_template.yaml \
tools/batools/build.py \
tools/bacommon/servermanager.py
@tools/snippets filter_server_config $< $@
build/prefab/windows-server/debug/README.txt: \
assets/src/server/README.txt
@cp $< $@
RUN_PREFAB_WINDOWS_SERVER_RELEASE = cd build/prefab/windows-server/release \
&& dist/python.exe ballisticacore_server.py
prefab-windows-server-release: prefab-windows-server-release-build
@tools/snippets ensure_prefab_platform windows
@{RUN_PREFAB_WINDOWS_SERVER_RELEASE}
prefab-windows-server-release-build: prereqs \
assets-windows-${PREFAB_WINDOWS_PLATFORM} \
build/prefab/windows-server/release/dist/ballisticacore_headless.exe \
build/prefab/windows-server/release/launch_ballisticacore_server.bat \
build/prefab/windows-server/release/ballisticacore_server.py \
build/prefab/windows-server/release/config_template.yaml \
build/prefab/windows-server/release/README.txt
@${STAGE_ASSETS} -win-$(PREFAB_WINDOWS_PLATFORM) \
build/prefab/windows-server/release/dist
build/prefab/windows-server/release/dist/ballisticacore_headless.exe: .efrocachemap
@tools/snippets efrocache_get $@
build/prefab/windows-server/release/ballisticacore_server.py: \
assets/src/server/ballisticacore_server.py
@cp $< $@
build/prefab/windows-server/release/launch_ballisticacore_server.bat: \
assets/src/server/launch_ballisticacore_server.bat
@cp $< $@
build/prefab/windows-server/release/config_template.yaml: \
assets/src/server/config_template.yaml \
tools/batools/build.py \
tools/bacommon/servermanager.py
@tools/snippets filter_server_config $< $@
build/prefab/windows-server/release/README.txt: \
assets/src/server/README.txt
@cp $< $@
prefab-clean:
rm -rf build/prefab
# Tell make which of these targets don't represent files.
.PHONY: prefab-debug prefab-debug-build prefab-release prefab-release-build \
prefab-server-debug prefab-server-debug-build prefab-server-release \
prefab-server-release-build prefab-mac-debug prefab-mac-debug-build \
prefab-mac-release prefab-mac-release-build prefab-mac-server-debug \
prefab-mac-server-debug-build prefab-mac-server-release \
prefab-mac-server-release-build prefab-linux-debug prefab-linux-debug-build \
prefab-linux-release prefab-linux-release-build prefab-linux-server-debug \
prefab-linux-server-debug-build prefab-linux-server-release \
prefab-linux-server-release-build prefab-windows-debug \
prefab-windows-debug-build prefab-windows-release \
prefab-windows-release-build prefab-windows-server-debug \
prefab-windows-server-debug-build prefab-windows-server-release \
prefab-windows-server-release-build prefab-clean
################################################################################
# #
# Updating #
# #
################################################################################
# Update any project files that need it (does NOT build projects).
update: prereqs
@tools/update_project
# Don't update but fail if anything needs it.
update-check: prereqs
@tools/update_project --check
# Tell make which of these targets don't represent files.
.PHONY: update update-check
################################################################################
# #
# Formatting #
# #
################################################################################
# Run formatting on all files in the project considered 'dirty'.
format:
@${MAKE} -j3 format-code format-scripts format-makefile
@tools/snippets echo GRN Formatting complete!
# Same but always formats; ignores dirty state.
format-full:
@${MAKE} -j3 format-code-full format-scripts-full format-makefile
@tools/snippets echo GRN Formatting complete!
# Run formatting for compiled code sources (.cc, .h, etc.).
format-code: prereqs
@tools/snippets formatcode
# Same but always formats; ignores dirty state.
format-code-full: prereqs
@tools/snippets formatcode -full
# Runs formatting for scripts (.py, etc).
format-scripts: prereqs
@tools/snippets formatscripts
# Same but always formats; ignores dirty state.
format-scripts-full: prereqs
@tools/snippets formatscripts -full
# Runs formatting on the project Makefile.
format-makefile: prereqs
@tools/snippets formatmakefile
.PHONY: format format-full format-code format-code-full format-scripts \
format-scripts-full
################################################################################
# #
# Checking #
# #
################################################################################
# Run all project checks. (static analysis)
check: update-check
@${MAKE} -j3 cpplint pylint mypy
@tools/snippets echo GRN ALL CHECKS PASSED!
# Same as check but no caching (all files are checked).
check-full: update-check
@${MAKE} -j3 cpplint-full pylint-full mypy-full
@tools/snippets echo GRN ALL CHECKS PASSED!
# Same as 'check' plus optional/slow extra checks.
check2: update-check
@${MAKE} -j4 cpplint pylint mypy pycharm
@tools/snippets echo GRN ALL CHECKS PASSED!
# Same as check2 but no caching (all files are checked).
check2-full: update-check
@${MAKE} -j4 cpplint-full pylint-full mypy-full pycharm-full
@tools/snippets echo GRN ALL CHECKS PASSED!
# Run Cpplint checks on all C/C++ code.
cpplint: prereqs
@tools/snippets cpplint
# Run Cpplint checks without caching (all files are checked).
cpplint-full: prereqs
@tools/snippets cpplint -full
# Run Pylint checks on all Python Code.
pylint: prereqs
@tools/snippets pylint
# Run Pylint checks without caching (all files are checked).
pylint-full: prereqs
@tools/snippets pylint -full
# Run Mypy checks on all Python code.
mypy: prereqs
@tools/snippets mypy
# Run Mypy checks without caching (all files are checked).
mypy-full: prereqs
@tools/snippets mypy -full
# Run Mypy checks on all Python code using daemon mode.
dmypy: prereqs
@tools/snippets dmypy
# Stop the mypy daemon
dmypy-stop: prereqs
@tools/snippets dmypy -stop
# Run PyCharm checks on all Python code.
pycharm: prereqs
@tools/snippets pycharm
# Run PyCharm checks without caching (all files are checked).
pycharm-full: prereqs
@tools/snippets pycharm -full
# Tell make which of these targets don't represent files.
.PHONY: check check-full check2 check2-full \
cpplint cpplint-full pylint pylint-full mypy \
mypy-full pycharm pycharm-full
################################################################################
# #
# Testing #
# #
################################################################################
# Run all tests. (live execution verification)
test: prereqs
@tools/snippets echo BLU Running all tests...
@tools/snippets pytest -v tests
# Run tests with any caching disabled.
test-full: test
# Iterate on individual tests with extra debug output enabled.
test-assetmanager:
@tools/snippets pytest -o log_cli=true -o log_cli_level=debug -s -v \
tests/test_ba/test_assetmanager.py::test_assetmanager
test-dataclasses:
@tools/snippets pytest -o log_cli=true -o log_cli_level=debug -s -v \
tests/test_efro/test_dataclasses.py
# Tell make which of these targets don't represent files.
.PHONY: test test-full test-assetmanager
################################################################################
# #
# Preflighting #
# #
################################################################################
# Format, update, check, & test the project. Do this before commits.
preflight:
@${MAKE} format
@${MAKE} update
@${MAKE} -j4 cpplint pylint mypy test
@tools/snippets echo SGRN BLD PREFLIGHT SUCCESSFUL!
# Same as 'preflight' without caching (all files are visited).
preflight-full:
@${MAKE} format-full
@${MAKE} update
@${MAKE} -j4 cpplint-full pylint-full mypy-full test-full
@tools/snippets echo SGRN BLD PREFLIGHT SUCCESSFUL!
# Same as 'preflight' plus optional/slow extra checks.
preflight2:
@${MAKE} format
@${MAKE} update
@${MAKE} -j5 cpplint pylint mypy pycharm test
@tools/snippets echo SGRN BLD PREFLIGHT SUCCESSFUL!
# Same as 'preflight2' but without caching (all files visited).
preflight2-full:
@${MAKE} format-full
@${MAKE} update
@${MAKE} -j5 cpplint-full pylint-full mypy-full pycharm-full test-full
@tools/snippets echo SGRN BLD PREFLIGHT SUCCESSFUL!
# Tell make which of these targets don't represent files.
.PHONY: preflight preflight-full preflight2 preflight2-full
################################################################################
# #
# Auxiliary #
# #
################################################################################
# This should give the cpu count on linux and mac; may need to expand this
# if using this on other platforms.
CPUS = $(shell getconf _NPROCESSORS_ONLN || echo 8)
PROJ_DIR = ${abspath ${CURDIR}}
VERSION = $(shell tools/version_utils version)
BUILD_NUMBER = $(shell tools/version_utils build)
BUILD_DIR = ${PROJ_DIR}/build
LAZYBUILDDIR = .cache/lazybuild
STAGE_ASSETS = ${PROJ_DIR}/tools/stage_assets
# Things to ignore when doing root level cleans.
ROOT_CLEAN_IGNORES = --exclude=assets/src_master \
--exclude=config/localconfig.json \
--exclude=.spinoffdata
CHECK_CLEAN_SAFETY = ${PROJ_DIR}/tools/snippets check_clean_safety
# Some tool configs that need filtering (mainly injecting projroot path).
TOOL_CFG_INST = tools/snippets tool_config_install
# Anything that affects tool-config generation.
TOOL_CFG_SRC = tools/efrotools/snippets.py config/config.json
# Anything that should trigger an environment-check when changed.
ENV_SRC = tools/snippets tools/batools/build.py
.clang-format: config/toolconfigsrc/clang-format ${TOOL_CFG_SRC}
@${TOOL_CFG_INST} $< $@
.style.yapf: config/toolconfigsrc/style.yapf ${TOOL_CFG_SRC}
@${TOOL_CFG_INST} $< $@
.pylintrc: config/toolconfigsrc/pylintrc ${TOOL_CFG_SRC}
@${TOOL_CFG_INST} $< $@
.projectile: config/toolconfigsrc/projectile ${TOOL_CFG_SRC}
@${TOOL_CFG_INST} $< $@
.editorconfig: config/toolconfigsrc/editorconfig ${TOOL_CFG_SRC}
@${TOOL_CFG_INST} $< $@
.dir-locals.el: config/toolconfigsrc/dir-locals.el ${TOOL_CFG_SRC}
@${TOOL_CFG_INST} $< $@
.mypy.ini: config/toolconfigsrc/mypy.ini ${TOOL_CFG_SRC}
@${TOOL_CFG_INST} $< $@
.pycheckers: config/toolconfigsrc/pycheckers ${TOOL_CFG_SRC}
@${TOOL_CFG_INST} $< $@
# Include anything as sources here that should require
.cache/checkenv: ${ENV_SRC}
@tools/snippets checkenv
@mkdir -p .cache
@touch .cache/checkenv
# Tell make which of these targets don't represent files.
.PHONY: