Files
sift/Makefile
T
kyle 9444a35322 p1: /v2/scrape, /v1/fetch, auth, CLI, contract tests
Single Fetcher.Fetch on the Guard that holds DenyPrefixes. skipTlsVerification
is ignored. No 502. keys add writes the secret only to --out. Release binary
has no -test-allow-prefix.
2026-09-22 21:54:01 -07:00

48 lines
1.6 KiB
Makefile

# Makefile is the source of truth for build flags. The flake's buildGoModule
# uses the same -trimpath / ldflags, and `nix flake check` runs `make test lint`.
PREFIX ?= /usr/local
DESTDIR ?=
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
LDFLAGS := -s -w -X main.version=$(VERSION)
CGO_ENABLED ?= 0
GO ?= go
STATICCHECK ?= $(shell command -v staticcheck 2>/dev/null)
.PHONY: all build test lint contract install clean
all: build
build:
CGO_ENABLED=$(CGO_ENABLED) $(GO) build -trimpath -ldflags "$(LDFLAGS)" -o bin/sift ./cmd/sift
test:
$(GO) test -race ./...
lint:
$(GO) vet ./...
@if [ -n "$(STATICCHECK)" ]; then $(STATICCHECK) ./...; else echo "staticcheck not found; skipped"; fi
# Hermes 0.19/0.21 SDK harness (firecrawl-py==4.17.0) against a local sifttest binary.
contract:
$(GO) test -count=1 ./internal/api ./internal/auth ./internal/guard
@if command -v python3 >/dev/null 2>&1; then \
$(GO) build -tags sifttest -trimpath -ldflags "$(LDFLAGS)" -o bin/sift-test ./cmd/sift && \
python3 tests/contract/sdk_test.py; \
else echo "python3 not found; SDK contract skipped"; fi
install: build
install -d $(DESTDIR)$(PREFIX)/bin
install -m 755 bin/sift $(DESTDIR)$(PREFIX)/bin/sift
install -d $(DESTDIR)/etc/sift
if [ ! -f $(DESTDIR)/etc/sift/config.toml ]; then \
install -m 644 dist/sift.toml.example $(DESTDIR)/etc/sift/config.toml; \
fi
install -d $(DESTDIR)$(PREFIX)/lib/systemd/system
install -m 644 dist/sift.service $(DESTDIR)$(PREFIX)/lib/systemd/system/sift.service
clean:
rm -rf bin/
rm -f sift *.test