TARGET = phd
RELEASE = target/release/$(TARGET)
DEBUG = target/debug/$(TARGET)
SOURCES = $(wildcard src/*.rs src/**/*.rs)
PREFIX = $(DESTDIR)/usr/local
BINDIR = $(PREFIX)/bin
.PHONY: release debug install uninstall clean
release: $(RELEASE)
debug: $(DEBUG)
install: $(RELEASE)
install $(RELEASE) $(BINDIR)/$(TARGET)
uninstall: $(RELEASE)
-rm $(BINDIR)/$(TARGET)
clean:
-rm -rf target
$(RELEASE): $(SOURCES)
cargo build --release
$(DEBUG): $(SOURCES)
cargo build
.PHONY: manual
manual: doc/phd.1
doc/phd.1: doc/phd.1.md scdoc
scdoc < doc/phd.1.md > doc/phd.1
scdoc:
@which scdoc || (echo "scdoc(1) not found."; \
echo "please install to build the manual: https://repology.org/project/scdoc"; exit 1)