From 1e779e30ef68bbc07fa7a205403d585868dc6b35 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sun, 2 Apr 2023 19:16:48 +0300 Subject: Makefile for the API --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 Makefile diff --git a/Makefile b/Makefile new file mode 100755 index 0000000..d90b8b7 --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +## +# Compiles the API into `./build/ak-daemon` +CC=`which npx` +PLATFORM=`printf 'const os = require("os");console.log(os.platform())' | node` +ARCH=`printf 'const os = require("os");console.log(os.arch())' | node` +TARGET="--target node18-$(PLATFORM)-$(ARCH)" +OUTPUT="./build/ak-daemon" +SOURCE="./api/index.js" +CFLAGS="pkg" + +all: + $(CC) $(CFLAGS) $(TARGET) --output $(OUTPUT) $(SOURCE) -- cgit v1.2.3