Skip to content

Commit

Permalink
wiring up efrocache to use pcommandbatch
Browse files Browse the repository at this point in the history
  • Loading branch information
efroemling committed Aug 17, 2023
1 parent 6b568d4 commit 091b158
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 99 deletions.
60 changes: 28 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,10 @@ prefab-mac-arm64-gui-debug-build: prereqs assets-cmake \
@$(STAGE_BUILD) -cmake -debug build/prefab/full/mac_arm64_gui/debug

build/prefab/full/mac_%_gui/debug/ballisticakit: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

build/prefab/lib/mac_%_gui/debug/libballisticaplus.a: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

# Mac gui release:

Expand All @@ -296,10 +296,10 @@ prefab-mac-arm64-gui-release-build: prereqs assets-cmake \
@$(STAGE_BUILD) -cmake -release build/prefab/full/mac_arm64_gui/release

build/prefab/full/mac_%_gui/release/ballisticakit: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

build/prefab/lib/mac_%_gui/release/libballisticaplus.a: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

# Mac server debug:

Expand All @@ -326,10 +326,10 @@ prefab-mac-arm64-server-debug-build: prereqs assets-server \
@$(STAGE_BUILD) -cmakeserver -debug build/prefab/full/mac_arm64_server/debug

build/prefab/full/mac_%_server/debug/dist/ballisticakit_headless: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

build/prefab/lib/mac_%_server/debug/libballisticaplus.a: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

# Mac server release:

Expand Down Expand Up @@ -358,10 +358,10 @@ prefab-mac-arm64-server-release-build: prereqs assets-server \
build/prefab/full/mac_arm64_server/release

build/prefab/full/mac_%_server/release/dist/ballisticakit_headless: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

build/prefab/lib/mac_%_server/release/libballisticaplus.a: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

# Linux gui debug:

Expand All @@ -388,10 +388,10 @@ prefab-linux-arm64-gui-debug-build: prereqs assets-cmake \
@$(STAGE_BUILD) -cmake -debug build/prefab/full/linux_arm64_gui/debug

build/prefab/full/linux_%_gui/debug/ballisticakit: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

build/prefab/lib/linux_%_gui/debug/libballisticaplus.a: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

# Linux gui release:

Expand All @@ -418,10 +418,10 @@ prefab-linux-arm64-gui-release-build: prereqs assets-cmake \
@$(STAGE_BUILD) -cmake -release build/prefab/full/linux_arm64_gui/release

build/prefab/full/linux_%_gui/release/ballisticakit: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

build/prefab/lib/linux_%_gui/release/libballisticaplus.a: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

# Linux server debug:

Expand Down Expand Up @@ -450,10 +450,10 @@ prefab-linux-arm64-server-debug-build: prereqs assets-server \
build/prefab/full/linux_arm64_server/debug

build/prefab/full/linux_%_server/debug/dist/ballisticakit_headless: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

build/prefab/lib/linux_%_server/debug/libballisticaplus.a: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

# Linux server release:

Expand Down Expand Up @@ -482,10 +482,10 @@ prefab-linux-arm64-server-release-build: prereqs assets-server \
build/prefab/full/linux_arm64_server/release

build/prefab/full/linux_%_server/release/dist/ballisticakit_headless: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

build/prefab/lib/linux_%_server/release/libballisticaplus.a: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

# Windows gui debug:

Expand All @@ -502,13 +502,13 @@ prefab-windows-x86-gui-debug-build: prereqs assets-windows-$(WINPLAT_X86) \
build/prefab/full/windows_x86_gui/debug

build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

build/prefab/lib/windows/Debug_%/BallisticaKitGenericPlus.lib: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

build/prefab/lib/windows/Debug_%/BallisticaKitGenericPlus.pdb: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

# Windows gui release:

Expand All @@ -526,13 +526,13 @@ prefab-windows-x86-gui-release-build: prereqs \
build/prefab/full/windows_x86_gui/release

build/prefab/full/windows_x86_gui/release/BallisticaKit.exe: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

build/prefab/lib/windows/Release_%/BallisticaKitGenericPlus.lib: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

build/prefab/lib/windows/Release_%/BallisticaKitGenericPlus.pdb: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

# Windows server debug:

Expand All @@ -551,13 +551,13 @@ prefab-windows-x86-server-debug-build: prereqs \
build/prefab/full/windows_x86_server/debug

build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

build/prefab/lib/windows/Debug_%/BallisticaKitHeadlessPlus.lib: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

build/prefab/lib/windows/Debug_%/BallisticaKitHeadlessPlus.pdb: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

# Windows server release:

Expand All @@ -576,13 +576,13 @@ prefab-windows-x86-server-release-build: prereqs \
build/prefab/full/windows_x86_server/release

build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

build/prefab/lib/windows/Release_%/BallisticaKitHeadlessPlus.lib: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

build/prefab/lib/windows/Release_%/BallisticaKitHeadlessPlus.pdb: .efrocachemap
@tools/pcommand efrocache_get $@
@.cache/pcommandbatch/pcommandbatch efrocache_get $@

# Tell make which of these targets don't represent files.
.PHONY: prefab-gui-debug prefab-gui-release prefab-gui-debug-build \
Expand Down Expand Up @@ -1222,10 +1222,6 @@ SKIP_ENV_CHECKS ?= 0
tools/pcommand checkenv && mkdir -p .cache && touch .cache/checkenv; \
fi

foof: CHANGELOG.md CONTRIBUTORS.md Makefile
echo OUT IS $@
echo IN IS $^

$(PCOMMANDBATCHBIN): src/tools/pcommandbatch/pcommandbatch.c \
src/tools/pcommandbatch/cJSON.c
@tools/pcommand build_pcommandbatch $^ $@
Expand Down
52 changes: 26 additions & 26 deletions src/assets/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1757,7 +1757,7 @@ SCRIPT_TARGETS_PYC_PRIVATE_APPLE = \
# Rule to copy src asset scripts to dst.
# (and make non-writable so I'm less likely to accidentally edit them there)
$(SCRIPT_TARGETS_PY_PRIVATE_APPLE) : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

# These are too complex to define in a pattern rule;
# Instead we generate individual targets in a loop.
Expand Down Expand Up @@ -2701,7 +2701,7 @@ SCRIPT_TARGETS_PYC_PRIVATE_ANDROID = \
# Rule to copy src asset scripts to dst.
# (and make non-writable so I'm less likely to accidentally edit them there)
$(SCRIPT_TARGETS_PY_PRIVATE_ANDROID) : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

# These are too complex to define in a pattern rule;
# Instead we generate individual targets in a loop.
Expand Down Expand Up @@ -2759,7 +2759,7 @@ SCRIPT_TARGETS_PYC_PRIVATE_COMMON = \
# Rule to copy src asset scripts to dst.
# (and make non-writable so I'm less likely to accidentally edit them there)
$(SCRIPT_TARGETS_PY_PRIVATE_COMMON) : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

# These are too complex to define in a pattern rule;
# Instead we generate individual targets in a loop.
Expand Down Expand Up @@ -3687,7 +3687,7 @@ SCRIPT_TARGETS_PYC_PRIVATE_WIN_WIN32 = \
# Rule to copy src asset scripts to dst.
# (and make non-writable so I'm less likely to accidentally edit them there)
$(SCRIPT_TARGETS_PY_PRIVATE_WIN_WIN32) : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

# These are too complex to define in a pattern rule;
# Instead we generate individual targets in a loop.
Expand Down Expand Up @@ -4615,7 +4615,7 @@ SCRIPT_TARGETS_PYC_PRIVATE_WIN_X64 = \
# Rule to copy src asset scripts to dst.
# (and make non-writable so I'm less likely to accidentally edit them there)
$(SCRIPT_TARGETS_PY_PRIVATE_WIN_X64) : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

# These are too complex to define in a pattern rule;
# Instead we generate individual targets in a loop.
Expand Down Expand Up @@ -7290,7 +7290,7 @@ EXTRAS_TARGETS_WIN_WIN32 = \

# Rule to copy src extras to build.
$(EXTRAS_TARGETS_WIN_WIN32) : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@


EXTRAS_TARGETS_WIN_X64 = \
Expand Down Expand Up @@ -7380,72 +7380,72 @@ EXTRAS_TARGETS_WIN_X64 = \

# Rule to copy src extras to build.
$(EXTRAS_TARGETS_WIN_X64) : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

# __AUTOGENERATED_PRIVATE_END__

ASSET_TARGETS_COMMON_GUI += $(MESH_TARGETS) $(COLLISION_MESH_TARGETS)
ASSET_TARGETS_COMMON_SERVER += $(COLLISION_MESH_TARGETS)

$(BUILD_DIR)/%.bob : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

$(BUILD_DIR)/%.cob : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

$(BUILD_DIR)/%.ogg : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

$(BUILD_DIR)/%.fdata : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

$(BUILD_DIR)/%.pem : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

# Langdata one-off json file.
$(BUILD_DIR)/ba_data/data/langdata.json : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

# Languages json files.
$(BUILD_DIR)/ba_data/data/languages/%.json : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

# Map json files.
$(BUILD_DIR)/ba_data/data/maps/%.json : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

ba_data/%.tex2d.png : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

ba_data/%_+x.tex2d.png : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

ba_data/%_-x.tex2d.png: ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

ba_data/%_+y.tex2d.png: ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

ba_data/%_-y.tex2d.png: ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

ba_data/%_+z.tex2d.png: ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

ba_data/%_-z.tex2d.png: ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

$(BUILD_DIR)/ba_data/%_preview.png : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

$(BUILD_DIR)/%.dds : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

$(BUILD_DIR)/%.pvr : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

$(BUILD_DIR)/%.ktx : ../../.efrocachemap
@cd ../.. && tools/pcommand efrocache_get src/assets/$@
@cd ../.. && .cache/pcommandbatch/pcommandbatch efrocache_get src/assets/$@

audio: $(AUDIO_TARGETS)
audio-clean:
Expand Down
10 changes: 6 additions & 4 deletions tools/batools/pcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,11 +475,13 @@ def efrocache_get() -> None:
"""Get a file from efrocache."""
from efrotools.efrocache import get_target

pcommand.disallow_in_batch()

if len(sys.argv) != 3:
args = pcommand.get_args()
if len(args) != 1:
raise RuntimeError('Expected exactly 1 arg')
get_target(sys.argv[2])

output = get_target(args[0], batch=pcommand.is_batch(), clr=pcommand.clr())
if pcommand.is_batch():
pcommand.set_output(output)


def get_modern_make() -> None:
Expand Down
3 changes: 2 additions & 1 deletion tools/batools/pcommands2.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ def clean_orphaned_assets() -> None:
def win_ci_install_prereqs() -> None:
"""Install bits needed for basic win ci."""
import json

from efrotools.efrocache import get_target

pcommand.disallow_in_batch()
Expand Down Expand Up @@ -230,7 +231,7 @@ def win_ci_install_prereqs() -> None:
needed_targets.add(target)

for target in needed_targets:
get_target(target)
get_target(target, batch=pcommand.is_batch(), clr=pcommand.clr())


def win_ci_binary_build() -> None:
Expand Down
Loading

0 comments on commit 091b158

Please sign in to comment.