aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodarima@gmail.com>2025-03-08 14:59:11 +0100
committerRodrigo Arias Mallo <rodarima@gmail.com>2025-03-08 14:59:11 +0100
commit4350eec6a845224f1dbf2889211604090cabb9cb (patch)
tree4c940d9fc37be7548d7e04b05b6399965aed23d1 /Makefile
parent863cd653c5090952f92eb300beecbf8e667fcfe6 (diff)
Add Makefile and dpi wrapper
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile34
1 files changed, 34 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..159e26a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,34 @@
+NAME = info
+BIN = $(NAME).filter.dpi
+EXTRA = info2html info2html.css info2html.conf
+DILLO_DIR = ~/.dillo
+DPI_DIR = $(DILLO_DIR)/dpi/$(NAME)
+DPIDRC = $(DILLO_DIR)/dpidrc
+
+all:
+ @echo "Use 'make install' to install"
+ @echo "Use 'make uninstall' to uninstall"
+
+$(DPIDRC):
+ cp /etc/dillo/dpidrc $@
+
+install-proto: $(DPIDRC)
+ grep -q '^proto.$(NAME)=$(NAME)' $< || echo 'proto.$(NAME)=$(NAME)/$(BIN)' >> $<
+
+link: $(BIN) install-proto
+ mkdir -p $(DPI_DIR)
+ ln -frs $(BIN) $(DPI_DIR)
+ ln -frs $(EXTRA) $(DPI_DIR)
+
+install: $(BIN) install-proto
+ mkdir -p $(DPI_DIR)
+ cp -f $(BIN) $(DPI_DIR)
+ cp -f $(EXTRA) $(DPI_DIR)
+
+uninstall: $(BIN)
+ rm -f $(DPI_DIR)/$(BIN)
+ cd $(DPI_DIR) && rm -f $(EXTRA)
+ rmdir $(DPI_DIR)
+
+.PHONY:
+ all link install install-proto uninstall