Skip to content

Commit

Permalink
Added for $(if...) parts in differing configs
Browse files Browse the repository at this point in the history
  • Loading branch information
phorward committed Oct 4, 2021
1 parent 9471c92 commit de25b3f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ build/pyodide.asm.js: \
$(CPYTHONLIB)
date +"[%F %T] Building pyodide.asm.js..."
[ -d build ] || mkdir build
$(CXX) -v -s EXPORT_NAME="'_createPyodideModule'" -o build/pyodide.asm.js $(filter %.o,$^) \
$(CXX) -s EXPORT_NAME="'_createPyodideModule'" -o build/pyodide.asm.js $(filter %.o,$^) \
$(MAIN_MODULE_LDFLAGS) -s FORCE_FILESYSTEM=1 \
-lidbfs.js \
-lnodefs.js \
-lproxyfs.js \
-lworkerfs.js \
--preload-file $(CPYTHONLIB)@/lib/python$(PYMAJOR).$(PYMINOR) \
$(if $(PYODIDE_BUILD), "", "--preload-file src/webbrowser.py@/lib/python$(PYMAJOR).$(PYMINOR)/webbrowser.py") \
$(if $(PYODIDE_BUILD), "", "--preload-file src/_testcapi.py@/lib/python$(PYMAJOR).$(PYMINOR)/_testcapi.py") \
$(if $(PYODIDE_BUILD), "", "--preload-file src/_testinternalcapi.py@/lib/python$(PYMAJOR).$(PYMINOR)/_testinternalcapi.py") \
$(if $(PYODIDE_BUILD), "", "--preload-file src/pystone.py@/lib/python$(PYMAJOR).$(PYMINOR)/pystone.py") \
$(if $(PYODIDE_BUILD), , "--preload-file src/webbrowser.py@/lib/python$(PYMAJOR).$(PYMINOR)/webbrowser.py") \
$(if $(PYODIDE_BUILD), , "--preload-file src/_testcapi.py@/lib/python$(PYMAJOR).$(PYMINOR)/_testcapi.py") \
$(if $(PYODIDE_BUILD), , "--preload-file src/_testinternalcapi.py@/lib/python$(PYMAJOR).$(PYMINOR)/_testinternalcapi.py") \
$(if $(PYODIDE_BUILD), , "--preload-file src/pystone.py@/lib/python$(PYMAJOR).$(PYMINOR)/pystone.py") \
--preload-file src/py/pyodide@/lib/python$(PYMAJOR).$(PYMINOR)/site-packages/pyodide \
--preload-file src/py/_pyodide@/lib/python$(PYMAJOR).$(PYMINOR)/site-packages/_pyodide \
--exclude-file "*__pycache__*" \
Expand Down Expand Up @@ -224,12 +224,15 @@ emsdk/emsdk/.complete:

FORCE:

check: $(UGLIFYJS)

check:
./tools/dependency-check.sh


minimal :
PYODIDE_PACKAGES+=",micropip" make


debug :
EXTRA_CFLAGS+=" -D DEBUG_F" \
PYODIDE_PACKAGES+=", micropip, pyparsing, pytz, packaging, " \
Expand Down
12 changes: 7 additions & 5 deletions Makefile.envs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export PYODIDE=1
export PYODIDE_PACKAGE_ABI=1
export EM_COMPILER_WRAPPER=ccache

export OPTFLAGS=-Os
export OPTFLAGS=$(if $(PYODIDE_BUILD), "-Os", "-O2")
export CFLAGS_BASE=\
$(OPTFLAGS) \
-g \
Expand All @@ -53,7 +53,9 @@ export LDFLAGS_BASE=\
export CXXFLAGS_BASE=

export SIDE_MODULE_LDFLAGS= $(LDFLAGS_BASE) -s SIDE_MODULE=1
export MAIN_MODULE_LDFLAGS= $(LDFLAGS_BASE) \
export MAIN_MODULE_LDFLAGS= \
$(LDFLAGS_BASE) \
$(if $(PYODIDE_BUILD), , "-s MAIN_MODULE=1") \
-s EXPORTED_FUNCTIONS='["___cxa_guard_acquire", "__ZNSt3__28ios_base4initEPv", "_main"]' \
-lpython$(PYMAJOR).$(PYMINOR) \
-lffi \
Expand All @@ -63,11 +65,11 @@ export MAIN_MODULE_LDFLAGS= $(LDFLAGS_BASE) \
-s TOTAL_MEMORY=20971520 \
-s ALLOW_MEMORY_GROWTH=1 \
--use-preload-plugins \
-s USE_FREETYPE=0 \
-s USE_LIBPNG=1 \
-lstdc++ \
-s USE_LIBJPEG=1 \
--memory-init-file 0 \
$(if $(PYODIDE_BUILD), , "-s USE_FREETYPE=1") \
$(if $(PYODIDE_BUILD), , "-s USE_LIBPNG=1") \
$(if $(PYODIDE_BUILD), , "-s USE_LIBJPEG=1") \

export SIDE_MODULE_CXXFLAGS = $(CXXFLAGS_BASE)

Expand Down

0 comments on commit de25b3f

Please sign in to comment.