mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-08 08:45:43 +08:00
more makefile cleanup
This commit is contained in:
parent
5f19f668dc
commit
c456945d57
90
Makefile
90
Makefile
@ -93,7 +93,7 @@ clean:
|
|||||||
@git clean -dfx ${ROOT_CLEAN_IGNORES}
|
@git clean -dfx ${ROOT_CLEAN_IGNORES}
|
||||||
|
|
||||||
# Show what clean would delete without actually deleting it.
|
# Show what clean would delete without actually deleting it.
|
||||||
cleanlist:
|
clean-list:
|
||||||
@${CHECK_CLEAN_SAFETY}
|
@${CHECK_CLEAN_SAFETY}
|
||||||
@git clean -dnx ${ROOT_CLEAN_IGNORES}
|
@git clean -dnx ${ROOT_CLEAN_IGNORES}
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ cleanlist:
|
|||||||
assets-windows-Win32 assets-windows-x64 \
|
assets-windows-Win32 assets-windows-x64 \
|
||||||
assets-mac assets-ios assets-android assets-clean \
|
assets-mac assets-ios assets-android assets-clean \
|
||||||
-clean-clean\
|
-clean-clean\
|
||||||
clean cleanlist
|
clean clean-list
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -213,11 +213,11 @@ update: prereqs
|
|||||||
@tools/update_project
|
@tools/update_project
|
||||||
|
|
||||||
# Don't update but fail if anything needs it.
|
# Don't update but fail if anything needs it.
|
||||||
updatecheck: prereqs
|
update-check: prereqs
|
||||||
@tools/update_project --check
|
@tools/update_project --check
|
||||||
|
|
||||||
# Tell make which of these targets don't represent files.
|
# Tell make which of these targets don't represent files.
|
||||||
.PHONY: update updatecheck
|
.PHONY: update update-check
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -228,36 +228,36 @@ updatecheck: prereqs
|
|||||||
|
|
||||||
# Run formatting on all files in the project considered 'dirty'.
|
# Run formatting on all files in the project considered 'dirty'.
|
||||||
format:
|
format:
|
||||||
@$(MAKE) -j3 formatcode formatscripts formatmakefile
|
@$(MAKE) -j3 format-code format-scripts format-makefile
|
||||||
@echo Formatting complete!
|
@echo Formatting complete!
|
||||||
|
|
||||||
# Same but always formats; ignores dirty state.
|
# Same but always formats; ignores dirty state.
|
||||||
formatfull:
|
format-full:
|
||||||
@$(MAKE) -j3 formatcodefull formatscriptsfull formatmakefile
|
@$(MAKE) -j3 format-code-full format-scripts-full format-makefile
|
||||||
@echo Formatting complete!
|
@echo Formatting complete!
|
||||||
|
|
||||||
# Run formatting for compiled code sources (.cc, .h, etc.).
|
# Run formatting for compiled code sources (.cc, .h, etc.).
|
||||||
formatcode: prereqs
|
format-code: prereqs
|
||||||
@tools/snippets formatcode
|
@tools/snippets formatcode
|
||||||
|
|
||||||
# Same but always formats; ignores dirty state.
|
# Same but always formats; ignores dirty state.
|
||||||
formatcodefull: prereqs
|
format-code-full: prereqs
|
||||||
@tools/snippets formatcode -full
|
@tools/snippets formatcode -full
|
||||||
|
|
||||||
# Runs formatting for scripts (.py, etc).
|
# Runs formatting for scripts (.py, etc).
|
||||||
formatscripts: prereqs
|
format-scripts: prereqs
|
||||||
@tools/snippets formatscripts
|
@tools/snippets formatscripts
|
||||||
|
|
||||||
# Same but always formats; ignores dirty state.
|
# Same but always formats; ignores dirty state.
|
||||||
formatscriptsfull: prereqs
|
format-scripts-full: prereqs
|
||||||
@tools/snippets formatscripts -full
|
@tools/snippets formatscripts -full
|
||||||
|
|
||||||
# Runs formatting on the project Makefile.
|
# Runs formatting on the project Makefile.
|
||||||
formatmakefile: prereqs
|
format-makefile: prereqs
|
||||||
@tools/snippets formatmakefile
|
@tools/snippets formatmakefile
|
||||||
|
|
||||||
.PHONY: format formatfull formatcode formatcodefull formatscripts \
|
.PHONY: format format-full format-code format-code-full format-scripts \
|
||||||
formatscriptsfull
|
format-scripts-full
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -267,21 +267,23 @@ formatmakefile: prereqs
|
|||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# Run all project checks. (static analysis)
|
# Run all project checks. (static analysis)
|
||||||
check: updatecheck
|
check: update-check
|
||||||
@$(MAKE) -j3 cpplint pylint mypy
|
@$(MAKE) -j3 cpplint pylint mypy
|
||||||
@echo ALL CHECKS PASSED!
|
@echo 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
|
||||||
|
@echo ALL CHECKS PASSED!
|
||||||
|
|
||||||
# Same as 'check' plus optional/slow extra checks.
|
# Same as 'check' plus optional/slow extra checks.
|
||||||
check2: updatecheck
|
check2: update-check
|
||||||
@$(MAKE) -j4 cpplint pylint mypy pycharm
|
@$(MAKE) -j4 cpplint pylint mypy pycharm
|
||||||
@echo ALL CHECKS PASSED!
|
@echo ALL CHECKS PASSED!
|
||||||
|
|
||||||
# Run checks with no caching (all files are checked).
|
# Same as check2 but no caching (all files are checked).
|
||||||
checkfull: updatecheck
|
check2-full: update-check
|
||||||
@$(MAKE) -j3 cpplintfull pylintfull mypyfull
|
@$(MAKE) -j4 cpplint-full pylint-full mypy-full pycharm-full
|
||||||
@echo ALL CHECKS PASSED!
|
|
||||||
# Same as 'checkfull' plus optional/slow extra checks.
|
|
||||||
check2full: updatecheck
|
|
||||||
@$(MAKE) -j4 cpplintfull pylintfull mypyfull pycharmfull
|
|
||||||
@echo ALL CHECKS PASSED!
|
@echo ALL CHECKS PASSED!
|
||||||
|
|
||||||
# Run Cpplint checks on all C/C++ code.
|
# Run Cpplint checks on all C/C++ code.
|
||||||
@ -289,7 +291,7 @@ cpplint: prereqs
|
|||||||
@tools/snippets cpplint
|
@tools/snippets cpplint
|
||||||
|
|
||||||
# Run Cpplint checks without caching (all files are checked).
|
# Run Cpplint checks without caching (all files are checked).
|
||||||
cpplintfull: prereqs
|
cpplint-full: prereqs
|
||||||
@tools/snippets cpplint -full
|
@tools/snippets cpplint -full
|
||||||
|
|
||||||
# Run Pylint checks on all Python Code.
|
# Run Pylint checks on all Python Code.
|
||||||
@ -297,7 +299,7 @@ pylint: prereqs
|
|||||||
@tools/snippets pylint
|
@tools/snippets pylint
|
||||||
|
|
||||||
# Run Pylint checks without caching (all files are checked).
|
# Run Pylint checks without caching (all files are checked).
|
||||||
pylintfull: prereqs
|
pylint-full: prereqs
|
||||||
@tools/snippets pylint -full
|
@tools/snippets pylint -full
|
||||||
|
|
||||||
# Run Mypy checks on all Python code.
|
# Run Mypy checks on all Python code.
|
||||||
@ -305,7 +307,7 @@ mypy: prereqs
|
|||||||
@tools/snippets mypy
|
@tools/snippets mypy
|
||||||
|
|
||||||
# Run Mypy checks without caching (all files are checked).
|
# Run Mypy checks without caching (all files are checked).
|
||||||
mypyfull: prereqs
|
mypy-full: prereqs
|
||||||
@tools/snippets mypy -full
|
@tools/snippets mypy -full
|
||||||
|
|
||||||
# Run PyCharm checks on all Python code.
|
# Run PyCharm checks on all Python code.
|
||||||
@ -313,13 +315,13 @@ pycharm: prereqs
|
|||||||
@tools/snippets pycharm
|
@tools/snippets pycharm
|
||||||
|
|
||||||
# Run PyCharm checks without caching (all files are checked).
|
# Run PyCharm checks without caching (all files are checked).
|
||||||
pycharmfull: prereqs
|
pycharm-full: prereqs
|
||||||
@tools/snippets pycharm -full
|
@tools/snippets pycharm -full
|
||||||
|
|
||||||
# Tell make which of these targets don't represent files.
|
# Tell make which of these targets don't represent files.
|
||||||
.PHONY: check check2 checkfull check2full \
|
.PHONY: check check-full check2 check2-full \
|
||||||
cpplint cpplintfull pylint pylintfull mypy \
|
cpplint cpplint-full pylint pylint-full mypy \
|
||||||
mypyfull pycharm pycharmfull
|
mypy-full pycharm pycharm-full
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -335,10 +337,10 @@ test: prereqs
|
|||||||
@tools/snippets pytest -v tests
|
@tools/snippets pytest -v tests
|
||||||
|
|
||||||
# Run tests with any caching disabled.
|
# Run tests with any caching disabled.
|
||||||
testfull: test
|
test-full: test
|
||||||
|
|
||||||
# Tell make which of these targets don't represent files.
|
# Tell make which of these targets don't represent files.
|
||||||
.PHONY: test testfull
|
.PHONY: test test-full
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -353,6 +355,14 @@ preflight:
|
|||||||
@$(MAKE) update
|
@$(MAKE) update
|
||||||
@$(MAKE) -j4 cpplint pylint mypy test
|
@$(MAKE) -j4 cpplint pylint mypy test
|
||||||
@echo PREFLIGHT SUCCESSFUL!
|
@echo 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
|
||||||
|
@echo PREFLIGHT SUCCESSFUL!
|
||||||
|
|
||||||
# Same as 'preflight' plus optional/slow extra checks.
|
# Same as 'preflight' plus optional/slow extra checks.
|
||||||
preflight2:
|
preflight2:
|
||||||
@$(MAKE) format
|
@$(MAKE) format
|
||||||
@ -360,21 +370,15 @@ preflight2:
|
|||||||
@$(MAKE) -j5 cpplint pylint mypy pycharm test
|
@$(MAKE) -j5 cpplint pylint mypy pycharm test
|
||||||
@echo PREFLIGHT SUCCESSFUL!
|
@echo PREFLIGHT SUCCESSFUL!
|
||||||
|
|
||||||
# Same as 'preflight' without caching (checks all files).
|
# Same as 'preflight2' but without caching (all files are visited).
|
||||||
preflightfull:
|
preflight2-full:
|
||||||
@$(MAKE) formatfull
|
@$(MAKE) format-full
|
||||||
@$(MAKE) update
|
@$(MAKE) update
|
||||||
@$(MAKE) -j4 cpplintfull pylintfull mypyfull testfull
|
@$(MAKE) -j5 cpplint-full pylint-full mypy-full pycharm-full test-full
|
||||||
@echo PREFLIGHT SUCCESSFUL!
|
|
||||||
# Same as 'preflightfull' plus optional/slow extra checks.
|
|
||||||
preflight2full:
|
|
||||||
@$(MAKE) formatfull
|
|
||||||
@$(MAKE) update
|
|
||||||
@$(MAKE) -j5 cpplintfull pylintfull mypyfull pycharmfull testfull
|
|
||||||
@echo PREFLIGHT SUCCESSFUL!
|
@echo PREFLIGHT SUCCESSFUL!
|
||||||
|
|
||||||
# Tell make which of these targets don't represent files.
|
# Tell make which of these targets don't represent files.
|
||||||
.PHONY: preflight preflight2 preflightfull preflight2full
|
.PHONY: preflight preflight-full preflight2 preflight2-full
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|||||||
@ -157,10 +157,10 @@ def _spelling(words: List[str]) -> None:
|
|||||||
def spelling_all() -> None:
|
def spelling_all() -> None:
|
||||||
"""Add all misspellings from a pycharm run."""
|
"""Add all misspellings from a pycharm run."""
|
||||||
|
|
||||||
print('Running "make pycharmfull"...')
|
print('Running "make pycharm-full"...')
|
||||||
lines = [
|
lines = [
|
||||||
line for line in subprocess.run(
|
line for line in subprocess.run(
|
||||||
['make', 'pycharmfull'], check=False,
|
['make', 'pycharm-full'], check=False,
|
||||||
capture_output=True).stdout.decode().splitlines()
|
capture_output=True).stdout.decode().splitlines()
|
||||||
if 'Typo: In word' in line
|
if 'Typo: In word' in line
|
||||||
]
|
]
|
||||||
@ -354,7 +354,7 @@ def sync_all() -> None:
|
|||||||
"""Runs full syncs between all efrotools projects.
|
"""Runs full syncs between all efrotools projects.
|
||||||
|
|
||||||
This list is defined in the EFROTOOLS_SYNC_PROJECTS env var.
|
This list is defined in the EFROTOOLS_SYNC_PROJECTS env var.
|
||||||
This assumes that there is a 'syncfull' and 'synclist' Makefile target
|
This assumes that there is a 'sync-full' and 'sync-list' Makefile target
|
||||||
under each project.
|
under each project.
|
||||||
"""
|
"""
|
||||||
print(f'{CLRBLU}Updating formatting for all projects...{CLREND}')
|
print(f'{CLRBLU}Updating formatting for all projects...{CLREND}')
|
||||||
@ -374,7 +374,7 @@ def sync_all() -> None:
|
|||||||
if len(sys.argv) > 2 and sys.argv[2] == 'list':
|
if len(sys.argv) > 2 and sys.argv[2] == 'list':
|
||||||
# List mode
|
# List mode
|
||||||
for project in projects_str.split(':'):
|
for project in projects_str.split(':'):
|
||||||
cmd = f'cd "{project}" && make synclist'
|
cmd = f'cd "{project}" && make sync-list'
|
||||||
print(cmd)
|
print(cmd)
|
||||||
subprocess.run(cmd, shell=True, check=True)
|
subprocess.run(cmd, shell=True, check=True)
|
||||||
|
|
||||||
@ -389,7 +389,7 @@ def sync_all() -> None:
|
|||||||
print(CLRBLU + "Running sync pass 2:"
|
print(CLRBLU + "Running sync pass 2:"
|
||||||
" (ensures latest src is pulled to all dsts)" + CLREND)
|
" (ensures latest src is pulled to all dsts)" + CLREND)
|
||||||
for project in projects_str.split(':'):
|
for project in projects_str.split(':'):
|
||||||
cmd = f'cd "{project}" && make syncfull'
|
cmd = f'cd "{project}" && make sync-full'
|
||||||
print(cmd)
|
print(cmd)
|
||||||
subprocess.run(cmd, shell=True, check=True)
|
subprocess.run(cmd, shell=True, check=True)
|
||||||
print(CLRBLU + 'Sync-all successful!' + CLREND)
|
print(CLRBLU + 'Sync-all successful!' + CLREND)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user