Skip to content

Commit

Permalink
nimage
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Sep 25, 2024
1 parent c310a00 commit c8b69ff
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -281,22 +281,25 @@ bin/java-%.bin: java/%.java | bin
export JAVA_HOME
fi
nimage=$(NI)
if ! $${nimage} --version; then
if ! "$${nimage}" --version; then
nimage=/usr/local/graalvm/bin/native-image
fi
if ! $${nimage} --version; then
if ! "$${nimage}" --version; then
nimage=/Library/Java/JavaVirtualMachines/*/Contents/Home/bin/native-image
fi
if ! "$${nimage}" --version; then
echo "Most probably you don't have GraalVM installed"
exit 1
fi
name=$(subst java/,,$(<:.java=))
mkdir -p "tmp/$${name}"
$(JAVAC) -d "tmp/$${name}" "$<"
"$(JAVAC)" -d "tmp/$${name}" "$<"
if [ "$$(uname)" == "Darwin" ]; then
jar -c -e "$${name}" -f "tmp/$${name}.jar" -C "tmp/$${name}" .
else
jar cfe "tmp/$${name}.jar" "$${name}" -C "tmp/$${name}" .
fi
$${nimage} $(NIFLAGS) -jar "tmp/$${name}.jar" "$@"
"$${nimage}" $(NIFLAGS) -jar "tmp/$${name}.jar" "$@"

reports/%.txt: bin/%.bin asm/%.asm | reports
"$<" 7 1
Expand Down

0 comments on commit c8b69ff

Please sign in to comment.