Cleanup makefile (#563)

* Fix whilespace in makefile

* Add happy message after build-all
This commit is contained in:
Sergio 2019-11-18 16:32:05 -05:00 committed by Michael Droettboom
parent 8af0d0526d
commit bd38722f2d
1 changed files with 29 additions and 28 deletions

View File

@ -24,28 +24,28 @@ LDFLAGS=\
-O3 \
-s MODULARIZE=1 \
$(CPYTHONROOT)/installs/python-$(PYVERSION)/lib/libpython$(PYMINOR).a \
$(LZ4LIB) \
-s "BINARYEN_METHOD='native-wasm'" \
-s TOTAL_MEMORY=1073741824 \
-s ALLOW_MEMORY_GROWTH=1 \
$(LZ4LIB) \
-s "BINARYEN_METHOD='native-wasm'" \
-s TOTAL_MEMORY=1073741824 \
-s ALLOW_MEMORY_GROWTH=1 \
-s MAIN_MODULE=1 \
-s EMULATED_FUNCTION_POINTERS=1 \
-s EMULATE_FUNCTION_POINTER_CASTS=1 \
-s LINKABLE=1 \
-s EXPORT_ALL=1 \
-s EMULATE_FUNCTION_POINTER_CASTS=1 \
-s LINKABLE=1 \
-s EXPORT_ALL=1 \
-s EXPORTED_FUNCTIONS='["___cxa_guard_acquire", "__ZNSt3__28ios_base4initEPv"]' \
-s WASM=1 \
-s WASM=1 \
-s SWAPPABLE_ASM_MODULE=1 \
-s USE_FREETYPE=1 \
-s USE_LIBPNG=1 \
-std=c++14 \
-L$(wildcard $(CPYTHONROOT)/build/sqlite*/.libs) -lsqlite3 \
$(wildcard $(CPYTHONROOT)/build/bzip2*/libbz2.a) \
-lstdc++ \
--memory-init-file 0 \
-s "BINARYEN_TRAP_MODE='clamp'" \
-s TEXTDECODER=0 \
-s LZ4=1
-L$(wildcard $(CPYTHONROOT)/build/sqlite*/.libs) -lsqlite3 \
$(wildcard $(CPYTHONROOT)/build/bzip2*/libbz2.a) \
-lstdc++ \
--memory-init-file 0 \
-s "BINARYEN_TRAP_MODE='clamp'" \
-s TEXTDECODER=0 \
-s LZ4=1
SIX_ROOT=six/six-1.11.0/build/lib
SIX_LIBS=$(SIX_ROOT)/six.py
@ -64,11 +64,12 @@ all: build/pyodide.asm.js \
build/pyodide_dev.js \
build/console.html \
build/renderedhtml.css \
build/test.data \
build/packages.json \
build/test.html \
build/webworker.js \
build/webworker_dev.js
build/test.data \
build/packages.json \
build/test.html \
build/webworker.js \
build/webworker_dev.js
echo -e "\nSUCCESS!"
build/pyodide.asm.js: src/main.bc src/jsimport.bc src/jsproxy.bc src/js2python.bc \
@ -76,7 +77,7 @@ build/pyodide.asm.js: src/main.bc src/jsimport.bc src/jsproxy.bc src/js2python.b
src/runpython.bc src/hiwire.bc
[ -d build ] || mkdir build
$(CXX) -s EXPORT_NAME="'pyodide'" -o build/pyodide.asm.html $(filter %.bc,$^) \
$(LDFLAGS) -s FORCE_FILESYSTEM=1
$(LDFLAGS) -s FORCE_FILESYSTEM=1
rm build/pyodide.asm.html
@ -88,7 +89,7 @@ build/pyodide.asm.data: root/.built
( \
cd build; \
python $(FILEPACKAGER) pyodide.asm.data --abi=$(PYODIDE_PACKAGE_ABI) --lz4 --preload ../root/lib@lib --js-output=pyodide.asm.data.js --use-preload-plugins \
)
)
uglifyjs build/pyodide.asm.data.js -o build/pyodide.asm.data.js
@ -156,20 +157,20 @@ clean:
build/test.data: $(CPYTHONLIB)
( \
cd $(CPYTHONLIB)/test; \
find . -type d -name __pycache__ -prune -exec rm -rf {} \; \
cd $(CPYTHONLIB)/test; \
find . -type d -name __pycache__ -prune -exec rm -rf {} \; \
)
( \
cd build; \
python $(FILEPACKAGER) test.data --abi=$(PYODIDE_PACKAGE_ABI) --lz4 --preload ../$(CPYTHONLIB)/test@/lib/python3.7/test --js-output=test.js --export-name=pyodide._module --exclude __pycache__ \
)
)
uglifyjs build/test.js -o build/test.js
root/.built: \
$(CPYTHONLIB) \
$(SIX_LIBS) \
$(JEDI_LIBS) \
$(JEDI_LIBS) \
$(PARSO_LIBS) \
src/sitecustomize.py \
src/webbrowser.py \
@ -211,9 +212,9 @@ $(PYODIDE_CXX):
mkdir -p $(PYODIDE_ROOT)/ccache ; \
if test ! -h $@; then \
if hash ccache &>/dev/null; then \
ln -s `which ccache` $@ ; \
ln -s `which ccache` $@ ; \
else \
ln -s emsdk/emsdk/emscripten/tag-$(EMSCRIPTEN_VERSION)/em++ $@; \
ln -s emsdk/emsdk/emscripten/tag-$(EMSCRIPTEN_VERSION)/em++ $@; \
fi; \
fi