Skip to content

Commit

Permalink
Makefile: Simplify Makefile.unikernel
Browse files Browse the repository at this point in the history
Move file generation rules (.config, model.h, tokenizer.h) out of
`Makefile.unikernel` and into `Makefile`. This simplifies
`Makefile.unikernel` making it Unikraft-specific. And making it easy to
reuse as part of `make -f Makefile.unikraft ...` rules.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
  • Loading branch information
razvand committed Sep 27, 2023
1 parent 92f7631 commit 91a2d19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ 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
Expand Down
7 changes: 0 additions & 7 deletions Makefile.unikernel
Original file line number Diff line number Diff line change
@@ -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):
Expand Down

0 comments on commit 91a2d19

Please sign in to comment.