Makefile cleanup

This commit is contained in:
Eric Froemling 2019-10-20 15:15:00 -07:00
parent af6190aab2
commit ed9dcca1e2
3 changed files with 53 additions and 46 deletions

View File

@ -56,52 +56,52 @@ assets:
# Build only assets required for cmake builds (linux, mac) # Build only assets required for cmake builds (linux, mac)
assets-cmake: assets-cmake:
@cd assets && make -j${CPUS} cmake @cd assets && $(MAKE) -j${CPUS} cmake
# Build only assets required for windows builds. # Build only assets required for windows builds.
# (honoring the WINDOWS_PLATFORM value) # (honoring the WINDOWS_PLATFORM value)
assets-windows: assets-windows:
@cd assets && make -j${CPUS} win-${WINDOWS_PLATFORM} @cd assets && $(MAKE) -j${CPUS} win-${WINDOWS_PLATFORM}
# Build only assets required for Win32 windows builds. # Build only assets required for Win32 windows builds.
assets-windows-Win32: assets-windows-Win32:
@cd assets && make -j${CPUS} win-Win32 @cd assets && $(MAKE) -j${CPUS} win-Win32
# Build only assets required for x64 windows builds. # Build only assets required for x64 windows builds.
assets-windows-x64: assets-windows-x64:
@cd assets && make -j${CPUS} win-x64 @cd assets && $(MAKE) -j${CPUS} win-x64
# Build only assets required for mac xcode builds # Build only assets required for mac xcode builds
assets-mac: assets-mac:
@cd assets && make -j${CPUS} mac @cd assets && $(MAKE) -j${CPUS} mac
# Build only assets required for ios. # Build only assets required for ios.
assets-ios: assets-ios:
@cd assets && make -j${CPUS} ios @cd assets && $(MAKE) -j${CPUS} ios
# Build only assets required for android. # Build only assets required for android.
assets-android: assets-android:
@cd assets && make -j${CPUS} android @cd assets && $(MAKE) -j${CPUS} android
# Clean all assets. # Clean all assets.
assets-clean: assets-clean:
@cd assets && make clean @cd assets && $(MAKE) clean
# Build resources. # Build resources.
resources: resources/Makefile resources: resources/Makefile
@cd resources && make -j${CPUS} resources @cd resources && $(MAKE) -j${CPUS} resources
# Clean resources. # Clean resources.
resources-clean: resources-clean:
@cd resources && make clean @cd resources && $(MAKE) clean
# Build our generated code. # Build our generated code.
code: code:
@cd src/generated_src && make -j${CPUS} generated_code @cd src/generated_src && $(MAKE) -j${CPUS} generated_code
# Clean generated code. # Clean generated code.
code-clean: code-clean:
@cd src/generated_src && make clean @cd src/generated_src && $(MAKE) clean
# Remove *ALL* files and directories that aren't managed by git # Remove *ALL* files and directories that aren't managed by git
# (except for a few things such as localconfig.json). # (except for a few things such as localconfig.json).
@ -231,12 +231,12 @@ build/prefab/windows/release/BallisticaCore.exe: .efrocachemap
# 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 formatcode formatscripts formatmakefile
@echo Formatting complete! @echo Formatting complete!
# Same but always formats; ignores dirty state. # Same but always formats; ignores dirty state.
formatfull: formatfull:
@make -j3 formatcodefull formatscriptsfull formatmakefile @$(MAKE) -j3 formatcodefull formatscriptsfull formatmakefile
@echo Formatting complete! @echo Formatting complete!
# Run formatting for compiled code sources (.cc, .h, etc.). # Run formatting for compiled code sources (.cc, .h, etc.).
@ -262,24 +262,24 @@ formatmakefile: prereqs
# These are useful, but can take significantly longer and/or be a bit flaky. # These are useful, but can take significantly longer and/or be a bit flaky.
check: updatecheck check: updatecheck
@make -j3 cpplintcode pylintscripts mypyscripts @$(MAKE) -j3 cpplintcode pylintscripts mypyscripts
@echo ALL CHECKS PASSED! @echo ALL CHECKS PASSED!
check2: updatecheck check2: updatecheck
@make -j4 cpplintcode pylintscripts mypyscripts pycharmscripts @$(MAKE) -j4 cpplintcode pylintscripts mypyscripts pycharmscripts
@echo ALL CHECKS PASSED! @echo ALL CHECKS PASSED!
checkfast: updatecheck checkfast: updatecheck
@make -j3 cpplintcode pylintscriptsfast mypyscripts @$(MAKE) -j3 cpplintcode pylintscriptsfast mypyscripts
@echo ALL CHECKS PASSED! @echo ALL CHECKS PASSED!
checkfast2: updatecheck checkfast2: updatecheck
@make -j4 cpplintcode pylintscriptsfast mypyscripts pycharmscripts @$(MAKE) -j4 cpplintcode pylintscriptsfast mypyscripts pycharmscripts
@echo ALL CHECKS PASSED! @echo ALL CHECKS PASSED!
checkfull: updatecheck checkfull: updatecheck
@make -j3 cpplintcodefull pylintscriptsfull mypyscriptsfull @$(MAKE) -j3 cpplintcodefull pylintscriptsfull mypyscriptsfull
@echo ALL CHECKS PASSED! @echo ALL CHECKS PASSED!
checkfull2: updatecheck checkfull2: updatecheck
@make -j4 cpplintcodefull pylintscriptsfull mypyscriptsfull pycharmscriptsfull @$(MAKE) -j4 cpplintcodefull pylintscriptsfull mypyscriptsfull pycharmscriptsfull
@echo ALL CHECKS PASSED! @echo ALL CHECKS PASSED!
cpplintcode: prereqs cpplintcode: prereqs
@ -336,54 +336,54 @@ updatecheck: prereqs
# Run an update and check together; handy while iterating. # Run an update and check together; handy while iterating.
# (slightly more efficient than running update/check separately). # (slightly more efficient than running update/check separately).
updatethencheck: update updatethencheck: update
@make -j3 cpplintcode pylintscripts mypyscripts @$(MAKE) -j3 cpplintcode pylintscripts mypyscripts
@echo ALL CHECKS PASSED! @echo ALL CHECKS PASSED!
updatethencheck2: update updatethencheck2: update
@make -j4 cpplintcode pylintscripts mypyscripts pycharmscripts @$(MAKE) -j4 cpplintcode pylintscripts mypyscripts pycharmscripts
@echo ALL CHECKS PASSED! @echo ALL CHECKS PASSED!
updatethencheckfast: update updatethencheckfast: update
@make -j3 cpplintcode pylintscriptsfast mypyscripts @$(MAKE) -j3 cpplintcode pylintscriptsfast mypyscripts
@echo ALL CHECKS PASSED! @echo ALL CHECKS PASSED!
updatethencheckfast2: update updatethencheckfast2: update
@make -j4 cpplintcode pylintscriptsfast mypyscripts pycharmscripts @$(MAKE) -j4 cpplintcode pylintscriptsfast mypyscripts pycharmscripts
@echo ALL CHECKS PASSED! @echo ALL CHECKS PASSED!
updatethencheckfull: update updatethencheckfull: update
@make -j3 cpplintcodefull pylintscriptsfull mypyscriptsfull @$(MAKE) -j3 cpplintcodefull pylintscriptsfull mypyscriptsfull
@echo ALL CHECKS PASSED! @echo ALL CHECKS PASSED!
updatethencheckfull2: update updatethencheckfull2: update
@make -j4 cpplintcodefull pylintscriptsfull mypyscriptsfull pycharmscriptsfull @$(MAKE) -j4 cpplintcodefull pylintscriptsfull mypyscriptsfull pycharmscriptsfull
@echo ALL CHECKS PASSED! @echo ALL CHECKS PASSED!
# Run a format, an update, and then a check. # Run a format, an update, and then a check.
# Handy before pushing commits. # Handy before pushing commits.
preflight: preflight:
@make format @$(MAKE) format
@make updatethencheck @$(MAKE) updatethencheck
@echo PREFLIGHT SUCCESSFUL! @echo PREFLIGHT SUCCESSFUL!
preflight2: preflight2:
@make format @$(MAKE) format
@make updatethencheck2 @$(MAKE) updatethencheck2
@echo PREFLIGHT SUCCESSFUL! @echo PREFLIGHT SUCCESSFUL!
preflightfast: preflightfast:
@make format @$(MAKE) format
@make updatethencheckfast @$(MAKE) updatethencheckfast
@echo PREFLIGHT SUCCESSFUL! @echo PREFLIGHT SUCCESSFUL!
preflightfast2: preflightfast2:
@make format @$(MAKE) format
@make updatethencheckfast2 @$(MAKE) updatethencheckfast2
@echo PREFLIGHT SUCCESSFUL! @echo PREFLIGHT SUCCESSFUL!
preflightfull: preflightfull:
@make formatfull @$(MAKE) formatfull
@make updatethencheckfull @$(MAKE) updatethencheckfull
@echo PREFLIGHT SUCCESSFUL! @echo PREFLIGHT SUCCESSFUL!
preflightfull2: preflightfull2:
@make formatfull @$(MAKE) formatfull
@make updatethencheckfull2 @$(MAKE) updatethencheckfull2
@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.

View File

@ -43,43 +43,43 @@ PROJ_DIR = ..
# Build everything needed for all platforms. # Build everything needed for all platforms.
all: all:
@${TOOLS_DIR}/snippets warm_start_asset_build @${TOOLS_DIR}/snippets warm_start_asset_build
@make assets @$(MAKE) assets
@${TOOLS_DIR}/snippets clean_orphaned_assets @${TOOLS_DIR}/snippets clean_orphaned_assets
# Build everything needed for our cmake builds (linux, mac). # Build everything needed for our cmake builds (linux, mac).
cmake: cmake:
@${TOOLS_DIR}/snippets warm_start_asset_build @${TOOLS_DIR}/snippets warm_start_asset_build
@make assets-cmake @$(MAKE) assets-cmake
@${TOOLS_DIR}/snippets clean_orphaned_assets @${TOOLS_DIR}/snippets clean_orphaned_assets
# Build everything needed for x86 windows builds. # Build everything needed for x86 windows builds.
win-Win32: win-Win32:
@${TOOLS_DIR}/snippets warm_start_asset_build @${TOOLS_DIR}/snippets warm_start_asset_build
@make assets-win-Win32 @$(MAKE) assets-win-Win32
@${TOOLS_DIR}/snippets clean_orphaned_assets @${TOOLS_DIR}/snippets clean_orphaned_assets
# Build everything needed for x86-64 windows builds. # Build everything needed for x86-64 windows builds.
win-x64: win-x64:
@${TOOLS_DIR}/snippets warm_start_asset_build @${TOOLS_DIR}/snippets warm_start_asset_build
@make assets-win-x64 @$(MAKE) assets-win-x64
@${TOOLS_DIR}/snippets clean_orphaned_assets @${TOOLS_DIR}/snippets clean_orphaned_assets
# Build everything needed for our mac xcode builds. # Build everything needed for our mac xcode builds.
mac: mac:
@${TOOLS_DIR}/snippets warm_start_asset_build @${TOOLS_DIR}/snippets warm_start_asset_build
@make assets-mac @$(MAKE) assets-mac
@${TOOLS_DIR}/snippets clean_orphaned_assets @${TOOLS_DIR}/snippets clean_orphaned_assets
# Build everything needed for our ios/tvos builds. # Build everything needed for our ios/tvos builds.
ios: ios:
@${TOOLS_DIR}/snippets warm_start_asset_build @${TOOLS_DIR}/snippets warm_start_asset_build
@make assets-ios @$(MAKE) assets-ios
@${TOOLS_DIR}/snippets clean_orphaned_assets @${TOOLS_DIR}/snippets clean_orphaned_assets
# Build everything needed for android. # Build everything needed for android.
android: android:
@${TOOLS_DIR}/snippets warm_start_asset_build @${TOOLS_DIR}/snippets warm_start_asset_build
@make assets-android @$(MAKE) assets-android
@${TOOLS_DIR}/snippets clean_orphaned_assets @${TOOLS_DIR}/snippets clean_orphaned_assets
MAKE_AUDIO = 1 MAKE_AUDIO = 1

View File

@ -18,7 +18,13 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE. # SOFTWARE.
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
"""A simple cloud caching system for making built binaries/assets available.""" """A simple cloud caching system for making built binaries/assets available.
The basic idea here is the ballistica-internal project can flag file targets
in its Makefiles as 'cached', and the public version of those Makefiles will
be filtered to contain cache downloads in place of the original build commands.
Cached files are gathered and uploaded as part of the pubsync process.
"""
from __future__ import annotations from __future__ import annotations
@ -201,6 +207,7 @@ def update_cache(makefile_dirs: List[str]) -> None:
print(f"Starter cache includes {len(fnames1)} items;" print(f"Starter cache includes {len(fnames1)} items;"
f" excludes {len(fnames2)}") f" excludes {len(fnames2)}")
# Push what we just wrote to the staging server # Push what we just wrote to the staging server
print('Pushing cache to staging...', flush=True) print('Pushing cache to staging...', flush=True)
run('rsync --recursive build/efrocache/' run('rsync --recursive build/efrocache/'