This commit is contained in:
2026-07-13 12:28:59 +08:00
parent 6c3de4b2ef
commit fe202a868f
55 changed files with 9316 additions and 349 deletions
+28 -11
View File
@@ -1,36 +1,38 @@
.DEFAULT_GOAL=help
.PHONY: clear linux win darwin release image image-push up down help
BINARY_NAME := iptvc
IMAGE_TAG ?= latest
GOARCH ?= amd64
GOOS ?= linux
## clean: Remove all compiled binaries
clean:
@go clean
## clear = Remove all compiled binaries
clear:
@go clear
@rm -rf bin/
## linux: Build new binaries for linux
## linux = Build new binaries for linux
linux:
@rm -rf bin/linux_$(GOARCH)
@GOARCH=$(GOARCH) GOOS=linux go build -o bin/linux_$(GOARCH)/$(BINARY_NAME) .
@zip -j bin/linux_$(GOARCH).zip bin/linux_$(GOARCH)/$(BINARY_NAME)
@echo "Compiled: bin/linux_$(GOARCH)/$(BINARY_NAME) ($(GOARCH))"
## win: Build new binaries for windows
## win = Build new binaries for windows
win:
@rm -rf bin/windows_$(GOARCH)
@GOARCH=$(GOARCH) GOOS=windows go build -o bin/windows_$(GOARCH)/$(BINARY_NAME).exe .
@zip -j bin/windows_$(GOARCH).zip bin/windows_$(GOARCH)/$(BINARY_NAME).exe
@echo "Compiled: bin/windows_$(GOARCH)/$(BINARY_NAME).exe ($(GOARCH))"
## darwin: Build new binaries for darwin
## darwin = Build new binaries for darwin
darwin:
@rm -rf bin/darwin_$(GOARCH)
@GOARCH=$(GOARCH) GOOS=darwin go build -o bin/darwin_$(GOARCH)/$(BINARY_NAME) .
@zip -j bin/darwin_$(GOARCH).zip bin/darwin_$(GOARCH)/$(BINARY_NAME)
@echo "Compiled: bin/darwin_$(GOARCH)/$(BINARY_NAME) ($(GOARCH))"
## release: Build all binaries and zip them
release: clean
## release = Build all binaries and zip them
release: clear
@make linux GOARCH=amd64
@make linux GOARCH=arm64
@make win GOARCH=amd64
@@ -38,7 +40,22 @@ release: clean
@make darwin GOARCH=amd64
@make darwin GOARCH=arm64
## help: Show this message and exit
## image = Build and push the Docker image
image:
@GOOS=$(GOOS) GOARCH=$(GOARCH) ./build-docker-image.sh $(IMAGE_TAG)
## image-push = Alias for image
image-push: image
## up = Build and start the Docker Compose environment
up:
@docker compose up -d --build
## down = Stop the Docker Compose environment
down:
@docker compose down
## help = Show this message and exit
help: Makefile
@echo "Available recipes:"
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@sed -n 's/^##/ /p' $< | column -t -s '='