aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 0ba1b1abbaedbab639333b7a8758892a8d381049 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
NAME = gopher
BIN = gopher.filter.dpi
OBJ = gopher.filter.dpi.o io.o dpi.o
DILLO_DIR = ~/.dillo
DPI_DIR = $(DILLO_DIR)/dpi
DPIDRC = $(DILLO_DIR)/dpidrc

all: $(BIN)

$(BIN): $(OBJ)

$(DPIDRC):
	cp /etc/dillo/dpidrc $@

install-proto: $(DPIDRC)
	echo 'proto.gopher=gopher/gopher.filter.dpi' >> $<
	dpidc stop || true

install: $(BIN) install-proto
	mkdir -p $(DPI_DIR)/$(NAME)
	cp -f $(BIN) $(DPI_DIR)/$(NAME)

link: $(BIN) install-proto
	mkdir -p $(DPI_DIR)/$(NAME)
	ln -frs $(BIN) $(DPI_DIR)/$(NAME)

uninstall: $(BIN)
	rm -f $(DPI_DIR)/$(NAME)/$(BIN)

clean:
	rm $(BIN) $(OBJ)

.PHONY:
	all install uninstall clean