From aaca9d889ba66ce52fde33039d7e57fc7faee468 Mon Sep 17 00:00:00 2001 From: Benson Wong Date: Fri, 4 Oct 2024 11:07:00 -0700 Subject: [PATCH] add Makefile --- Makefile | 27 +++++++++++++++++++++++++++ llama-proxy.go | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7f0303c --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ +# Define variables for the application +APP_NAME = llamagate +BUILD_DIR = build + +# Default target: Builds binaries for both OSX and Linux +all: mac linux + +# Clean build directory +clean: + rm -rf $(BUILD_DIR) + +# Build OSX binary +mac: + @echo "Building Mac binary..." + GOOS=darwin GOARCH=arm64 go build -o $(BUILD_DIR)/$(APP_NAME)-darwin-arm64 + +# Build Linux binary +linux: + @echo "Building Linux binary..." + GOOS=linux GOARCH=amd64 go build -o $(BUILD_DIR)/$(APP_NAME)-linux-amd64 + +# Ensure build directory exists +$(BUILD_DIR): + mkdir -p $(BUILD_DIR) + +# Phony targets +.PHONY: all clean osx linux diff --git a/llama-proxy.go b/llama-proxy.go index b948dd6..098d6ea 100644 --- a/llama-proxy.go +++ b/llama-proxy.go @@ -25,7 +25,7 @@ func main() { proxyManager := proxy.New(config) http.HandleFunc("/", proxyManager.HandleFunc) - fmt.Println("Proxy server started on :8080") + fmt.Println("Proxy server started on " + *listenStr) if err := http.ListenAndServe(*listenStr, nil); err != nil { fmt.Printf("Error starting server: %v\n", err) os.Exit(1)