Skip to content
This repository has been archived by the owner on Jun 13, 2020. It is now read-only.

Commit

Permalink
adding PREFIX to Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
maateen committed Jun 8, 2018
1 parent 4413139 commit 613c887
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@
SHELL := /bin/bash
OUT_DIR = /usr/share/battery-monitor
PREFIX ?= /usr/share

all: install
@:

install:
@echo You must be root to install.
@mkdir -p $(OUT_DIR)
@cp -r src/icons $(OUT_DIR)/icons
@cp src/__init__.py $(OUT_DIR)/__init__.py
@cp src/BatteryMonitor.py $(OUT_DIR)/BatteryMonitor.py
@cp src/AppIndicator.py $(OUT_DIR)/AppIndicator.py
@cp src/config.py $(OUT_DIR)/config.py
@cp src/Notification.py $(OUT_DIR)/Notification.py
@cp src/run.py $(OUT_DIR)/run.py
@cp src/SettingsWindow.py $(OUT_DIR)/SettingsWindow.py
@cp battery-monitor /usr/bin/battery-monitor
@chmod +x /usr/bin/battery-monitor
@cp battery-monitor-autostart.desktop /etc/xdg/autostart/battery-monitor-autostart.desktop
@cp battery-monitor.desktop /usr/share/applications/battery-monitor.desktop
install -d $(DESTDIR)$(PREFIX)/battery-monitor
cp -a src/. $(DESTDIR)$(PREFIX)/battery-monitor
install -Dm755 battery-monitor /usr/local/bin/battery-monitor
install -Dm755 battery-monitor-autostart.desktop /etc/xdg/autostart/battery-monitor-autostart.desktop
install -Dm755 battery-monitor.desktop /usr/share/applications/battery-monitor.desktop
@echo Installation completed!

uninstall:
@echo You must be root to uninstall.
@rm -rf $(OUT_DIR)
@rm -f /usr/bin/battery-monitor
@rm -rf $(DESTDIR)$(PREFIX)/battery-monitor
@rm -f /usr/local/bin/battery-monitor
@rm -f /etc/xdg/autostart/battery-monitor-autostart.desktop
@rm -f /usr/share/applications/battery-monitor.desktop
@echo Uninstallation completed!

0 comments on commit 613c887

Please sign in to comment.