From 7b20e582720e40c179be4abbae3261ea81537d2d Mon Sep 17 00:00:00 2001 From: winlin Date: Mon, 9 Sep 2024 11:22:14 +0800 Subject: [PATCH] Refine makefile. --- proxy/.gitignore | 3 ++- proxy/Makefile | 11 ++++++++--- proxy/env.go | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/proxy/.gitignore b/proxy/.gitignore index e36140cad..c20f4b678 100644 --- a/proxy/.gitignore +++ b/proxy/.gitignore @@ -1,3 +1,4 @@ .idea srs-proxy -.env \ No newline at end of file +.env +.go-formarted \ No newline at end of file diff --git a/proxy/Makefile b/proxy/Makefile index 692cf2025..29084d5b7 100644 --- a/proxy/Makefile +++ b/proxy/Makefile @@ -2,17 +2,22 @@ all: build -build: fmt +build: fmt ./srs-proxy + +./srs-proxy: *.go go build -o srs-proxy . test: go test ./... -fmt: +fmt: ./.go-formarted + +./.go-formarted: *.go + touch .go-formarted go fmt ./... clean: - rm -f srs-proxy + rm -f srs-proxy .go-formarted run: fmt go run . diff --git a/proxy/env.go b/proxy/env.go index 8ec2b0e82..0c201bb1d 100644 --- a/proxy/env.go +++ b/proxy/env.go @@ -30,6 +30,7 @@ func loadEnvFile(ctx context.Context) error { return nil } +// buildDefaultEnvironmentVariables setups the default environment variables. func buildDefaultEnvironmentVariables(ctx context.Context) { // Whether enable the Go pprof. setEnvDefault("GO_PPROF", "")