From 98d0c9a4f63a8b9d0e5733fa89541aa116726cd0 Mon Sep 17 00:00:00 2001 From: yusing Date: Sat, 1 Mar 2025 16:31:03 +0800 Subject: [PATCH] update Makefile, removed old stuff --- Makefile | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index a6e6813..8a1815f 100755 --- a/Makefile +++ b/Makefile @@ -14,28 +14,31 @@ else endif ifeq ($(trace), 1) - debug = 1 - GODOXY_TRACE ?= 1 + debug = 1 + GODOXY_TRACE ?= 1 + GODEBUG = gctrace=1 inittrace=1 schedtrace=3000 +endif + +ifeq ($(race), 1) + debug = 1 + BUILD_FLAGS += -race endif ifeq ($(debug), 1) CGO_ENABLED = 0 GODOXY_DEBUG = 1 - BUILD_FLAGS ?= -tags production + BUILD_FLAGS += -gcflags=all='-N -l' endif ifeq ($(pprof), 1) CGO_ENABLED = 1 - GODEBUG = gctrace=1 inittrace=1 schedtrace=3000 GORACE = log_path=logs/pprof strip_path_prefix=$(shell pwd)/ halt_on_error=1 - BUILD_FLAGS = -race -gcflags=all='-N -l' -tags pprof - DOCKER_TAG = pprof + BUILD_FLAGS = -tags pprof VERSION := ${VERSION}-pprof else CGO_ENABLED = 0 LDFLAGS += -s -w - BUILD_FLAGS = -pgo=auto -tags production - DOCKER_TAG = latest + BUILD_FLAGS = -pgo=auto endif BUILD_FLAGS += -ldflags='$(LDFLAGS)' @@ -48,7 +51,6 @@ export GODOXY_TRACE export GODEBUG export GORACE export BUILD_FLAGS -export DOCKER_TAG test: GODOXY_TEST=1 go test ./internal/... @@ -85,28 +87,9 @@ ci-test: cloc: cloc --not-match-f '_test.go$$' cmd internal pkg -push-docker-io: - BUILDER=build docker buildx build \ - --platform linux/arm64,linux/amd64 \ - -f Dockerfile \ - -t docker.io/yusing/${NAME}-nightly:${DOCKER_TAG} \ - -t docker.io/yusing/${NAME}-nightly:${VERSION}-${BUILD_DATE} \ - --build-arg VERSION="${VERSION}-nightly-${BUILD_DATE}" \ - --build-arg BUILD_FLAGS="${BUILD_FLAGS}" \ - --build-arg MAKE_ARGS="agent=${agent}" \ - --push . - -build-docker: - docker build -t ${NAME}-nightly \ - --build-arg VERSION="${VERSION}-nightly-${BUILD_DATE}" \ - --build-arg BUILD_FLAGS="${BUILD_FLAGS}" \ - --build-arg MAKE_ARGS="agent=${agent}" \ - . - link-binary: ln -s /app/${NAME} bin/run - # To generate schema # comment out this part from typescript-json-schema.js#L884 #