more work on efrocache

This commit is contained in:
Eric Froemling 2019-10-12 17:25:01 -07:00
parent 0c3f02af89
commit 47a74d45d0
2 changed files with 49 additions and 2 deletions

View File

@ -63,6 +63,53 @@ all:
# TEMP EFROCACHE TESTING------------------------------------------------
build/testfile_a: ../.efrocachemap
cd .. && tools/snippets efrocache_get assets/$@
EFROCACHE_FILES = build/testfile_a
# Build everything we want available in efrocache
efrocache_build: $(EFROCACHE_FILES)
# Print everything in efrocache
efrocache_list:
@echo $(EFROCACHE_FILES)
# ---------------------------------------------------------------------
# Build everything needed for desktop platforms (mac, windows, linux).
desktop:
@test -d ${ASSET_SRC_MASTER_DIR} && make asset_sources || true
@${TOOLS_DIR}/convert_util --init-asset-cache
@make assets-desktop
@${TOOLS_DIR}/snippets clean_orphaned_assets
# Build everything needed for ios.
ios:
@test -d ${ASSET_SRC_MASTER_DIR} && make asset_sources || true
@${TOOLS_DIR}/convert_util --init-asset-cache
@make assets-ios
@${TOOLS_DIR}/snippets clean_orphaned_assets
# Build everything needed for android.
android:
@test -d ${ASSET_SRC_MASTER_DIR} && make asset_sources || true
@${TOOLS_DIR}/convert_util --init-asset-cache
@make assets-android
@${TOOLS_DIR}/snippets clean_orphaned_assets
MAKE_AUDIO = 1
MAKE_TEXTURES = 1
MAKE_SCRIPTS = 1
MAKE_FONTS = 1
MAKE_DATA = 1
ASSET_TARGETS_COMMON =
ASSET_TARGETS_DESKTOP =
ASSET_TARGETS_IOS =
ASSET_TARGETS_ANDROID =
# Audio.
ifeq ($(MAKE_AUDIO),1)

View File

@ -112,7 +112,7 @@ def filter_makefile(makefile_dir: str, contents: str) -> str:
# Strip out parts they don't want.
while STRIP_BEGIN_TAG in lines:
index = lines.index(TARGET_TAG)
index = lines.index(STRIP_BEGIN_TAG)
endindex = index
while lines[endindex] != STRIP_END_TAG:
endindex += 1
@ -128,7 +128,7 @@ def filter_makefile(makefile_dir: str, contents: str) -> str:
del lines[index:endindex]
lines.insert(index, tname + ': ' + cachemap)
target = (makefile_dir + '/' + '$@') if makefile_dir else '$@'
pre = 'cd {to_proj_root} && ' if makefile_dir else ''
pre = f'cd {to_proj_root} && ' if makefile_dir else ''
lines.insert(index + 1, f'\t{pre}{snippets} efrocache_get {target}')
return '\n'.join(lines) + '\n'