summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2022-07-07 13:53:07 -0500
committerCase Duckworth2022-07-07 13:53:07 -0500
commitc65b41dbd899bc7c6955138eca321780b95fc6cf (patch)
treedbb21d921d5b1e14ebc673bd1e5bafb5a530c999
parentLoop the kill to ensure death (diff)
downloadradio-c65b41dbd899bc7c6955138eca321780b95fc6cf.tar.gz
radio-c65b41dbd899bc7c6955138eca321780b95fc6cf.zip
Add make link target
-rw-r--r--Makefile26
1 files changed, 21 insertions, 5 deletions
diff --git a/Makefile b/Makefile index bea747e..b1fc5d9 100644 --- a/Makefile +++ b/Makefile
@@ -3,6 +3,12 @@
3DESTDIR = 3DESTDIR =
4PREFIX = /usr/local 4PREFIX = /usr/local
5 5
6BIN = $(DESTDIR)$(PREFIX)/bin
7RADIO_SHARE = $(DESTDIR)$(PREFIX)/share/radio
8
9RADIO_BIN = $(BIN)/radio
10RADIO_STATIONS = $(RADIO_SHARE)/stations
11
6.PHONY: help 12.PHONY: help
7help: 13help:
8 @echo "radio : Play online radio" 14 @echo "radio : Play online radio"
@@ -12,14 +18,24 @@ help:
12 @echo "TARGETS:" 18 @echo "TARGETS:"
13 @echo " install Install radio to $(DESTDIR)$(PREFIX)/bin/radio." 19 @echo " install Install radio to $(DESTDIR)$(PREFIX)/bin/radio."
14 @echo " An example configuration is at $(DESTDIR)$(PREFIX)/share/radio/stations." 20 @echo " An example configuration is at $(DESTDIR)$(PREFIX)/share/radio/stations."
21 @echo " link Install radio using symlinks."
22 @echo " Probably only useful for development."
15 @echo " uninstall Uninstall radio-related files." 23 @echo " uninstall Uninstall radio-related files."
16 24
25$(BIN) $(RADIO_SHARE):
26 mkdir -p $@
27
17.PHONY: install 28.PHONY: install
18install: radio radio.stations 29install: radio radio.stations $(BIN) $(RADIO_SHARE)
19 install -D radio $(DESTDIR)$(PREFIX)/bin/radio 30 install -D radio $(RADIO_BIN)
20 install -D radio.stations $(DESTDIR)$(PREFIX)/share/radio/stations 31 install -D radio.stations $(RADIO_STATIONS)
32
33.PHONY: link
34link: $(BIN) $(RADIO_SHARE)
35 ln -sf $(PWD)/radio $(RADIO_BIN)
36 ln -sf $(PWD)/radio.stations $(RADIO_STATIONS)
21 37
22.PHONY: uninstall 38.PHONY: uninstall
23uninstall: 39uninstall:
24 rm $(DESTDIR)$(PREFIX)/bin/radio 40 rm $(RADIO_BIN)
25 rm -r $(DESTDIR)$(PREFIX)/share/radio/ 41 rm -r $(RADIO_SHARE)