mirror of
https://github.com/jimeh/fastmail-rules.git
synced 2026-02-19 03:46:40 +00:00
29 lines
561 B
Makefile
29 lines
561 B
Makefile
#
|
|
# Build
|
|
#
|
|
|
|
BINDIR := bin
|
|
CMDDIR := cmd
|
|
|
|
SOURCES := $(shell find * -name "*.go" -or -name "go.mod" -or -name "go.sum" \
|
|
-or -name "Makefile")
|
|
BINS := $(shell test -d "$(CMDDIR)" && cd "$(CMDDIR)" && \
|
|
find * -maxdepth 0 -type d -exec echo $(BINDIR)/{} \;)
|
|
|
|
.PHONY: build
|
|
build: $(BINS)
|
|
|
|
$(BINS): $(BINDIR)/%: $(SOURCES)
|
|
mkdir -p "$(dir $@)"
|
|
cd "$(CMDDIR)/$*" && go build -a -o "$(CURDIR)/$(BINDIR)/$*"
|
|
|
|
#
|
|
# Rules
|
|
#
|
|
|
|
rules: spammy-recruiters.json
|
|
|
|
.PHONY: spammy-recruiters.json
|
|
spammy-recruiters.json: bin/spammy-recruiters
|
|
bin/spammy-recruiters -o "$@"
|