37 lines
865 B
Makefile
37 lines
865 B
Makefile
BINARY := rtsp-streamer
|
|
PKG := ./cmd/rtsp-streamer
|
|
BINDIR := bin
|
|
LDFLAGS := -s -w
|
|
|
|
.PHONY: all build pi pi32 test vet clean run-tui
|
|
|
|
all: build
|
|
|
|
## build: compile for the host platform
|
|
build:
|
|
go build -ldflags '$(LDFLAGS)' -o $(BINDIR)/$(BINARY) $(PKG)
|
|
|
|
## pi: cross-compile for Raspberry Pi 4 running a 64-bit OS (arm64)
|
|
pi:
|
|
GOOS=linux GOARCH=arm64 go build -ldflags '$(LDFLAGS)' -o $(BINDIR)/$(BINARY)-arm64 $(PKG)
|
|
|
|
## pi32: cross-compile for a 32-bit Pi OS (armv7)
|
|
pi32:
|
|
GOOS=linux GOARCH=arm GOARM=7 go build -ldflags '$(LDFLAGS)' -o $(BINDIR)/$(BINARY)-armv7 $(PKG)
|
|
|
|
## test: run unit tests
|
|
test:
|
|
go test ./...
|
|
|
|
## vet: run go vet
|
|
vet:
|
|
go vet ./...
|
|
|
|
## run-tui: launch the configurator against a scratch config
|
|
run-tui: build
|
|
RTSP_STREAMER_CONFIG=/tmp/rtsp-streamer.yaml $(BINDIR)/$(BINARY) tui
|
|
|
|
## clean: remove build artifacts
|
|
clean:
|
|
rm -rf $(BINDIR)
|