From bf00c0c14c4c775ecc64207182e6d69c9fc99f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=B9=BF?= Date: Thu, 14 Nov 2024 11:16:34 +0800 Subject: [PATCH] add make --- .gitignore | 2 ++ tunnelserver/Makefile | 19 +++++++++++++++++++ conf.json => tunnelserver/conf.json | 0 main.go => tunnelserver/main.go | 0 4 files changed, 21 insertions(+) create mode 100644 .gitignore create mode 100644 tunnelserver/Makefile rename conf.json => tunnelserver/conf.json (100%) rename main.go => tunnelserver/main.go (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3a6f640 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +dist/ +vendor/ \ No newline at end of file diff --git a/tunnelserver/Makefile b/tunnelserver/Makefile new file mode 100644 index 0000000..05cc459 --- /dev/null +++ b/tunnelserver/Makefile @@ -0,0 +1,19 @@ +APP_NAME := tunnelserver +BIN_DIR := ../dist/tunnelserver + +all: $(BIN_DIR) $(BIN_DIR)/$(APP_NAME) copy + +$(BIN_DIR): + mkdir -p $(BIN_DIR) + +$(BIN_DIR)/$(APP_NAME): main.go + go build -o $@ $< +copy: + cp -r ./conf.json $(BIN_DIR) + +clean: + rm -f $(BIN_DIR) +test: + go test -v ./... + +.PHONY: clean test \ No newline at end of file diff --git a/conf.json b/tunnelserver/conf.json similarity index 100% rename from conf.json rename to tunnelserver/conf.json diff --git a/main.go b/tunnelserver/main.go similarity index 100% rename from main.go rename to tunnelserver/main.go