Skip to content

Commit

Permalink
support arm/pi executables
Browse files Browse the repository at this point in the history
  • Loading branch information
teras committed Jan 6, 2020
1 parent 8409da1 commit 801d2b1
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
.PHONY: clean all osx linux windows current run
.PHONY: clean all desktop osx linux pi windows current run

include config.mk

ALLNIMOPTS=-d:release --opt:size ${NIMOPTS}

all:osx linux windows
desktop:osx linux windows

all:desktop pi

clean:
rm -rf target nimcache
Expand All @@ -15,7 +17,10 @@ linux:target/${NAME}.linux

windows:target/${NAME}.64.exe

pi:target/${NAME}.arm.linux target/${NAME}.arm64.linux

current:${NIMFILES}
mkdir -p target
nim ${COMPILER} ${ALLNIMOPTS} ${NAME}

target/${NAME}.osx:${NIMFILES}
Expand All @@ -29,13 +34,22 @@ target/${NAME}.linux:${NIMFILES}
docker run --rm -v `pwd`:/usr/src/app -w /usr/src/app teras/nimcross bash -c "nim ${COMPILER} ${ALLNIMOPTS} ${NAME} && strip ${NAME}"
mv ${NAME} target/${NAME}.linux

target/${NAME}.arm.linux:${NIMFILES}
mkdir -p target
docker run --rm -v `pwd`:/usr/src/app -w /usr/src/app teras/nimcross bash -c "nim ${COMPILER} ${ALLNIMOPTS} --cpu:arm --os:linux ${NAME} && arm-linux-gnueabi-strip ${NAME}"
mv ${NAME} target/${NAME}.arm.linux

target/${NAME}.arm64.linux:${NIMFILES}
mkdir -p target
docker run --rm -v `pwd`:/usr/src/app -w /usr/src/app teras/nimcross bash -c "nim ${COMPILER} ${ALLNIMOPTS} --cpu:arm64 --os:linux ${NAME} && aarch64-linux-gnu-strip ${NAME}"
mv ${NAME} target/${NAME}.arm64.linux

target/${NAME}.64.exe:${NIMFILES}
mkdir -p target
docker run --rm -v `pwd`:/usr/src/app -w /usr/src/app teras/nimcross bash -c "nim ${COMPILER} ${ALLNIMOPTS} -d:mingw --cpu:i386 --app:${WINAPP} ${NAME} && i686-w64-mingw32-strip ${NAME}.exe"
mv ${NAME}.exe target/${NAME}.32.exe
docker run --rm -v `pwd`:/usr/src/app -w /usr/src/app teras/nimcross bash -c "nim ${COMPILER} ${ALLNIMOPTS} -d:mingw --cpu:amd64 --app:${WINAPP} ${NAME} && x86_64-w64-mingw32-strip ${NAME}.exe"
mv ${NAME}.exe target/${NAME}.64.exe


run:osx
./target/${NAME}.osx ${RUNARGS}

0 comments on commit 801d2b1

Please sign in to comment.