diff --git a/Makefile b/Makefile index cb30c3db..18698881 100644 --- a/Makefile +++ b/Makefile @@ -201,6 +201,18 @@ run_clang_static_strlit: ## - Optimized Static clang + embedded model build ./strlit -i emb_Model_data $(MOD_PATH) model.h ./strlit -i emb_Tokenizer_data $(TOK_PATH) tokenizer.h clang -Ofast -static -march=native -D STRLIT -D LLOOP run.c -lm -o run + +# Unikraft Unikernel build +.PHONY: run_unik_qemu_x86_64 +run_unik_qemu_x86_64: run.c + [ ! -d "UNIK" ] && echo "Cloning unikraft and musl sources..." || true + [ ! -d "UNIK/unikraft" ] && git clone https://github.com/unikraft/unikraft UNIK/unikraft || true + [ ! -d "UNIK/libs/musl" ] && git clone https://github.com/unikraft/lib-musl UNIK/libs/musl || true + UK_DEFCONFIG=$(shell pwd)/defconfigs/qemu-x86_64 make -f Makefile.unikernel defconfig + gcc -Ofast strliteral.c -o strlit + ./strlit -i emb_Model_data $(MOD_PATH) model.h + ./strlit -i emb_Tokenizer_data $(TOK_PATH) tokenizer.h + make -f Makefile.unikernel # Build for termux on Android ##@ ---> Android diff --git a/Makefile.unikernel b/Makefile.unikernel index 652d9acf..98bd38dd 100644 --- a/Makefile.unikernel +++ b/Makefile.unikernel @@ -1,15 +1,8 @@ UK_ROOT ?= $(PWD)/UNIK/unikraft UK_LIBS ?= $(PWD)/UNIK/libs LIBS := $(UK_LIBS)/musl -# Model / Tokenizer Paths -MOD_PATH = out/model.bin -TOK_PATH = tokenizer.bin all: - UK_DEFCONFIG=$(shell pwd)/defconfigs/qemu-x86_64 make -f Makefile.unikernel defconfig - gcc -Ofast strliteral.c -o strlit - ./strlit -i emb_Model_data $(MOD_PATH) model.h - ./strlit -i emb_Tokenizer_data $(TOK_PATH) tokenizer.h @$(MAKE) -C $(UK_ROOT) A=$(PWD) L=$(LIBS) $(MAKECMDGOALS):