Skip to content

Commit

Permalink
Makefile target for termux
Browse files Browse the repository at this point in the history
Added make run_incbin target for termux on Android

Usage:

In termux do:

pkg upgrade
pkg install git
pkg install make
pkg install clang
pkg install wget
git clone https://github.com/trholding/llama2.c
cd llama2.c
make run_incbin
./run

Ref: #7
  • Loading branch information
trholding committed Aug 26, 2023
1 parent 551b166 commit 57a8071
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,14 @@ run_unik_qemu_x86_64: run.c
[ ! -d "UNIK/libs/musl" ] && git clone https://github.com/unikraft/lib-musl UNIK/libs/musl
make -f Makefile.unikernel

# Build for termux on Android
.PHONY: run_incbin
run_incbin: run.c
wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories15M.bin
mkdir out
mv stories15M.bin out/model.bin
$(CC) -Ofast -D INC_BIN -D MODPATH=$(MOD_PATH) -D TOKPATH=$(TOK_PATH) -o run run.c -lm

# run all tests
.PHONY: test
test:
Expand Down

0 comments on commit 57a8071

Please sign in to comment.