mirror of https://github.com/axmolengine/axmol.git
Copy resources in HelloCpp makefile
This commit is contained in:
parent
47ed9c663a
commit
8da87fe009
|
@ -8,9 +8,11 @@ SOURCES = main.cpp \
|
||||||
|
|
||||||
RESOURCE_PATH = ../Resources/iphone
|
RESOURCE_PATH = ../Resources/iphone
|
||||||
|
|
||||||
RESOURCE_FLAGS = --preload CloseNormal.png \
|
RESOURCES = CloseNormal.png \
|
||||||
--preload CloseSelected.png \
|
CloseSelected.png \
|
||||||
--preload HelloWorld.png
|
HelloWorld.png
|
||||||
|
|
||||||
|
FONT_PATH = ../Resources/fonts
|
||||||
|
|
||||||
COCOS_ROOT = ../../../..
|
COCOS_ROOT = ../../../..
|
||||||
include $(COCOS_ROOT)/cocos2dx/proj.emscripten/cocos2dx.mk
|
include $(COCOS_ROOT)/cocos2dx/proj.emscripten/cocos2dx.mk
|
||||||
|
@ -22,12 +24,19 @@ $(TARGET).js: $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST)
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS)
|
$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS)
|
||||||
|
|
||||||
# TODO: Make this rule not an egregious hack.
|
|
||||||
$(TARGET).data:
|
$(TARGET).data:
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
(cd $(RESOURCE_PATH); python $(PACKAGER) $(EXECUTABLE).data $(RESOURCE_FLAGS) --pre-run) > $(RESOURCE_PATH)/$(EXECUTABLE).data.js
|
$(eval RESTMP := $(shell mktemp -d /tmp/cocos-emscripten.XXXXXX))
|
||||||
mv $(RESOURCE_PATH)/$(EXECUTABLE).data $@
|
# Always need a font path, so ensure that it is created first.
|
||||||
mv $(RESOURCE_PATH)/$(EXECUTABLE).data.js $@.js
|
mkdir -p $(RESTMP)/fonts
|
||||||
|
(cd $(RESOURCE_PATH) && cp -a $(RESOURCES) $(RESTMP))
|
||||||
|
(cd $(FONT_PATH) && cp -a * $(RESTMP)/fonts)
|
||||||
|
# NOTE: we copy the system arial.ttf so that there is always a fallback.
|
||||||
|
cp /Library/Fonts/Arial.ttf $(RESTMP)/fonts/arial.ttf
|
||||||
|
(cd $(RESTMP); python $(PACKAGER) $(EXECUTABLE).data $(patsubst %,--preload %,$(RESOURCES)) --preload fonts --pre-run > $(EXECUTABLE).data.js)
|
||||||
|
mv $(RESTMP)/$(EXECUTABLE).data $@
|
||||||
|
mv $(RESTMP)/$(EXECUTABLE).data.js $@.js
|
||||||
|
rm -rf $(RESTMP)
|
||||||
|
|
||||||
$(BIN_DIR)/index.html: index.html
|
$(BIN_DIR)/index.html: index.html
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
|
|
Loading…
Reference in New Issue