update Makefile, removed old stuff

This commit is contained in:
yusing 2025-03-01 16:31:03 +08:00
parent 34a3739545
commit 98d0c9a4f6

View file

@ -14,28 +14,31 @@ else
endif endif
ifeq ($(trace), 1) ifeq ($(trace), 1)
debug = 1 debug = 1
GODOXY_TRACE ?= 1 GODOXY_TRACE ?= 1
GODEBUG = gctrace=1 inittrace=1 schedtrace=3000
endif
ifeq ($(race), 1)
debug = 1
BUILD_FLAGS += -race
endif endif
ifeq ($(debug), 1) ifeq ($(debug), 1)
CGO_ENABLED = 0 CGO_ENABLED = 0
GODOXY_DEBUG = 1 GODOXY_DEBUG = 1
BUILD_FLAGS ?= -tags production BUILD_FLAGS += -gcflags=all='-N -l'
endif endif
ifeq ($(pprof), 1) ifeq ($(pprof), 1)
CGO_ENABLED = 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 GORACE = log_path=logs/pprof strip_path_prefix=$(shell pwd)/ halt_on_error=1
BUILD_FLAGS = -race -gcflags=all='-N -l' -tags pprof BUILD_FLAGS = -tags pprof
DOCKER_TAG = pprof
VERSION := ${VERSION}-pprof VERSION := ${VERSION}-pprof
else else
CGO_ENABLED = 0 CGO_ENABLED = 0
LDFLAGS += -s -w LDFLAGS += -s -w
BUILD_FLAGS = -pgo=auto -tags production BUILD_FLAGS = -pgo=auto
DOCKER_TAG = latest
endif endif
BUILD_FLAGS += -ldflags='$(LDFLAGS)' BUILD_FLAGS += -ldflags='$(LDFLAGS)'
@ -48,7 +51,6 @@ export GODOXY_TRACE
export GODEBUG export GODEBUG
export GORACE export GORACE
export BUILD_FLAGS export BUILD_FLAGS
export DOCKER_TAG
test: test:
GODOXY_TEST=1 go test ./internal/... GODOXY_TEST=1 go test ./internal/...
@ -85,28 +87,9 @@ ci-test:
cloc: cloc:
cloc --not-match-f '_test.go$$' cmd internal pkg 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: link-binary:
ln -s /app/${NAME} bin/run ln -s /app/${NAME} bin/run
# To generate schema # To generate schema
# comment out this part from typescript-json-schema.js#L884 # comment out this part from typescript-json-schema.js#L884
# #