mirror of
https://github.com/akyaiy/GoSally-mvp.git
synced 2026-01-03 04:52:26 +00:00
- Removed obsolete files: `hanle_multi.go`, `logger.go`, `handle_com.go`, `handle_list.go`, `server.go`, and `utils.go` from the `general_server` and `sv1` packages. - Introduced new implementations for the `GeneralServer` and `HandlerV1` in the `core` package, enhancing the overall architecture. - Updated the `go.mod` and `go.sum` files to include new dependencies. - Added a new configuration structure in `config.yaml` and `config.go` for better management of application settings. - Implemented a Lua command handling mechanism in `handle_com.go` and `handle_list.go` for improved command execution. - Enhanced logging capabilities with a new logger setup in `logger.go`. - Added a new Lua script `http.lua` for handling HTTP requests.
59 lines
1.3 KiB
Makefile
59 lines
1.3 KiB
Makefile
APP_NAME := node
|
|
BIN_DIR := bin
|
|
GOPATH := $(shell go env GOPATH)
|
|
export CONFIG_PATH := ./config.yaml
|
|
CGO_CFLAGS := -I/usr/local/include
|
|
CGO_LDFLAGS := -L/usr/local/lib -llua5.1 -lm -ldl
|
|
.PHONY: all build run runq test fmt vet lint check clean
|
|
|
|
all: build
|
|
|
|
lint-setup:
|
|
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
|
|
|
goimports-setup:
|
|
go install golang.org/x/tools/cmd/goimports@latest
|
|
|
|
golicenses-setup:
|
|
go install github.com/google/go-licenses@latest
|
|
|
|
setup: lint-setup goimports-setup golicenses-setup
|
|
@echo "Setting up the development environment..."
|
|
@mkdir -p $(BIN_DIR)
|
|
@echo "Setup complete. Run 'make build' to compile the application."
|
|
|
|
build:
|
|
@echo "Building..."
|
|
@echo "CGO_CFLAGS is: '$(CGO_CFLAGS)'"
|
|
@echo "CGO_LDFLAGS is: '$(CGO_LDFLAGS)'"
|
|
CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o $(BIN_DIR)/$(APP_NAME) ./cmd/$(APP_NAME)
|
|
|
|
run: build
|
|
@echo "Running!"
|
|
./$(BIN_DIR)/$(APP_NAME)
|
|
|
|
runq: build
|
|
@echo "Running!"
|
|
./$(BIN_DIR)/$(APP_NAME) | jq
|
|
|
|
test:
|
|
@go test ./... | grep -v '^?' || true
|
|
|
|
fmt:
|
|
@go fmt ./...
|
|
@$(GOPATH)/bin/goimports -w .
|
|
|
|
vet:
|
|
@go vet ./...
|
|
|
|
lint:
|
|
@$(GOPATH)/bin/golangci-lint run
|
|
|
|
check: fmt vet lint test
|
|
|
|
licenses:
|
|
@$(GOPATH)/bin/go-licenses save ./... --save_path=third_party/licenses --force
|
|
@echo "Licenses have been exported to third_party/licenses"
|
|
|
|
clean:
|
|
@rm -rf bin
|