.POSIX: DILLO_DIR=~/.dillo DPI_DIR=$(DILLO_DIR)/dpi DPIDRC=$(DILLO_DIR)/dpidrc PROTO=did NAME=did BIN_NAME=did.dpi BIN=target/debug/did-dpi SRC = src/main.rs all: $(BIN) test: @#cargo test cargo build -dpidc stop @#timeout 1 dillo did:asdf $(BIN): $(SRC) cargo build install: $(BIN) install-proto mkdir -p $(DPI_DIR)/$(NAME) cp -f $(BIN) $(DPI_DIR)/$(NAME)/$(BIN_NAME) link: $(BIN) install-proto mkdir -p $(DPI_DIR)/$(NAME) ln -frs $(BIN) $(DPI_DIR)/$(NAME)/$(BIN_NAME) install-proto: test -e $(DPIDRC) || cp /etc/dillo/dpidrc $(DPIDRC) grep -qF 'proto.$(PROTO)=$(NAME)/$(BIN_NAME)' $(DPIDRC) ||\ echo 'proto.$(PROTO)=$(NAME)/$(BIN_NAME)' >> $(DPIDRC) clean: cargo clean uninstall: rm -f $(DPI_DIR)/$(NAME)/$(BIN_NAME) test -s $(DPIDRC) && sed -i~ '/proto\.$(PROTO)=$(NAME)\/$(BIN_NAME)/d' $(DPIDRC)