mirror of https://github.com/pyodide/pyodide.git
MAINT Minor Makefile improvements (#1161)
This commit is contained in:
parent
81810a4c4b
commit
fd351bc4fc
50
Makefile
50
Makefile
|
@ -1,5 +1,7 @@
|
|||
PYODIDE_ROOT=$(abspath .)
|
||||
|
||||
include Makefile.envs
|
||||
|
||||
.PHONY=check
|
||||
|
||||
FILEPACKAGER=$$EM_DIR/tools/file_packager.py
|
||||
|
@ -14,12 +16,17 @@ PYODIDE_CXX=$(PYODIDE_ROOT)/ccache/em++
|
|||
CC=emcc
|
||||
CXX=em++
|
||||
OPTFLAGS=-O2
|
||||
CFLAGS=$(OPTFLAGS) -g -I$(PYTHONINCLUDE) -fPIC \
|
||||
-Wno-warn-absolute-paths -Werror=int-conversion -Werror=incompatible-pointer-types \
|
||||
CFLAGS=\
|
||||
$(OPTFLAGS) \
|
||||
-g \
|
||||
-I$(PYTHONINCLUDE) \
|
||||
-fPIC \
|
||||
-Wno-warn-absolute-paths \
|
||||
-Werror=int-conversion \
|
||||
-Werror=incompatible-pointer-types \
|
||||
$(EXTRA_CFLAGS)
|
||||
|
||||
LDFLAGS=\
|
||||
-O2 \
|
||||
$(OPTFLAGS) \
|
||||
-s MODULARIZE=1 \
|
||||
$(CPYTHONROOT)/installs/python-$(PYVERSION)/lib/libpython$(PYMINOR).a \
|
||||
-s TOTAL_MEMORY=10485760 \
|
||||
|
@ -38,7 +45,7 @@ LDFLAGS=\
|
|||
-lstdc++ \
|
||||
--memory-init-file 0 \
|
||||
-s "BINARYEN_TRAP_MODE='clamp'" \
|
||||
-s LZ4=1 \
|
||||
-s LZ4=1 \
|
||||
$(EXTRA_LDFLAGS)
|
||||
|
||||
all: check \
|
||||
|
@ -54,22 +61,21 @@ all: check \
|
|||
|
||||
|
||||
build/pyodide.asm.js: \
|
||||
src/core/error_handling.o \
|
||||
src/core/hiwire.o \
|
||||
src/core/js2python.o \
|
||||
src/core/jsproxy.o \
|
||||
src/core/keyboard_interrupt.o \
|
||||
src/core/main.o \
|
||||
src/core/pyproxy.o \
|
||||
src/core/python2js_buffer.o \
|
||||
src/core/python2js.o \
|
||||
src/core/runpython.o \
|
||||
src/pystone.py \
|
||||
src/_testcapi.py \
|
||||
src/webbrowser.py \
|
||||
\
|
||||
$(wildcard src/pyodide-py/pyodide/*.py) \
|
||||
$(CPYTHONLIB)
|
||||
src/core/error_handling.o \
|
||||
src/core/hiwire.o \
|
||||
src/core/js2python.o \
|
||||
src/core/jsproxy.o \
|
||||
src/core/keyboard_interrupt.o \
|
||||
src/core/main.o \
|
||||
src/core/pyproxy.o \
|
||||
src/core/python2js_buffer.o \
|
||||
src/core/python2js.o \
|
||||
src/core/runpython.o \
|
||||
src/pystone.py \
|
||||
src/_testcapi.py \
|
||||
src/webbrowser.py \
|
||||
$(wildcard src/pyodide-py/pyodide/*.py) \
|
||||
$(CPYTHONLIB)
|
||||
date +"[%F %T] Building pyodide.asm.js..."
|
||||
[ -d build ] || mkdir build
|
||||
$(CXX) -s EXPORT_NAME="'pyodide'" -o build/pyodide.asm.js $(filter %.o,$^) \
|
||||
|
@ -153,7 +159,7 @@ build/test.data: $(CPYTHONLIB) $(UGLIFYJS)
|
|||
)
|
||||
( \
|
||||
cd build; \
|
||||
python $(FILEPACKAGER) test.data --lz4 --preload ../$(CPYTHONLIB)/test@/lib/python3.8/test --js-output=test.js --export-name=pyodide._module --exclude __pycache__ \
|
||||
python $(FILEPACKAGER) test.data --lz4 --preload ../$(CPYTHONLIB)/test@/lib/python$(PYMINOR)/test --js-output=test.js --export-name=pyodide._module --exclude __pycache__ \
|
||||
)
|
||||
$(UGLIFYJS) build/test.js -o build/test.js
|
||||
|
||||
|
|
Loading…
Reference in New Issue