@@ -100,25 +100,27 @@ test:
100100.PHONY : install-dev install
101101
102102# # Install and build dependencies for release
103- install : install-submodule install-zig-js-runtime install-netsurf install-mimalloc
103+ install : install-submodule install-zig-js-runtime install-libiconv install- netsurf install-mimalloc
104104
105105# # Install and build dependencies for dev
106- install-dev : install-submodule install-zig-js-runtime-dev install-netsurf-dev install-mimalloc-dev
106+ install-dev : install-submodule install-zig-js-runtime-dev install-libiconv install- netsurf-dev install-mimalloc-dev
107107
108108install-netsurf-dev : _install-netsurf
109109install-netsurf-dev : OPTCFLAGS := -O0 -g -DNDEBUG
110110
111111install-netsurf : _install-netsurf
112112install-netsurf : OPTCFLAGS := -DNDEBUG
113113
114- BC_NS := $(BC ) vendor/netsurf
114+ BC_NS := $(BC ) vendor/netsurf/out/ $( OS ) - $( ARCH )
115115ICONV := $(BC ) vendor/libiconv/out/$(OS ) -$(ARCH )
116116# TODO: add Linux iconv path (I guess it depends on the distro)
117117# TODO: this way of linking libiconv is not ideal. We should have a more generic way
118118# and stick to a specif version. Maybe build from source. Anyway not now.
119- _install-netsurf : install-libiconv
119+ _install-netsurf : clean-netsurf
120120 @printf " \e[36mInstalling NetSurf...\e[0m\n" && \
121- ls $(ICONV ) 1> /dev/null || (printf " \e[33mERROR: you need to install libiconv in your system (on MacOS on with Homebrew)\e[0m\n" ; exit 1; ) && \
121+ ls $(ICONV ) /lib/libiconv.a 1> /dev/null || (printf " \e[33mERROR: you need to execute 'make install-libiconv'\e[0m\n" ; exit 1; ) && \
122+ mkdir -p $(BC_NS ) && \
123+ cp -R vendor/netsurf/share $(BC_NS ) && \
122124 export PREFIX=$(BC_NS ) && \
123125 export OPTLDFLAGS=" -L$( ICONV) /lib" && \
124126 export OPTCFLAGS=" $( OPTCFLAGS) -I$( ICONV) /include" && \
@@ -156,10 +158,7 @@ _install-netsurf: install-libiconv
156158
157159clean-netsurf :
158160 @printf " \e[36mCleaning NetSurf build...\e[0m\n" && \
159- cd vendor/netsurf && \
160- rm -R build && \
161- rm -R lib && \
162- rm -R include
161+ rm -Rf $(BC_NS )
163162
164163test-netsurf :
165164 @printf " \e[36mTesting NetSurf...\e[0m\n" && \
@@ -195,6 +194,7 @@ install-zig-js-runtime:
195194 make install
196195
197196.PHONY : _build_mimalloc
197+
198198MIMALLOC := $(BC ) vendor/mimalloc/out/$(OS ) -$(ARCH )
199199_build_mimalloc : clean-mimalloc
200200 @mkdir -p $(MIMALLOC ) /build && \
0 commit comments