about summary refs log tree commit diff stats
path: root/Makefile
blob: f3c85eb988a3a2899af1db5b153e2adfbac0d22b (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
35
36
37
38
39
40
41
42
43
44
45
46
# misc
# by Case Duckworth <acdw@acdw.net>

NAME = misc
DESC = Manually Install or Source Compile ... a program
LICENSE = ISC

PREFIX = /usr/local
BIND = $(DESTDIR)$(PREFIX)/bin
BIN = $(BIND)/$(NAME)

EX_SRC = $(PWD)/examples
EX_DST = $(XDG_CONFIG_HOME)/$(NAME)

.PHONY: help install link uninstall examples link_examples

help:
	@echo "$(NAME) : $(DESC)"
	@echo "(C) 2023 Case Duckworth <acdw@acdw.net>"
	@echo "Licensed under the $(LICENSE) license; see COPYING for details."
	@echo
	@echo "TARGETS:"
	@echo " install	Install $(NAME) to $(BIN)."
	@echo " link		Install $(NAME) using symlinks."
	@echo "		Probably only useful for development."
	@echo " examples	Install plans in $(EX_SRC) to $(EX_DST)."
	@echo " link_examples	Install example plans using symlinks."
	@echo " uninstall	Uninstall $(NAME)-related files."

$(BIND):
	mkdir -p $@

install: $(NAME)
	install -D $< $(BIND)

link: $(NAME) $(BIND)
	ln -sf $(PWD)/$(NAME) $(BIN)

uninistall:
	rm -f $(BIN)

examples: $(EX_SRC)
	install -t $(EX_DST) $</*

link_examples: $(EX_SRC)
	ln -sf -t $(EX_DST) $</*