From 950d2e34c11c8794030fb1041d6e89294a1386a8 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 14 Nov 2019 01:01:10 +0100 Subject: Finished Makefile --- Makefile | 23 ++++++++++++++++++++++- bin/lowbat | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b83631e..e785757 100644 --- a/Makefile +++ b/Makefile @@ -1 +1,22 @@ -SRCS +.POSIX: + +OS = $(shell uname -s) +ifeq ($(OS), Darwin) + PREFIX = /usr/local +else + PREFIX = /usr +endif +MANPREFIX = $(PREFIX)/share/man + +install: + mkdir -p $(DESTDIR)$(PREFIX)/bin + cp -f bin/lowbat $(DESTDIR)$(PREFIX)/bin/ + chmod 755 $(DESTDIR)$(PREFIX)$/bin/lowbat + mkdir -p $(DESTDIR)$(MANPREFIX)/man1 + cp -f man/lowbat.1 $(DESTDIR)$(MANPREFIX)/man1/lowbat.1 + +uninstall: + rm -f $(DESTDIR)$(PREFIX)/bin/lowbat + rm -f $(DESTDIR)$(MANPREFIX)/man1/lowbat.1 + +.PHONY: install uninstall diff --git a/bin/lowbat b/bin/lowbat index 6b893a4..3a31f0b 100755 --- a/bin/lowbat +++ b/bin/lowbat @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh notify() { notify-send "Low battery" "Please plug in computer" -u critical -t 15000 -- cgit v1.2.3