Commit 8e55a314 authored by Nicolas "Norswap" Laurent's avatar Nicolas "Norswap" Laurent Committed by norswap

makefile improvements for MacOS

parent 8c3a89f6
...@@ -15,18 +15,22 @@ submodules: ...@@ -15,18 +15,22 @@ submodules:
unicorn/build: unicorn/CMakeLists.txt unicorn/build: unicorn/CMakeLists.txt
mkdir -p unicorn/build mkdir -p unicorn/build
cd unicorn/build && cmake .. -DUNICORN_ARCH=mips -DCMAKE_BUILD_TYPE=Release cd unicorn/build && cmake .. -DUNICORN_ARCH=mips -DCMAKE_BUILD_TYPE=Release
# Not sure why, but the second invocation is needed for fresh installs on MacOS.
if [ "$(uname)" == "Darwin" ]; then \
cd unicorn/build && cmake .. -DUNICORN_ARCH=mips -DCMAKE_BUILD_TYPE=Release; \
fi
# Rebuild whenever anything in the directory changes. # Rebuild whenever anything in the unicorn/ directory changes.
unicorn/build/libunicorn.so unicorn/build/libunicorn.so.1: unicorn/build unicorn unicorn/build/libunicorn.so: unicorn/build unicorn
cd unicorn/build && make -j8 cd unicorn/build && make -j8
# The Go linker / runtime expects these to be there! # The Go linker / runtime expects dynamic libraries in the unicorn/ dir.
cp unicorn/build/libunicorn.so.1 unicorn find ./unicorn/build -name "libunicorn.*" | xargs -L 1 -I {} cp {} ./unicorn/
cp unicorn/build/libunicorn.so unicorn # Update timestamp on libunicorn.so to make it more recent than the build/ dir.
# Update timestamp to make it more recent than the directory # On Mac this will create a new empty file (dyn libraries are .dylib), but works
touch unicorn/build/libunicorn.so.1 # fine for the purpose of avoiding recompilation.
touch unicorn/build/libunicorn.so touch unicorn/build/libunicorn.so
libunicorn: unicorn/build/libunicorn.so unicorn/build/libunicorn.so.1 libunicorn: unicorn/build/libunicorn.so
.PHONY: libunicorn .PHONY: libunicorn
libunicorn_rebuild: libunicorn_rebuild:
...@@ -51,7 +55,7 @@ contracts: nodejs ...@@ -51,7 +55,7 @@ contracts: nodejs
.PHONY: contracts .PHONY: contracts
nodejs: nodejs:
if [ -x "$(command -v pnpm)" ]; then \ if [ -x "$$(command -v pnpm)" ]; then \
pnpm install; \ pnpm install; \
else \ else \
npm install; \ npm install; \
...@@ -114,7 +118,7 @@ clean: ...@@ -114,7 +118,7 @@ clean:
rm -f mipigo/minigeth.bin rm -f mipigo/minigeth.bin
rm -f mipsevm/mipsevm rm -f mipsevm/mipsevm
rm -rf artifacts rm -rf artifacts
rm -r rm -f unicorn/libunicorn.*
.PHONY: clean .PHONY: clean
mrproper: clean mrproper: clean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment