From b48f15690ae67983a3f999eab5c6f7f41fbc0a35 Mon Sep 17 00:00:00 2001 From: Thomas Miceli Date: Tue, 4 Apr 2023 02:13:50 +0200 Subject: [PATCH] Add Makefile --- Makefile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b061687 --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +.PHONY: all install_deps build_frontend build_backend clean + +# Specify the name of your Go binary output +BINARY_NAME := opengist + +all: install_deps build_frontend build_backend + +install_deps: + @echo "Installing NPM dependencies..." + @npm ci || (echo "Error: Failed to install NPM dependencies." && exit 1) + @echo "Installing Go dependencies..." + @go mod download || (echo "Error: Failed to install Go dependencies." && exit 1) + +build_frontend: + @echo "Building frontend assets..." + ./node_modules/.bin/vite build + +build_backend: + @echo "Building Opengist binary..." + go build -o $(BINARY_NAME) opengist.go + +clean: + @echo "Cleaning up build artifacts..." + @rm -f $(BINARY_NAME) public/manifest.json + @rm -rf node_modules public/assets +