ifeq (@(TUP_ARCH),arm64)
	CPU = arm64
endif
ifeq (@(TUP_ARCH),i386)
	CPU = i386
endif
ifeq (@(TUP_ARCH),x86_64)
	CPU = amd64
endif

!nim_build = |> ^o Nimble %B^ \
	PKG_CONFIG_PATH=@(PKG_CONFIG_PATH) PATH=$PATH:@(TOOLCHAIN_PATH) nimble cpp $(NIM_RELEASE_FLAG) $(NIM_FLAGS) --cpu:$(CPU) --os:genode -d:posix --parallelBuild:1 -o:%B %f \
|> %B ./<binaries>

: foreach $(NIM_SRC_DIR)/*.nim |> !nim_build |> {binary}
: foreach {binary} |> !collect_bin |>
: |> !bin |>
