diff options
-rw-r--r-- | Makefile | 26 |
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 @@ | |||
3 | DESTDIR = | 3 | DESTDIR = |
4 | PREFIX = /usr/local | 4 | PREFIX = /usr/local |
5 | 5 | ||
6 | BIN = $(DESTDIR)$(PREFIX)/bin | ||
7 | RADIO_SHARE = $(DESTDIR)$(PREFIX)/share/radio | ||
8 | |||
9 | RADIO_BIN = $(BIN)/radio | ||
10 | RADIO_STATIONS = $(RADIO_SHARE)/stations | ||
11 | |||
6 | .PHONY: help | 12 | .PHONY: help |
7 | help: | 13 | help: |
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 |
18 | install: radio radio.stations | 29 | install: 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 | ||
34 | link: $(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 |
23 | uninstall: | 39 | uninstall: |
24 | rm $(DESTDIR)$(PREFIX)/bin/radio | 40 | rm $(RADIO_BIN) |
25 | rm -r $(DESTDIR)$(PREFIX)/share/radio/ | 41 | rm -r $(RADIO_SHARE) |