Files
golang-lab4/Makefile
2025-11-07 05:26:09 +08:00

22 lines
332 B
Makefile

.PHONY: all swagger clean
SWAG ?= ~/go/bin/swag
SWAG_INIT_ARGS += -o docs -g cmds/server.go
GO_ENV += CGO_ENABLED=0
SOURCE := $(shell find . -type f -name '*.go')
TARGET := lab4
all: swagger $(TARGET)
swagger:
$(SWAG) fmt
$(SWAG) init $(SWAG_INIT_ARGS)
$(TARGET): $(SOURCE)
$(GO_ENV) go build -o $@
clean:
-rm $(TARGET)